PDA

View Full Version : Link with my own lib : undefined reference to '_imp...



pl01
12th November 2010, 23:46
Hi,

I have create my own library with QT Creator 2.1 beta 2 and then I got a ".a" file :

libPureLight.a

I try to use it in a small application, well, I use the following line in my pro file :


win32:CONFIG(release, debug|release): LIBS += $$quote(D:/Business/studio/PureLight-build-desktop/release/libPureLight.a)
else:win32:CONFIG(debug, debug|release): LIBS += $$quote(D:/Business/studio/PureLight-build-desktop/debug/libPureLight.a)
But I got the following message :


undefined reference to '_imp__CreateScene" , where CreateScene is a method of the library !
So, how it is possible ?

tbscope
13th November 2010, 06:40
This undefined reference is when compiling or linking?

A note about the paths in your .pro file:
Do not use full paths. It makes it very hard to distribute your code to other computers.

pl01
13th November 2010, 08:00
Thanks,

I know it is just for the test.

Maybe the problem is the way I export/import from my ".a" file ? I use this :

__attribute__((dllimport))
__attribute__((dllexport))

with QT Creator 2.1 beta

tbscope
13th November 2010, 08:06
This undefined reference is when compiling or linking?