GithubHelp home page GithubHelp logo

Comments (4)

BobVul avatar BobVul commented on July 28, 2024

This is actually fixed in TDM-GCC 4.8.1:

The "-static-libstdc++" option, though still unnecessary, no longer causes a compilation error.

from cmdcolor.

alecmev avatar alecmev commented on July 28, 2024

As far as I know, GCC uses the shared version of libstdc++, if it's available:

When the g++ program is used to link a C++ program, it normally automatically links against libstdc++. If libstdc++ is available as a shared library, and the -static option is not used, then this links against the shared version of libstdc++. Source.

That's why I've specified it explicitly. However, I could probably just reduce it to -static.

from cmdcolor.

BobVul avatar BobVul commented on July 28, 2024

TDM-GCC is, ah... different from vanilla GCC. From their quirks page:

  • TDM-GCC doesn't link your programs with the libgcc or libstdc++ runtime DLLs by default.
  • Other toolchains default to DLL runtime linkage in order to allow you to throw exceptions among DLLs and EXEs.
  • TDM-GCC lets you throw exceptions among DLLs and EXEs even with the static runtime.
  • Your programs will not rely on any additional DLLs when compiling with default options.
  • TDM-GCC still includes DLL versions of the libgcc and libstdc++ runtimes, which you can enable for your program with "-shared-libgcc" and "-shared-libstdc++" if desired.

As quoted earlier, the -static-libstdc++ option was only added in 4.8.1.

TDM-GCC is fairly popular as a Win32 port of GCC (the other major one being MingW, which TDM-GCC is based on). It's also the default for Code::Blocks. So, not exactly obscure, but considering they've fixed it in the latest version it matters even less now.

from cmdcolor.

alecmev avatar alecmev commented on July 28, 2024

I see. But still, replacing -static-libgcc -static-libstdc++ with -static probably wouldn't hurt anybody, while adding out-of-the-box compatibility with older versions of TDM-GCC.

from cmdcolor.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.