Author Topic: Separate lib files.  (Read 224 times)

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 22
Separate lib files.
« on: October 05, 2018, 08:57:14 am »
I am running Windows 10 64 bit Home Edition.
I am relying on the TDM 64 bit c++ compiler.
I am using Code::Blocks.

I want to use Code::Blocks to compile and build
my project's executable file without including
things like

libstdc++-6.dll

that are #include -ed into the executable, but
that I want to remain outside the executable,
to be relied on separately.  How do I acomplish this?

Offline Miguel Gimenez

  • Almost regular
  • **
  • Posts: 130
Re: Separate lib files.
« Reply #1 on: October 05, 2018, 09:42:44 am »
From the TDM page at http://tdm-gcc.tdragon.net/quirks

Quote
Static runtime linkage (libgcc & friends)

    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.

In the project options you have -static-libgcc and -static-libstdc++. If unchecking them is not enough, you should add -shared-libgcc and -shared-libstdc++ to Other compiler options.

Offline Zachary1234

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: Separate lib files.
« Reply #2 on: October 06, 2018, 04:58:55 am »
-I am not refering to that particular lib, or dll.  What options do I use to keep
any of my includes outside of the compiled exectuable?  I am still using the TDM
compiler.

?

Offline Miguel Gimenez

  • Almost regular
  • **
  • Posts: 130
Re: Separate lib files.
« Reply #3 on: October 06, 2018, 10:59:52 am »
That particular dll is managed the way I told you. For the others, you must link your program with static libraries if you don't want dlls and with shared libraries if you do want dlls.

When you compile or download a library you decide if it will be shared or static (you can build both, of course).