Starting a new thread intentionally from this thread:

   "Compiling FLTK on Windows road block"

On 21.01.2011 13:55, Albrecht Schlosser wrote:
 > On 21.01.2011 13:15, MacArthur, Ian (SELEX GALILEO, UK) wrote:

 >>> Side note: to get rid of (gcc 4.5.2) dll dependencies I also
 >>> configured with "LDFLAGS=-static", and now I don't have any
 >>> non-Windows dependencies again. This needs more investigation
 >>> how to make this automatic for default user setups...
 >>>
 >>> W/o -static you get something like:
 >>>
 >>> $ cygcheck test/threads | grep -v Windows
 >>> <path-to-fltk-1.3>\test\threads.exe
 >>> C:\MinGW\bin\libgcc_s_dw2-1.dll
 >>> C:\MinGW\bin\libstdc++-6.dll
 >>
 >>
 >> OK - that seems like a good thing, as I don't want to be distributing
 >> the gcc DLL's just to make my app work...
 >
 > Neither do I.
 >
 >> Setting the -static option is OK? It does not do anything weird with
 >> statically linking the MS system DLL's or anything bad like that?
 >
 > This is just a workaround I found to work for me. I didn't see any
 > side effects, but didn't look for it intensively. I'm in a process
 > to evaluate the new MinGW/MSYS (with gcc 4.5.2) for our commercial
 > app, so that we can get rid of using Cygwin as our build tool. I'll
 > keep you and the FLTK folks informed whatever I find, and I'll try
 > to put this into configure, of course. It should work OOTB.

I'm not sure anymore what we should do in the FLTK library/configure
script by default. Right now I don't think that we should change the
default configuration and leave it to the user to do what s/he needs.

I'm now using configure like this:

$ LDFLAGS="-static-libgcc -static-libstdc++" \
   ./configure \
   --prefix=... (more options)

The official documentation can be found here:

   http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

Especially the option -shared-libgcc (vs. -static-libgcc) is needed
to be able to "throw and catch exceptions across different shared
libraries". That is probably the reason why this is the default.

These options should be preferred over "-static", because -static
would link everything else also statically. I wouldn't mind much,
because I believe that in the Windows world there are only dll's
anyway (no static libs, at least for the Windows runtime), but it
is surely better to use these two options explicitly if you need
them.

Note that this does not only concern Windows, but gcc on all platforms.
My gcc 4.4.3 on Ubuntu 10.10 doesn't know -static-libstdc++, though
(-static-libgcc is okay). I can see a dependency on libstdc++.so.6
in fluid, for instance. I don't know whether this can be a portability
problem.

Comments welcome.

Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to