PDA

View Full Version : Qt + Eclipse + MinGW + Windows: How to include libraries?



jambrek
18th December 2007, 16:28
Hello,

I am using Qt with Eclipse and MinGW compiler for C++ under Windows. I can't load any libraries into my project. I just copy/paste libraries in project directory, and Eclipse recognize libs, but when I try to access to them it say "Resource not found". I edited .pro file with line
LIBS += -LD:/Darko/projects/PCapp -lFTCJTAG -lFTD2XX
where D:/Darko/projects/PCapp is directory witch contains libs, and FTCJTAG.lib and FTD2XX.lib are libs. When I try to use functions witch are in this libraries compiler returns me an error: "undefined reference to `_imp__JTAG_GetNumDevices@4'", and I think it's linker error. I also need to load dlls, and I go to Project Properties->C/C++ Project Paths->Libraries and there I add a dll files, but it doesn't work too. When I use this libs and dlls in MS Visual C++ it work perfectly.
What I have to do?
Sorry about my English.

Thanks!

high_flyer
19th December 2007, 10:33
In general, minGW and Eclipse are not "Qt aware" IDE's.
However, Eclipse has a Qt plugin which should make it possible to manage the project and the moc'ing (but I didn't test it so I can't comment on that).

In general, you need first to generate a Makefile out of the pro file, and to give that make file to the IDE you are working with.
Calling qmake in such cases has to be out side of the IDE. (Again, Eclips with Qt plugin might allow this from Eclipse)


When I try to use functions witch are in this libraries compiler returns me an error: "undefined reference to `_imp__JTAG_GetNumDevices@4'", and I think it's linker error.
Did you include the headers of these libs?

AFAIK under windows, the DLL's them selves are only used in runtime.
For building, you need the corresponding *.lib's.

jambrek
19th December 2007, 13:26
Yes, I included *.h files in my project. I will try that with make file. What exactly I need to edit in make file to include libraries? Is that -l"name of lib" for each lib or there is something else?
Thanks

high_flyer
19th December 2007, 13:57
I will try that with make file.
Not a good idea.
The make file is generate by qmake based on the pro file.