Question

It has been over 4 hours since I made any progress at all, and searched documentation and links and frankly I'm out of ideas. So here goes.

Background

  • I am compiling a C++ program in command prompt
  • I am new to command prompt and fairly new to c++
  • I am writing this program in Notepad++ (not VS) but have VS installed so I can compile
  • I am trying to utilize ImageMagick through Magick++, a C++ API wrapper for it.
  • Main program directory
    • C:/Program Files (x86)/CameraSoftware/myCameraProgram.cpp
  • Magick++ directory
    • C:/Program Files (x86)/ImageSoftware/Magick++/lib/Magick.h

Issues

  • I am trying to use the Magick++ API and so I want to include it
  • I am just using this in the .cpp file #include <Magick++.h>
  • I've messed around with numerous solutions that has worked for others but to no avail
    • fatal error C1083: Cannot open include file: 'Magick++.h': No such file or directory

Problem

  • How do I correctly compile and link to 'Magick++.h' correctly through command prompt?
  • Currently it is compiled as such
    • cl myCameraProgram.cpp /EHsc /link DSLRRemoteLib.lib
    • DSLRRemoteLib is a lib file located in the same directory and /EHsc and /link is required for it to function

Other solutions

  • For visual studio projects, I believe you can add external directory paths to the project with some play around with the configurations, but I do not have that luxury using notepad++, so I really need to know how to compile this properly
  • I have tried hard coding in myCameraProgram.cpp #include "COMPLETE_DIR_PATH/Magick++.h" and it will compile, but Magick++.h has more includes within it(eg #include <Magick++/Include.h>), and it will bring up C1083 error for each of the header files.
    • I've also tried hard coding the filepaths within Magick++.h and same problems with the next level of header files. So this not a solution.
    • I've also tried to tack on an additional argument to the /link the file in the compile line
    • cl myCameraProgram.cpp /EHsc /link DSLRRemote "COMPLETE_DIR_PATH/Magick++.h" but doesnt work
    • Also tried cl myCameraProgram.cpp /EHsc /link DSLRRemote /l "COMPLETE_DIR_PATH/Magick++.h"
    • Along with multiple failed attempts.

Any help or advice or direction will be vastly appreciated, thanks!

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

Thanks for the tips everyone.

  • Using /I "C:\Users\ME\Documents\ImageMagick-6.8.1-10\Magick++\lib" I could link the #include "Magick++.h" successfully, but it doesn't look anywhere else for other files.
  • It cant find #include which is in a subdirectory path "C:\Users\ME\Documents\ImageMagick-6.8.1-10\Magick++\lib\Magic++\Include.h".
  • "Magick++/Include.h" also makes a reference to another subdirectory in the parent directory.

Progress

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

Issue

  • "Magick++.h" is a header file that includes 4 headers
  • Upon compiling, it cannot find the other files which is in a subdirectory
  • Is there a way to link ALL subdirectories and files under the path
  • "C:\Users\ME\Documents\ImageMagick-6.8.1-10" in a compile by any chance?
Was it helpful?

Solution

sudo apt-get install libmagickwand-dev imagemagick
sudo apt-get install libmagick++-dev libmagick++4
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top