User forums > Help

switching between compilers?

(1/1)

Joerg:
Hi,
for my project I have to switch between MSVC++ 2005 and MingW.
I want to compile on different computers.
I I change to 'Microsoft Visual C++ 2005' in Project/Built Options
some things go wrong here.
The wxwidgets libs a still named libwx*.a instead wx*.lib.
Some defines are probably not correct for msc.
At least it's nearly impossible to change the toolchain
in an existing project.
Maybe its better to create a new one.
But than I need some hints to replace which files.
Regards,

Biplab:

--- Quote from: rekisum on October 06, 2007, 07:46:24 pm ---I I change to 'Microsoft Visual C++ 2005' in Project/Built Options
some things go wrong here.

--- End quote ---

Changing compiler will not automagically change the related compiler options. In that case you need to create a separate project / target.

The best solution is to create a new target using wxWidgets wizard for MSVC compiler and add it to your existing project. Use File > New > Target after you open your project in C::B and then create a new target with a different compiler.

Joerg:
Hi,

I added a new taget with File/New/Build target for MSVC 2005.
Thats a lot better than before, but still I can't compile.
I got a million of warnings. It starts with:

--- Code: ---cl : Command line warning D9002 : ignoring unknown option '-pipe' simbimApp.cpp
cl : Command line warning D9002 : ignoring unknown option '-mthreads'
D:\wxWidgets\include\wx/chkconf.h(1824) : warning C4668: 'wxUSE_WX_RESOURCES' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
C:\Programme\Microsoft Visual Studio 8\VC\include\string.h(141) : warning C4619: #pragma warning : there is no warning number '4609'
D:\wxWidgets\include\wx/strconv.h(416) : warning C4820: 'wxCSConv' : '3' bytes padding added after data member 'wxCSConv::m_deferred'
C:\Programme\Microsoft Visual Studio 8\VC\include\wchar.h(116) : warning C4820: '_wfinddata64i32_t' : '4' bytes padding added after data member '_wfinddata64i32_t::attrib'
.......

--- End code ---
And ends with an error:

--- Code: ---Linking executable: bin\DebugVC\icpsim.exe
LINK : fatal error LNK1181: cannot open input file 'libkernel32.a.lib'
Process terminated with status 1181 (0 minutes, 58 seconds)
1 errors, 1086 warnings

--- End code ---

So there is still something wrong in the compiler settings.
But where?
 

MortenMacFly:

--- Quote from: rekisum on October 08, 2007, 11:37:17 am ---So there is still something wrong in the compiler settings.
But where?

--- End quote ---
Enable full command line logging (see my sig) and post the output again. Check "other" compiler and linker flags for e.g. the "-pipe" and consorts. If found -> remove them. These are GCC switches.

Biplab:

--- Quote from: rekisum on October 08, 2007, 11:37:17 am ---So there is still something wrong in the compiler settings.
But where?

--- End quote ---

I believe you've discovered a bug in wxWidgets wizard. Few compiler setting are added at project level which means they will be applied to all the targets. They are compiler specific. In your case you started with GCC and then added MSVC target to it. Thus the options added in Project level (while preparing a project for MinGW) are still being used for the MSVC target which is causing this error.

At the moment I can't offer you any quick-fix solution for this. I think I need to rewrite a considerable portion of wxWidgets wizard to fix this. For the time being, I'd suggest you to create separate project for each compiler. :)

Navigation

[0] Message Index

Go to full version