Archived

This topic is now archived and is closed to further replies.

666_1337

MinGW problem

Recommended Posts

hi i am using OpenGL for my graphics engine... unfortunately while "porting" it to windows i had to implement some kind of extention loader. the extention-funtion-pointers are located in a header file which is included to whatever source that requires it. now compiling it under linux with intelC runs perfect, and with gcc i have to use the "-Xlinker -zmuldefs" since the function pointers are included (redefined) in multiple sources. now what is the MinGW switch for gcc''s "-Xlinker -zmuldefs"? it ignores that switches (!)

Share this post


Link to post
Share on other sites
Since MingW is just a port of gcc (and related programs), the command line options are generally the same. I scanned a recent version of the linker manual at gnu.org (scroll down from here a bit) and it looks like the -z option is now ignored "for Solaris compatibility" whatever that means. I guess you were using an older version on linux?

The manual doesn''t show any obvious solution...

Share this post


Link to post
Share on other sites
Umm, this should not even be an issue...

You are (probably) doing this incorrectly, though there are two things that you might be trying to do.

Either you want to have a different function pointer for each source file, in which case you want to prefix the function pointer definition with ''static'' to create a different one for each source file.

Or you are wanting the same function pointer to be accessed in different source files, in which case you want to ''extern'' the definition in the header file (turning it into a declaration) and define it in a normal source file.

Share this post


Link to post
Share on other sites