User forums > Using Code::Blocks

A little step by step tutorial, please [SOLVED]

(1/5) > >>

nmambre:
Hi all,

I'm new to C++ and wxWidgets... so I spent some time reading for tools to use both. I found wxdevcpp, with mingw included, could install it, create simple project and compile. (There is a little tutorial included too).

But... I plan to (someday) move to linux, so C::B seems the right choice, also I like the idea of C::B being created with wx itself.

So I downloaded RC2 and could not compile a simple wxwidget project, but could compile a wingui one.
Searched in the forum, and found this info:


--- Quote from: TDragon on March 02, 2006, 11:12:17 pm ---Or...

1. MinGW-5.0.2.exe, install to C:\MinGW
2. 7z432.exe, install anywhere
3. CB_20060302_rev2119_win32.7z, extract to C:\CodeBlocks
4. wxmsw26u_gcc_cb.7z, extract to C:\CodeBlocks

and you're finished. (C:\CodeBlocks\codeblocks.exe to run.)

--- End quote ---

(already had 7zip, and went to nightly build page to download most recent)

The nightly build now has option to create wxSmith also, but still can not compile. (Wingui goes fine). The error is this:

-------------- Build: default in wxstatic ---------------
Precompiling header: wx_pch.h
In file included from <command line>:5:
./wx_pch.h:9:23: wx/wxprec.h: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings
 

So anyone can show me (step by step, in Windows) how to create and compile a simple project using wxSmith and/or wxWidgets template?

The tutorials in the wiki are about building C::B itself, for the moments I just want to use it.

(is this a bug or something to configure? where do I find info on configuration)


Nelson
YAN (yet another newbie)

Pecan:

--- Quote from: nmambre on March 24, 2006, 12:31:00 am ---So anyone can show me (step by step, in Windows) how to create and compile a simple project using wxSmith and/or wxWidgets template?

--- End quote ---

Here is a wxSmith tutorial. I've used and abused it successfully

http://wiki.codeblocks.org/index.php?title=WxSmith_Tutorial_%26_Pointers

squizzz:

--- Quote from: nmambre on March 24, 2006, 12:31:00 am ---So I downloaded RC2 and could not compile a simple wxwidget project

--- End quote ---

Do you have wxWidgets lib set up properly? You may want to follow this article: Compiling wxWidgets 2.6.1 to develop Code::Blocks (MSW) (just use 2.6.2 instead of 2.6.1)

Then use wxSmith template, and it should just work. :)


thomas:

--- Quote ---./wx_pch.h:9:23: wx/wxprec.h: No such file or directory
--- End quote ---
That line points to the problem. The compiler cannot find the wxWidgets headers.

First of all, do you actually have wxWidgets? I don't know about wxdevcpp, but Code::Blocks is not bundled with wxWidgets. The fact that it has a template to create wxWidgets projects does not mean that wxWidgets is installed automatically, too.

If you have wxWidgets on your PC (in case you did not delete the working wxdevcpp environment, for example), you have to set up compiler paths or variables correctly, so the compiler knows where to look for the headers and libraries.
If you use a recent nightly build and create a project from the template, all you will have to do is set the global variable WX correctly (you will be prompted for that automatically). It can always be changed from the settings menu later, if need be.
The "normal and correct" value for WX is the top level folder of your wxWidgets installation (supposed you downloaded the tarball and compiled yourself). However, if wxWidgets was bundled or installed from a DevPak, then it is not certain that the packagers used the same paths everywhere, you may have to experiment a little bit.

takeshimiya:
The problem is that the template from which wxSmith generated is buggy (ie. it doesn't knows anything about unicode, it's a bit outdated also), so that's very likely the problem.

Try first with the C::B wx template, and if that project works, change the project generated by wxSmith to have the same includes, libs, etc.

Actually I was starting to fix that two days ago right in the wxSmith code, but come up with a better solution (I hope). :)

Navigation

[0] Message Index

[#] Next page

Go to full version