[Qt-interest] Adding a library created with QT Creator
John McClurkin
jwm at nei.nih.gov
Sun Aug 2 21:59:54 CEST 2009
Patric wrote:
> I have succeeded to compile my project with the library with this simple
> line without relative paths... :
> win32:LIBS += -LC:/ -lTestLibrary
>
> And in my library there is a class Test with header Test.h.
>
> In the main.cpp of my project I'm trying to use this class now
> #include "Test.h"
> And the autocomplete is working for that class. But when I try to
> compile my project there is an error :
>
> main.cpp:2:20: circle.h: No such file or directory
> main.cpp: In function `int main(int, char**)':
>
> main.cpp:7: error: `Test' has not been declared
>
> main.cpp:7: error: `testMethod' was not declared in this scope
>
> main.cpp:7: warning: unused variable 'testMethod'
>
> mingw32-make[1]: *** [debug/main.o] Error 1
>
> mingw32-make: *** [debug] Error 2
>
> Exited with code 2.
>
> Error while building project TestProgram
>
> When executing build step 'Make'
>
>
>
> I hate this, what's the problem now ? Why it isn't working ?
In your previous post, there are a number of references to mingw32. You
also say that your library was compiled with Microsoft Visual C++. I may
be wrong but it has always been my understanding that you can't link
libraries compiled with Microsoft Visual C++ with applications compiled
with gcc. Try compiling the library with MinGW32 or compiling the
application with Microsoft Visual C++.
More information about the Qt-interest-old
mailing list