C ++ Windows Command Prompt C1083 "Unable to open include:" Magick ++. H "No such file or directory"

More than 4 hours have passed since I made some progress, and was looking for documentation and links, and to be honest, I have no ideas. So here.

Background

  • I am compiling a C ++ program on the command line
  • I am new to the command line and quite new to C ++
  • I am writing this program in Notepad ++ (not VS), but VS is installed, so I can compile
  • I am trying to use ImageMagick through Magick ++, the C ++ API wrapper for it.
  • Main program catalog
    • C: / Program Files (x86) /CameraSoftware/myCameraProgram.cpp
  • Magick ++ Catalog
    • C: / Program Files (x86) / ImageSoftware / Magick ++ / lib / Magick.h

Questions

  • I am trying to use the Magick ++ API and therefore want to enable it
  • I just use this in the .cpp file #include <Magick++.h>
  • I fiddled with numerous solutions that worked for others, but to no avail
    • Fatal error C1083: Cannot open include file: "Magick ++. H": no such file or directory

Problem

  • How to compile and link to "Magick ++. H" correctly on the command line?
  • It is currently compiled as such
    • cl myCameraProgram.cpp / EHsc / link DSLRRemoteLib.lib
    • DSLRRemoteLib is a lib file located in the same directory, and / EHsc and / link are required to work

Other solutions

  • For projects with a visual studio, I believe you can add external paths to the project with some games with configurations, but I don’t have that luxury using notepad ++, so I really need to know how to compile this correctly
  • I tried hardcoding in myCameraProgram.cpp #include "COMPLETE_DIR_PATH / Magick ++. H" and it will compile, but Magick ++. h contains more in it (for example, #include <Magick++/Include.h> ), and this will cause error C1083 for each of the header files.
    • I also tried hard coding file paths in Magick ++. h and the same problems with the next level of header files. So this is not a solution.
    • I also tried applying an extra argument to the / link file in the compilation line
    • cl myCameraProgram.cpp /EHsc /link DSLRRemote "COMPLETE_DIR_PATH/Magick++.h" but does not work
    • Also tried cl myCameraProgram.cpp /EHsc /link DSLRRemote /l "COMPLETE_DIR_PATH/Magick++.h"
    • Along with several unsuccessful attempts.

Any help or advice would be greatly appreciated, thanks!

======== EDIT =========

Thanks for all the advice.

  • Using / I "C: \ Users \ ME \ Documents \ ImageMagick-6.8.1-10 \ Magick ++ \ lib" I could link #include "Magick ++. H" successfully, but it doesn’t look for other files anywhere else .
  • He cannot find #include, which is located on the path to the subdirectory "C: \ Users \ ME \ Documents \ ImageMagick-6.8.1-10 \ Magick ++ \ lib \ Magi ++ \ Include.h".
  • "Magick ++ / Include.h" also refers to another subdirectory in the parent directory.

Progress

  • My current prompt command line is:
  • cl "C: \ Users \ ME \ Documents \ ImageMagick-6.8.1-10 \ Magick ++ \ lib"
  • Finds "Magick ++. H"

Question

  • "Magick ++. H" is a header file containing 4 headers
  • When compiling, it cannot find other files located in a subdirectory
  • Is there a way to link ALL subdirectories and files along the way
  • "C: \ Users \ ME \ Documents \ ImageMagick-6.8.1-10" in the compilation by accident?
+4
source share
1 answer
 sudo apt-get install libmagickwand-dev imagemagick sudo apt-get install libmagick++-dev libmagick++4 
-2
source

All Articles