PDA

View Full Version : How do you link libraries in an imported "MakeFile Based" Project?



airbud
5th April 2012, 07:19
I know how to do it with a .pro file, but when you use the "Import MakeFile Based Project" option in QT-Creator, this is not an option. I rather not use qmake -project to generate a .pro since I already have a functioning makefile and everything.

I have .includes .create .config and .files. Which of these do I add the code to? Thanks

ChrisW67
6th April 2012, 01:08
I have no idea what you are talking about with, "I have .includes .create .config and .files."

You need to adjust the Makefile so that:

The compiler is given appropriate options for any include paths that need to be added. These would be "-I" options for GCC. If to be applied globally you might just be able to add them to a CFLAGS variable.
The linker is given appropriate options for any library paths that need to be added and any libraries that should be considered during linking. These would be "-L" and "-l" options for the GNU linker. If to be applied globally you might just be able to add them to a LFLAGS variable.

How you do these things is dependent on how your Makefile is structured, which compiler and linker you are using, and sometimes on which make utility you are using. If your Makefile is generated by a "configure" script of some sort you should look for options to add these things.