Building for distribution? [message #741041] |
Wed, 19 October 2011 01:58  |
Eclipse User |
|
|
|
Hello all,
Are there instructions for producing builds in the CDT that can be distributed? I've looked in the CDT documentation and couldn't find anything there (in fact, there wasn't much there at all).
Right now I'm copying an .exe from a Release directory on my build machine to another system, and I'm getting library dependency errors on standard libraries, which makes sense to me. I just don't know what libraries to include in a distribution (e.g., a setup.exe or .zip), how to include them properly, whether this is something that should be set up in the build or done brute force, etc.
I've searched the forum (and the web) for combinations of the keywords CDT, eclipse, windows, distribution, sharing, release, libraries, dependencies, and so on, but haven't found any straightforward authoritative documentation on how to do this properly.
It seems to me this is something Microsoft probably abstracts away by shipping their standard libraries with the O.S. -- it'd be a shame to see them "win" on this.
Also, is there a current CDT documentation wiki I could contribute to once I have an answer?
Thanks much,
-- TomG
|
|
|
|
Re: Building for distribution? [message #741683 is a reply to message #741041] |
Wed, 19 October 2011 15:56   |
Eclipse User |
|
|
|
I'm a TOTAL noob when it comes to real programming (aside from bash), and was wondering this as well. I was under the assumption that the MinGW toolchain would produce NATIVE windows executables... not be dependent on POSIX/GNU cruft a la Cygwin.
Even building the Hello World C++ project yeilds an executable that requires libgcc_s_dw2-1.dll, and libstdc++-6.dll (at the very least).
However, after researching MinGW on wikipedia (found NOTHING on the MinGW website/wiki) I found this:
"For languages other than C, MinGW uses the GNU runtime libraries (for example, GNU libstdc++ for C++)"
So I built the Hello World C project, and voila: a stand-alone executable. Delving further into gcc.gnu.org, libstdc++ has a "GCC Runtime exclusion" which allows linking/redistributing non-GPL code with the library, despite it being full-blown GPL.
As for libgcc_s_dw2-1.dll; I believe it is exclusive to MinGW, thus being public domain.
God, my brain hurts already, lol... but I hope this helps.
[Updated on: Wed, 19 October 2011 16:06] by Moderator
|
|
|
|
Re: Building for distribution? [message #743173 is a reply to message #742852] |
Fri, 21 October 2011 03:37  |
Eclipse User |
|
|
|
Add "-static-libgcc" to the linker options. mingwm10.dll and ligcc_s_dw2-1.dll will then be linked statically into your application. For libstdc++ you need the option "-static-libstdc++".
BTW, with Visual Studio you will have the same problem. The executable will then need some VS DLLS (e.g. msvcrt.dll). If your target system does not have these DLLs (you need the correct version!) you have to install them.
|
|
|
Powered by
FUDForum. Page generated in 0.04630 seconds