Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Building for distribution?
Building for distribution? [message #741041] Wed, 19 October 2011 01:58 Go to next message
Eclipse UserFriend
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 #741101 is a reply to message #741041] Wed, 19 October 2011 03:23 Go to previous messageGo to next message
Eclipse UserFriend
I don't know if this will help you but there is an Eclipse plugin for the Nullsoft installer
http://nsis.sourceforge.net/EclipseNSIS_-_NSIS_plugin_for_Eclipse

BTW, the Wiki is here
http://wiki.eclipse.org/CDT/User/FAQ

[Updated on: Wed, 19 October 2011 03:30] by Moderator

Re: Building for distribution? [message #741683 is a reply to message #741041] Wed, 19 October 2011 15:56 Go to previous messageGo to next message
Eclipse UserFriend
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 #742852 is a reply to message #741683] Thu, 20 October 2011 18:45 Go to previous messageGo to next message
Eclipse UserFriend
I've been trying to figure out how to get the CDT to automatically compile those libraries into my executable, but even finding information on the command line options available with MinGW's linker has proven difficult.

The deeper I dig into this, the more trouble it seems I'll run into down the line when I want to distribute applications compiled using the CDT. I didn't want to, but I downloaded Microsoft Visual Studio 10 Express last night because it seems like so many of these "secret handshake" barriers are removed by (a) good documentation, (b) good design, and yes, (c) Microsoft owning the whole stack.
Re: Building for distribution? [message #743173 is a reply to message #742852] Fri, 21 October 2011 03:37 Go to previous message
Eclipse UserFriend
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.
Previous Topic:How to show backtrace from GDB ?
Next Topic:Problem with code style/indentation
Goto Forum:
  


Current Time: Sun Jul 20 03:00:06 EDT 2025

Powered by FUDForum. Page generated in 0.04630 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top