How to add GCC C++ Linker Flag AFTER cpp file ? [message #1860927] |
Sat, 09 September 2023 19:11 |
Konstantinos Mising name Messages: 1 Registered: September 2023 |
Junior Member |
|
|
Hello , I am new in C++ and Eclipse CDT in this context and I have created a very simple CPP file that uses Imagick that compiles and works great from command line in Linux using :
g++ `Magick++-config --cxxflags --cppflags` -o "/path/to/executable/Test" /path/to/file/Test.cpp `Magick++-config --ldflags --libs`
I have added the `Magick++-config --cxxflags --cppflags` part in (project) Properties > C/C++ Build / Settings / Tools Settings / GCC C++ Linker / Miscellaneous as Linker Flags and that part works great , what I haven't accomplished is to add the `Magick++-config --ldflags --libs` flag AFTER the cpp file.
Without it I am getting "undefined reference to" errors invoking GCC C++ Linker.
I have tried many things:
I have tried to put it as library , it goes to the end but with -l in front of it making of course no sense and getting cannot find -l-L/usr/lib
I have tried to put it next to `Magick++-config --cxxflags --cppflags` in the Linker Flag , but doesn't work , as I understand it needs to be declared after the cpp file.
I have tried many attempts in C / C++ General / Paths and Symbols again with no lack.
I can continue my work and compile the project through command line but I would really want to do it through Eclipse.
Any help explaining what should I do to make it work would be great.
Thank you in advance
|
|
|
Powered by
FUDForum. Page generated in 0.02863 seconds