Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to add GCC C++ Linker Flag AFTER cpp file ?(How can I add Magick++-config --ldflags --libs after the cpp file in g++ within Eclipse ? )
How to add GCC C++ Linker Flag AFTER cpp file ? [message #1860927] Sat, 09 September 2023 19:11
Konstantinos Mising name is currently offline Konstantinos Mising nameFriend
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
Previous Topic:Project opening fail
Next Topic:How to install C compiler for Eclipse
Goto Forum:
  


Current Time: Tue Jan 14 04:30:22 GMT 2025

Powered by FUDForum. Page generated in 0.02863 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top