PDA

View Full Version : how to use .lib file in Qt in Linux



nthung
8th June 2010, 03:40
I have a .lib file but i don't know to use this file in Linux In windows i used it by LIBS += mylib.lib in .pro file
please help me
thanks

ChrisW67
8th June 2010, 06:11
Library files on Linux are typically libsomething.a (static) or libsomething.so (dynamic) not something.lib. You access library files the same way on Linux as you do on Windows. However, the name conventions are different:
LIBS += -L/path/to/search -lsomething
Is the .lib file from a Windows library? If so, then it isn't useable under Linux.

nthung
8th June 2010, 06:20
Library files on Linux are typically libsomething.a (static) or libsomething.so (dynamic) not something.lib. You access library files the same way on Linux as you do on Windows. However, the name conventions are different:
LIBS += -L/path/to/search -lsomething
Is the .lib file from a Windows library? If so, then it isn't useable under Linux.

thanks
I copied the .lib file from windows into linx
But i tried as you guiding but it don't run. I will try again, and report to 4rum after
thanks agian

ChrisW67
8th June 2010, 06:44
Is the .lib file from a Windows library? If so, then it isn't useable under Linux.

You will need to find/build the library in the Linux environment.

nthung
8th June 2010, 08:34
thanks for answer
this is my LIBS += -L/home/nthung/NVR_Demo_04_06_2010/NVR 8_6_V3/usr/lib -llibxvidcore it still don't run in the L/home/nthung/NVR_Demo_04_06_2010/NVR 8_6_V3/usr/lib I have 4 files
libxvidcore.a
libxvidcore.so
libxvidcore.so.4
libxvidcore.so.4.2\thaks

ChrisW67
8th June 2010, 08:46
The lib part of the library file name is implied. You also need to quote the space in the path.

LIBS += $$quote(-L/home/nthung/NVR_Demo_04_06_2010/NVR 8_6_V3/usr/lib) -lxvidcore

nthung
8th June 2010, 09:32
The lib part of the library file name is implied. You also need to quote the space in the path.

LIBS += $$quote(-L/home/nthung/NVR_Demo_04_06_2010/NVR 8_6_V3/usr/lib) -lxvidcore

i removed space but it still does not run