Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: somniantis on December 24, 2016, 03:26:30 am

Title: libstdc++
Post by: somniantis on December 24, 2016, 03:26:30 am
Update: So I've found out that codeblocks does link this statically. I was thrown off because I thought the "full command line" build log reflected all the commands sent to gcc. I learned to program using IDEs and now I'm finding out what they're doing in the background without telling me!



Ok, so when I build a simple c++ program through codeblocks which includes <iostream>, the executable runs just fine on its' own with no apparent runtime dependencies.

But why? libstdc++6.dll is not in the executable path nor the project path and there's no static linking going on in the build log.

Is codeblocks silently telling my linker to link libstdc++ statically? (and what about libstdc++'s own runtime dependencies?) How is this getting linked? Is codeblocks omitting things from the build log?

I'm just trying to get a deeper understanding of what exactly is happening.
Title: Re: libstdc++
Post by: stahta01 on December 24, 2016, 03:44:46 am
Code::Blocks automatically adds folders to the path used inside Code::Blocks. I know it adds the linker search folders for a fact.

So, run the exe from the command line and see if it works from there.

Tim S.
 
Title: Re: libstdc++
Post by: somniantis on December 24, 2016, 03:57:43 am
Code::Blocks automatically adds folders to the path used inside Code::Blocks. I know it adds the linker search folders for a fact.

So, run the exe from the command line and see if it works from there.

Tim S.

Well, the exe runs from anywhere on the system, so it must be statically linked to libstdc++, right? As far as I can tell, the dll is not in any directory on my system PATH.
Title: Re: libstdc++
Post by: oBFusCATed on December 26, 2016, 04:40:51 pm
1. CB doesn't link anything. The compiler/linker do this.
2. If it is static or dynamic depends on the default mode of the linker or on special flags
3. CB doesn't pass special flags for this by default
4. Have you tried depends.exe? It will tell you all dependencies of windows executables
5. Where is libstdc++.dll on your disk?