Confusion with MinGW-compiler-options Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
art-ganseforth
Earned some good credits
Earned some good credits
Posts: 147
Joined: Mon Sep 01, 2014 10:14 am

Confusion with MinGW-compiler-options

Post by art-ganseforth »

Hello everyone,

for a long time i worked with a compiler-setup, that i downloaded at once (IDE, compiler, libraries). Now i want to install the components myself and also update everything to the latest versions, but i'm a newbie in this point.
I was successfull in so far, that i have a working setup now: CondeBlocks (portable), MinGW, wxWidgets 3.1.2 and several openGL-libraries running on a Win10-x64-notebook. But still i don't really understand many things - especially this:

I've two applications: One is a complex openGL-program, the other one is quiet simple and only for testing, but also including the openOL-libraries and creating a wxGLCanwas. Both are (as far as i see) compiled with the same settings, but somehow one needs wxWidgets-dlls, the other one doen't. Similar effects i had with other test-programs.

Maybe someone can explain this?

Best,
Frank
Manolo
Can't get richer than this
Can't get richer than this
Posts: 827
Joined: Mon Apr 30, 2012 11:07 pm

Re: Confusion with MinGW-compiler-options

Post by Manolo »

There are two kind of libraries files:
a) dynamic. They are linked to the app as a reference, and loaded at runtime. On MSWindows these files have .dll extension.
b) static. They are linked to the app during linking-time, and so they become part of the .exe file. On MSWindows these files have .a extension if you use MinGW complier; or .lib for MSVStudio.

Creating a dynamic version of wxWidgets is achieved with Mingw using SHARED=1 in the compiling command line used, otherwise static files are created. For VS, just select the desired configuration (wx ships with VS projects).

Be aware that with Mingw the order of libraries (static or dynamic) in your app linking command is very important.

Also be aware that Mingw 64 and Mingw (only creates 32 bits targets) are different versions, created by different teams. And usually require some internal lib, wich can be statically linked using RUNTIME_LIBS=static for wx compiling, and -static parameter for your linking command for your app. TDM versions usually build those internal required GCC libs as static.
art-ganseforth
Earned some good credits
Earned some good credits
Posts: 147
Joined: Mon Sep 01, 2014 10:14 am

Re: Confusion with MinGW-compiler-options

Post by art-ganseforth »

Thank you for replying...

I use MingW32 currently. The order of libraries seems not to lead to problems at the moment, but if it does, i can copy the order of my working devC-setup.

In between i found out that C::B fooled me for two days, by compiling my test-application into one one folder, but starting an old version out of the other. So both programs (the test-program and my opengl-program) request dlls.


I'm not sure where to set "RUNTIME_LIBS=static" for wx compiling. This is one of my main problems i think. In fact (after years of not programming C), i once downloaded a 'package' containing wxWidgets 2.9.3, devC++ and MingW, where i had nothing to prepare on my own (later i insertet some libraries, but i always got a static exe witout dlls). So even if i program c since before windows, this is the first time i try to set up an IDE, by myself.

In the folder "wxWidgets-3.1.2\lib\gcc730_dll" are both: .dll-files and .a-files. I also include an uncompiled library (gelw.c). So i think both (static and dynamic linking) should be possible, or not??

Best,
Frank
art-ganseforth
Earned some good credits
Earned some good credits
Posts: 147
Joined: Mon Sep 01, 2014 10:14 am

Re: Confusion with MinGW-compiler-options

Post by art-ganseforth »

Problem is solved - found help at Code::Blocks-forum.
Post Reply