[CMake] Windows GCC 4.4 with shared libstdc++
Gregory Peele ARA/CFD
gpeele at ara.com
Tue Jul 7 23:31:39 EDT 2009
I think I may have figured out my issue on my own. I missed a very important line in the MinGW GCC 4.4 docs:
6. KNOWN ISSUES
- libstdc++_s is only partially implemented.
I monkeyed around with my linker settings by modifying my EXE / LIBARY / MODULE linker flags to contain "-nodefaultlibs" and explicitly linked against "gcc", "gcc_s", "msvcrt" and "stdc++_s". The result is that the only errors were undefined symbols from the C++ standard library. My guess is that these symbols are the pieces that haven't been implemented yet for shared libstdc++. If I'm reading the docs correctly, it looks like shared libstdc++ isn't necessary for any functionality on Windows, so I'm going to stick with static libstdc++.
Gregory Peele
Applied Research Associates, Inc.
________________________________________
From: Gregory Peele ARA/CFD
Sent: Monday, July 06, 2009 11:13 PM
To: cmake at cmake.org
Subject: Windows GCC 4.4 with shared libstdc++
Hey all,
I recently downloaded MinGW GCC 4.4 and have been toying around with it. I've been trying to get the shared libstdc++ support working under CMake 2.6.3. Anyone ever tried this before? Currently I'm having two issues - multiply defined symbols coming from libstdc++.a and libstdc++_s.a (presumably because the compiler is implicitly linking to the first and I'm also specifying linking to the second) and undefined references to std::exception default constructor.
According to MinGW documentation, only thing that should be necessary is adding -D_GLIBCXX_DLL for all input files and linking against libstdc++_s.a. The same project builds correctly when built with static libstdc++. Any thoughts?
Gregory Peele
Applied Research Associates, Inc.
More information about the CMake
mailing list