Results 1 to 4 of 4

Thread: Link with my own lib : undefined reference to '_imp...

  1. #1
    Join Date
    Oct 2010
    Posts
    95
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Link with my own lib : undefined reference to '_imp...

    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 ?

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Link with my own lib : undefined reference to '_imp...

    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.

  3. #3
    Join Date
    Oct 2010
    Posts
    95
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Link with my own lib : undefined reference to '_imp...

    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

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Link with my own lib : undefined reference to '_imp...

    This undefined reference is when compiling or linking?

Similar Threads

  1. Replies: 3
    Last Post: 18th December 2010, 14:55
  2. undefined reference
    By digidas in forum Newbie
    Replies: 9
    Last Post: 19th May 2010, 13:04
  3. Undefined reference to crt
    By derektaprell in forum Installation and Deployment
    Replies: 0
    Last Post: 20th October 2009, 08:34
  4. QCreator - undefined reference link errors
    By stodge in forum Newbie
    Replies: 2
    Last Post: 5th April 2009, 14:07
  5. Undefined Reference To...
    By ManuMies in forum Qt Programming
    Replies: 6
    Last Post: 10th February 2009, 12:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.