Results 1 to 7 of 7

Thread: add external api

  1. #1
    Join Date
    Jan 2009
    Posts
    54
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default add external api

    Hello.

    I am trying to include a external lib too, i have read different posts and I have used some alternatives but anyone is working.

    T think the righit way is including the lib as the link http://doc.trolltech.com/4.5/qmake-v...ence.html#libs tells, including the variables as tell this onehttp://www.brindusescu.org/?q=node/26 , and nothing.

    I am beginning to think I should modify the Makefile file. should i do?

    I am using Windows XP, a Qt project on Eclipse and Mingw as compiler.

    Cheers!!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: add external api

    You have to modify the LIBS and INCLUDPATH variables in your qmake project file to add the libraries to link against and include file paths from the "external api" you want to use.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2009
    Posts
    54
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: add external api

    I I did it.

    I am convert the .lib file to a .a, becuase I am compiling with MinGW. do I have to include the library .a in the same way as with the .lib.?

    I have include these commands in the project .pro:


    LIBS += -L "c:/library" -l"api_mil"

    And the compiler says:

    cannot find -lapi_mil

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: add external api

    Do you have api_mil.a in C:/library?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jan 2009
    Posts
    54
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: add external api

    Yes, i do. Although i have just to change the api_mil.a name to libapi_mil.a, becuase i think the prefix lib is neccesary to be recognized the .a. Am i right?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: add external api

    I'm not sure how it works on Windows. Maybe the .a file is invalid?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: add external api

    Quote Originally Posted by adamatic View Post
    Yes, i do. Although i have just to change the api_mil.a name to libapi_mil.a, becuase i think the prefix lib is neccesary to be recognized the .a. Am i right?
    You shouldn't change lib file names they can give unexpected results when compiling and especially with other build tools and if you give it to other people to compile
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

Similar Threads

  1. External Javascript file not loading initially
    By bkudrle in forum Qt Programming
    Replies: 0
    Last Post: 13th March 2009, 17:05
  2. Q3ScrollView resists to scroll down to the garbage bin
    By sivrisinek in forum Qt Programming
    Replies: 0
    Last Post: 5th February 2009, 17:50
  3. shared vs static
    By alisami in forum Installation and Deployment
    Replies: 3
    Last Post: 4th October 2008, 13:04
  4. Replies: 16
    Last Post: 23rd May 2008, 10:12
  5. Link Errors
    By magikalpnoi in forum Qt Programming
    Replies: 5
    Last Post: 25th September 2006, 22:04

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.