Wanted: Dummy's guide to CodeBlocks /MS Free Tools 2003 / WX 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
daddydave
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 214
Joined: Wed Jun 15, 2005 3:31 am
Location: United States
Contact:

Wanted: Dummy's guide to CodeBlocks /MS Free Tools 2003 / WX

Post by daddydave » Mon Oct 03, 2005 8:18 pm

I'm looking for a guide to setup CodeBlocks with the free Microsoft Tools (2003) and wxWidgets. The closest thing I can find is

http://wiki.wxwidgets.org/wiki.pl?CodeB ... etup_Guide
Unfortunately this is for mingw only.

I also checked wiki.codeblocks.org and found
http://wiki.codeblocks.org/index.php/In ... Blocks_IDE

Unfortunately this doesn't include setup with wxWidgets, even though CodeBlocks was written with wxWidgets

NinjaNL
Moderator
Moderator
Posts: 899
Joined: Sun Oct 03, 2004 10:33 am
Location: Oosterwolde, Netherlands

Post by NinjaNL » Tue Oct 04, 2005 4:45 am

From http://wiki.codeblocks.org/index.php/In ... d_compiler
Compiler-neutral setup steps

Now that you have downloaded the setup file of the compiler of your choice, launch its installation by double-clicking on the setup file. The actual installation process is really simple. Just press "Next" all the way and you 're done.

If you installed the compiler on its default installation directory, there is nothing more to configure. Launch Code::Blocks and you 're all set :)

If that is not the case, launch Code::Blocks. If it is the first time you launch it, the compiler auto-detection will be launched. If your compiler was not auto-detected, go to "Settings/Configure plugins/Compiler", select the compiler you installed, switch to the "Programs" page and press "Auto-detect". If you get a message saying that the compiler was auto-detected, congratulations! If not, then press the button with the three dots next to the "Auto-detect" button and select the installation directory of your compiler manually.

NOTE: The compiler's installation directory is exactly this: the installation directory. Not the "bin" subdirectory nor any other.
Follow the development of my screenplay authoring program at http://wxscreenplaywriter.blogspot.com/

daddydave
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 214
Joined: Wed Jun 15, 2005 3:31 am
Location: United States
Contact:

Post by daddydave » Tue Oct 04, 2005 5:12 am

NinjaNL: It detects the compiler and Platform SDK fine and configures it accordingly, BUT not in a wxWidgets-aware way.

Code::Blocks contains a wxWidgets template, but it seems to be out of date, and no part of C::B seems to really detect wxWidgets, or at least not all of it, and I am happy to add the header locations and libraries, but I'm getting errors telling me to compile with unwind semantics for exception handling ---- and I'm thinking, WHY, when I didn't enable exceptions in either my (single threaded) project or wxWidgets.

When it runs the compiler, there are a lot of command line options built in that it warns are not recognized during the compile, leading me to believe it thinks I have some other version, perhaps the non-free one.

I had been able to compile the wxWidgets-2.6.1 libraries and samples using the MS free tools, but now it seems to be broken so I am going to start clean with 2.6.2, but I was running into this same problem before.

Perhaps someone who has a system like the one I describe, except working, could post their project template file within code tags?

daddydave
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 214
Joined: Wed Jun 15, 2005 3:31 am
Location: United States
Contact:

Post by daddydave » Tue Oct 04, 2005 5:36 am

Well it looks like Code::Blocks tries to use gcc compiler options with the Microsoft cl compiler (how the heck did that slip through?) and it's a known bug. That may be at least part of my problem

http://forums.codeblocks.org/index.php?topic=424
http://sourceforge.net/tracker/index.ph ... tid=707416

dziises
In need of some credit
In need of some credit
Posts: 8
Joined: Wed Sep 14, 2005 7:20 am

Post by dziises » Tue Oct 04, 2005 7:04 am

