PDA

View Full Version : add external api



adamatic
14th April 2009, 15:15
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!!

wysota
15th April 2009, 10:01
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.

adamatic
15th April 2009, 10:28
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

wysota
15th April 2009, 11:07
Do you have api_mil.a in C:/library?

adamatic
15th April 2009, 11:23
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?

wysota
15th April 2009, 12:06
I'm not sure how it works on Windows. Maybe the .a file is invalid?

ComaWhite
16th April 2009, 11:25
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