I want to use qextserialport with Visual Studio 2005. I compiled the libary but get only a .dll and .a file.
How do I have to modify the .pro file to get a .lib file?
Matthias
I want to use qextserialport with Visual Studio 2005. I compiled the libary but get only a .dll and .a file.
How do I have to modify the .pro file to get a .lib file?
Matthias
MSVC doesn't produce .a files, MinGW does. Could you show us the compiler output?
J-P Nurmi
No. MSVC does produce .a files, but how are these related to .lib files? mingw produces .lib
files directly.
I have no idea what the compiler output should contain but here it is:
MatthiasE:\Daten\Dev\Qt\Bibliotheken\qextserialport-1.1\qextserialport>qmake
E:\Daten\Dev\Qt\Bibliotheken\qextserialport-1.1\qextserialport>nmake
Microsoft (R) Program Maintenance Utility, Version 8.00.50727.762
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -W3 -w34100 -w34189 -GR -EHsc
-DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -D_TTY_WIN_ -DQT_THREAD_SUPPORT -DQT_DL
L -DQT_NO_DEBUG -DQT_CORE_LIB -I"c:\Programme\Qt4\include\QtCore" -I"c:\Programm
e\Qt4\include\QtCore" -I"c:\Programme\Qt4\include" -I"c:\Programme\Qt4\include\A
ctiveQt" -I"build\moc" -I"." -I"c:\Programme\Qt4\mkspecs\default" -Fobuild\obj\
@C:\DOKUME~1\Matthias\LOKALE~1\Temp\nm293.tmp
qextserialbase.cpp
qextserialport.cpp
win_qextserialport.cpp
.\win_qextserialport.cpp(343) : warning C4100: 'c': Unreferenzierter formaler Pa
rameter
Code wird generiert...
link /LIBPATH:"c:\Programme\Qt4\lib" /NOLOGO /INCREMENTAL:NO /DLL /MANIF
ESTFILE:"build/obj\qextserialport.intermediate.manifest" /OUT:build\qextserialpo
rt.dll @C:\DOKUME~1\Matthias\LOKALE~1\Temp\nm294.tmp
mt.exe -nologo -manifest "build\obj\qextserialport.intermediate.manifes t
" -outputresource:build\qextserialport.dll;2
.lib -> static lib msvc
.d -> static lib mingw
.a or .lib -> static import lib (mingw/msvc)
.dll -> shared lib
so you either have to create your lib as static lib or make sure to export (search forum for Q_DECL_EXPORT / Q_DECL_IMPORT) to functions/classes you want to access from outside the lib.
what is the difference between "static import" and "static lib" ?
I have the .a lib. But the code request the .lib file. Can I simply rename it?
The main question of this thread was the "how do I do this".
This implies to change the whole code if the lib, doesn't it?
This is beyond the work I want to spent on the code of an 3dparty libary.
Matthias
When you compile a library with msvc you will never ever get a .a lib
A static import lib contains only stubs to the functions in the shared lib. It's needed by the linker to resolve them.
When you use qmake -> RTM or just compile the code into your app instead creating an own lib.
Bookmarks