daddydave wrote: Perhaps someone who has a system like the one I describe, except working, could post their project template file within code tags?
Well i 'work' with CB, ms toolkit and wxwidgets ;)

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE Code::Blocks_project_file>
<Code::Blocks_project_file>
	<FileVersion major="1" minor="1"/>
	<Project>
		<Option title="Wxwidgets"/>
		<Option makefile="Makefile"/>
		<Option makefile_is_custom="0"/>
		<Option active_target="0"/>
		<Option compiler="1"/>
		<Build>
			<Target title="default">
				<Option output="Wxwidgets.exe"/>
				<Option working_dir=""/>
				<Option object_output=".objs"/>
				<Option deps_output=".deps"/>
				<Option external_deps=""/>
				<Option type="0"/>
				<Option compiler="1"/>
				<Option projectResourceIncludeDirsRelation="0"/>
				<Compiler>
					<Add option="/MT"/>
					<Add option="/O1"/>
					<Add directory="..\..\..\..\Dev\wxWidgets-2.6.2\contrib\include"/>
					<Add directory="..\..\..\..\Dev\wxWidgets-2.6.2\include"/>
					<Add directory="..\..\..\..\Dev\wxWidgets-2.6.2\lib\vc_lib\msw"/>
				</Compiler>
				<ResourceCompiler>
					<Add directory="..\..\..\..\Dev\wxWidgets-2.6.2\include"/>
				</ResourceCompiler>
				<Linker>
					<Add library="wxmsw26"/>
					<Add library="kernel32"/>
					<Add library="user32"/>
					<Add library="gdi32"/>
					<Add library="winspool"/>
					<Add library="shell32"/>
					<Add library="oleaut32"/>
					<Add library="uuid"/>
					<Add library="odbc32"/>
					<Add library="odbccp32"/>
					<Add library="comctl32"/>
					<Add library="rpcrt4"/>
					<Add library="wsock32"/>
					<Add library="wxzlib"/>
					<Add library="wxregex"/>
					<Add library="wxpng"/>
					<Add library="wxjpeg"/>
					<Add library="advapi32"/>
					<Add library="wxtiff"/>
					<Add library="comdlg32"/>
					<Add library="ole32"/>
					<Add directory="..\..\..\..\Dev\wxWidgets-2.6.2\lib\vc_lib"/>
				</Linker>
			</Target>
		</Build>
		<Unit filename="main.cpp">
			<Option compilerVar="CPP"/>
			<Option target="default"/>
		</Unit>
	</Project>
</Code::Blocks_project_file>
I know it is not perfect, but it works.
You need to edit it just a bit.

-e
This is the content of wxwidgets_static.cbp file.

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel » Tue Oct 04, 2005 7:53 am

codeblocks still uses wx 2.4.2, i checked their DLL... unless they changed... coz that was like 3 months back...

daddydave
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 214
Joined: Wed Jun 15, 2005 3:31 am
Location: United States
Contact:

Post by daddydave » Tue Oct 04, 2005 10:19 am

dziises, perfect, thank you!

lowjoel, The default template does use 2.4.2 :? : which is another problem. Maybe that one works with compiling C::B itself.

mispunt
Experienced Solver
Experienced Solver
Posts: 59
Joined: Tue Oct 19, 2004 3:23 pm
Location: Ede, Holland

Post by mispunt » Tue Oct 04, 2005 10:39 am

CodeBlocks is indeed still using 2.4.2, but this is going to be changed soon. The CVS version is already working with 2.6.1 (2.6.2 still gives some errors).
Working with Visual toolkit is possible, but it is not tested very much. Most of the devs are working with mingw. After the release of version 1 (we are almost at RC2, which is the last release candidate before the final version) we are going to change the whole compiler mechanism, so the support for Visual Toolkit would be better.

--Edit--
I can tell you that RC2 is using 2.6.x and also the template is modified ;)
OS: win XP pro
Compiler: MingW
wxWidgets version: 2.6.2

Post Reply