Works great now. I have attached a screen shot of the settings that I used because I am not sure what you are exactly asking about when you said: Did you check with Static lib of wx?
Hi Ryan, Thanks for your post.
I asked the question because I have changed the wizard for wx DLL lib mode in Rev 2. In static lib mode, the wizard adds Win32 SDK libs in project scope and wx libs in target scope. If you are using DLL, it adds only wx libs in target scope but NO Win32 SDK libs are added. Though a couple of essential libs, which varies with compilers, are always added to project scope. As the policy was different, that was generating errors.
Just a quick question for you, why do I get this message:
Precompiling header: wx_pch.h
Compiling: main.cpp
cc1plus.exe: warning: wx_pch.h.gch/Debug_wx_pch.h.gch: created using different flags
cc1plus.exe: warning: ./wx_pch.h.gch/Debug_wx_pch.h.gch: created using different flags
when I have first compiled as a Debug target, then go and rebuild the Release target?
I get that message all the time.
Each time, I switch between debug and release, I have to do a Re-Build to rebuild the pre-compiled headers because the -g flag has been toggled.
I don't think it's a result of the new wizard.
It's really annoying.
Lately, I don't even bother creating a release target. I just turn off the -g flag and re-build. Seems just as convienent as dealing with the precompiled issue.
Pecan is right. It's not the fault of new wizard. Code::Blocks adds the file, required for pre-compilation, in target scope which is compiled, but not linked. As you can see that the file is added to Debug and Release target, it is compiled twice with different flags. See the following code.
<Unit filename="wx_pch.h">
<Option compilerVar="CPP" />
<Option link="0" />
<Option weight="0" />
<Option target="Debug" />
<Option target="Release" />
</Unit>
I am currently working on adding support for pre-compiled headers for Borland C++ 5.5.1 and MSVC 8. I have added the support and it works fine for my project. After some more testing I'll post the revised code. But one point to note that it doesn't use Code::Block's PCH handling system.
Another problem with the sample code provided by the wizard is that it doesn't add wx_pch.h file to CPP files. Rather it is forcefully included. To me it should be included in the CPP file itself.
Wish you all Happy New Year.