Re: Build a static libraries for glib 2.24 on windows using mingw32



Title: Re: Build a static libraries for glib 2.24 on windows using mingw32
Hello Carl,

Thursday, May 26, 2011, 4:56:14 AM, you wrote:


Hello, 
And in the build I keep seeing -DDLL_EXPORT everywhere.


This means that a macro is expanded into a declspec(dllexport) statement telling the 
linker that the method is exported.




The truth is I don't understand quite well the role of DLL_EXPORT and how to 
get from a DLL build to a static build.


I don't know to but you have to compile without DLL_EXPORT for sure.
Make write your simple own makefile script. I did it once, it is not that 
difficult if you don't need to track dependencies - and you don't have to 
if you are not developing glib.


I tried to remove all mentions to DLL_EXPORT in the makefiles but hey keep
reappearing again and again :) To my utter despair.

For now, the perfect solution would be to make minor changes to the build
process (but I don't know where) configure and make the all thing.

Can this be done at mingw level ?
Is there anyone that can point me in the right direction about this ?

Another solution would be to collect all the generated .o files and make 
a big .a file from them. 
Would that work ? 
Wouldn't the different winmain functions collide at some point ?
Should I use ar or libtool to create the .a file from the .o's ?


There are no .a files on windows only DLLs.
They are compiled differently if used for DLL or static lib. 
For example an certain calling convention is enforced on exported 
functions and a jumptable is introduced because all calls into DLL 
functions are indirect jumps and not direct jumps. Therefore you
can't do that

Maybe someone else with more knowledge of glib give you specific
hints, i just wanted to comment on the overall difference.

And by the way, please people stop using this Mingw32 shit. 
It's a pain in the ass.

-- 
Best regards,
 Lothar                            mailto:llothar web de

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]