Create *.lib instead of *.a
-
hi,
i have read tons of articles about how to make a static library in qt on windows. but i am confused how to make *.libi have included to *.pro file 2 lines:
TEMPLATE = lib
CONFIG += staticlibeverything is fine, but when i compiled it, it makes only *.a library. and i need *.lib
can you tell me, what i doing wrong ?? i need *.lib library, because when i have *.a lib, i have to include library as well as its headers files to .pro file. i thing, this is impractical.
thanks for any advice
-
Actually I think that a .a file created by MinGw should be compatible to a Visual C++ compiler. So I assume you could use the .a like any other static library (.lib) created by a Visual C++ compiler and link it in your project.
If this proves to be wrong try compiling your library with a Visual C++ compiler as that should usually result in a .lib file.
-
I assume you could cramp all your definitions in one header file but that's really messy and quite not usable for other programmers (and in fact will prove not suitable in time for your self). What I usually do is providing one "entry point" header file that includes all other files that are necessary for accessing the libraries function.
Of course you'd still have to deploy all header files to the project that is using your library but I think its a reasonable effort to do and using your library will get easier when you provide a "one for all" header file.