mingw/tdm-gcc lib locations

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
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 466
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

mingw/tdm-gcc lib locations

Post by New Pagodi »

While trying to help with some other mingw/tdm-gcc questions, I've been trying doing some experiments with tdm64-gcc-5.1.0-2. At some point, I realized that I wasn't exactly sure what I was building. The libraries were being placed in lib\gcc_dll, so I assumed they were 32 bit libraries. But while using them in codeblocks, I realized I wasn't setting 32bit options. So I looked at the headers for the libraries with dumpbin, and that confirmed that they were in fact 64 bit libraries.

So I guess my questions are:
1) Shouldn't 64bit libraries built with mingw/tdm be placed in lib\gcc_x64_dll or lib\gcc_x64_lib to avoid confusion?
2) I was able to do that by adding "COMPILER_PREFIX=gcc_x64" to the options mingw32-make. Is there a better option to set to do that instead?
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 466
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: mingw/tdm-gcc lib locations

Post by New Pagodi »

As sort of a followup while investigating these things, I compared the visual studio and gcc make files. With visual studio, the output folder is set in wx_setup.props with the line:

Code: Select all

<wxOutDirName>$(wxCompilerPrefix)$(wxArchSuffix)_$(wxLibTypeSuffix)$(wxCfg)</wxOutDirName>
while in the gcc make files, the folder is set with

Code: Select all

LIBDIRNAME = \
	..\..\lib\$(COMPILER_PREFIX)$(COMPILER_VERSION)_$(LIBTYPE_SUFFIX)$(CFG)
Basically with visual studio, the wxArchSuffix (which I think is set automatically and can't be changed by the user) gets added to the folder name, but with gcc, the option COMPILER_VERSION (which is an empty string by default, but can be set by the user) is used instead. Shouldn't the folder naming be consistent, or am I completely misunderstanding these things?
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: mingw/tdm-gcc lib locations

Post by doublemax »

I agree that this is at least inconsistent. But as this is a user forum and there are no wxWidgets core developers here, things like this are better discussed on the mailing list or Google group: https://groups.google.com/forum/#!forum/wx-users
Use the source, Luke!
Manolo
Can't get richer than this
Can't get richer than this
Posts: 827
Joined: Mon Apr 30, 2012 11:07 pm

Re: mingw/tdm-gcc lib locations

Post by Manolo »

I have TDM 32 and TDM 64 in different folders. When I wish 32 bit version I do in the command line:

Code: Select all

PATH=%PATH%;C:\TDM-GCC-32\bin
mingw32-make -f makefile.gcc BUILD=debug USE_OPENGL=1 CFG=32 CXXFLAGS="-std=gnu++11"
An for the 64 bits

Code: Select all

PATH=%PATH%;C:\TDM-GCC-64\bin
mingw32-make -f makefile.gcc BUILD=debug USE_OPENGL=1 CFG=64 CXXFLAGS="-std=gnu++11"
Note the CFG flag, which makes my 32bit libs to be in my/wx/dir/\lib\gcc_lib32 and similar the 64 bit version.
When building an app, I just use the proper compiler version and change wx libs dirs.

It's possible also to use TDM-GCC-64 for building 32 bits. But I don't trust it, call me wary.
Post Reply