Setup Confusion with Code::Blocks

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
einsteinsci
Posts: 10
Joined: Tue Nov 19, 2013 3:35 am

Setup Confusion with Code::Blocks

Post by einsteinsci »

I know this is a super nooby question, but all the information I can find is massively outdated (Code::Blocks v1.0 on Win98-ish), in German, or both. I've never used Code::Blocks before except for basic console applications, but now I want to set up Irrlicht on my Win7 machine. I have set up DX9 on VS2010 before, but I have no experience with setting anything up for C::B using GCC. I downloaded the zip and unzipped it, and I'm not sure how to go about starting a project. I used the Irrlicht template for C::B v12.11, and set the Irrlicht directory to the irrlicht-1.8 folder from the zip (with the include/lib stuff inside). It doesn't need any extra info, so it makes the project from the template (Irrlicht.h is included) with a main.cpp inside. I try to build&run it, but I get errors involving using signed ints in an unsinged parameter in createDevice() and dimension2d<>(). Here are the errors as they are shown:

Code: Select all

 
...main.cpp                                                In function 'int main(int, char**)':
 
...main.cpp                                    Line 71     error: invalid initialization of reference of type 'const irr::core::dimension2d<unsigned int>&'
        from expression of type 'irr::core::dimension2d<int>'
 
...irrlicht-1.8\include\irrlicht.h             Line 324    error: in passing argument 2 of 'irr::IrrlichtDevice* irr::createDevice(irr::video::E_DRIVER_TYPE,
        const irr::core::dimension2d<unsigned int>&, irr::u32, bool, bool, bool, irr::IEventReceiver*)'
 
=== Build finished: 2 errors, 0 warnings (0 minutes, 0 seconds) ===
 
XenoZergNid
Posts: 17
Joined: Sun Oct 13, 2013 1:52 am

Re: Setup Confusion with Code::Blocks

Post by XenoZergNid »

the irrlichts template code in code blocks is severely outdated, that is the code. copy the code from here instead:
http://irrlicht.sourceforge.net/docu/example001.html
einsteinsci
Posts: 10
Joined: Tue Nov 19, 2013 3:35 am

Re: Setup Confusion with Code::Blocks

Post by einsteinsci »

Do you know how to set up the project directories/includes/lib? The tutorial there is for VS. Is the code there any different for C::B? (Minor tweaks or pragma's or things like that)
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Setup Confusion with Code::Blocks

Post by CuteAlien »

Irrlicht comes with example files for code::blocks, look in the examples folder. You can copy settings from there.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Ganado
Posts: 2
Joined: Thu Nov 28, 2013 1:24 am

Re: Setup Confusion with Code::Blocks

Post by Ganado »

CuteAlien wrote:Irrlicht comes with example files for code::blocks, look in the examples folder. You can copy settings from there.
Sorry if this doesn't belong here, but I couldn't find any answer that worked.

I looked at the example for Irrlicht in the folder, and it seems to compile fine on my CodeBlocks (12.11), but when I run it under Windows (in Code::Blocks IDE), I get this error:
Image
I've run into this problem in the past, when I was using a library called SFML, but I fixed it by messing with which compiler it links to. But now, when I open the example code blocks project file, I'm getting that error again.

This time, I have the C++ compiler linking to mingw32-g++.exe
Image

I don't understand why I'm still getting that error. Am I using the wrong compiler?

...on a related note if I still can't get this to work, is Visual Studio free to use (commercially)? I couldn't find any good links.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Setup Confusion with Code::Blocks

Post by CuteAlien »

Open the project file for Irrlicht itself in c::b (it's in source/Irrlicht) and re-compile the dll (default is win32-release-accurate). Check afterward in bin/Win32-gcc if you really got a newer dll you can delete the old one first to be certain. It should work then.

About VS - search for Visual Studio Express for Desktop. We have no project files for VS 2013 yet, but it should be able to update existing project files (or so I hope, haven't tried it yet). VS Express is fine to use for commercial work unless they changed their license (unlikely).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
AReichl
Posts: 270
Joined: Wed Jul 13, 2011 2:34 pm

Re: Setup Confusion with Code::Blocks

Post by AReichl »

mingw meanwhile is a mess under windows. You have several "distributions" which behave differently and then you can choose between different threading and exception models ( SEH (only 64bit), sjlj (32+64bit), dwarf[2] (only 32bit) ). If you link, the libraries have to match. I always liked gcc/mingw, but now i have switched back to Visual Studio (2010,2013). 2013 has good enaugh C++11 support and the debugger always was better than gdb.

The last problem i had with mingw was with IrrBullet; with Visual Studio it just worked. So i gave up on mingw.

I had this discussion some time ago about what compilers to support, and the most reasonable result was to support Visual Studio for Windows and GCC for UNIX/Linux (MAC i don't know). The other developers just refused to support another "platform" for Windows when there is already Visual Studio.

About the Express versions - from the licensing whitepaper:
"Visual Studio Express can be used to build production applications"

Take 2013, don't bother with 2012.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Setup Confusion with Code::Blocks

Post by CuteAlien »

VS also has it's problems. Like installing several GB on your system-disk (for supporting a more comfortable uninstallation... I'm not joking) even if you tell it to install on another HD. Something I just found out a few minutes ago - grrr. I'm never ever allowing to install Windows on a SSD again - Microsoft grabs constantly more and more of it with crap that doesn't even need to be fast - that is so annoying! Not to mention I'm running out of space by now...
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Setup Confusion with Code::Blocks

Post by hendu »

You get exact same incompatibilities on VS. A lib compiled with last year's VS may not work with a binary compiled with this year's VS.

Then you have redistributables and system compatibility. (pick either XP or 8, not both!)
Ganado
Posts: 2
Joined: Thu Nov 28, 2013 1:24 am

Re: Setup Confusion with Code::Blocks

Post by Ganado »

AReichl wrote:Take 2013, don't bother with 2012.
I installed the 2013 VS Express and tried to compile the project file for it, and I got errors. I already uninstalled it, but was reading the list of changes:
( http://msdn.microsoft.com/en-us/library/hh409293.aspx ) and are the changes for 2013 really that important? Anyway, I'm going to try the helloworld program on VS2012 once it installs, since that's what seems to work for others.

And I'll edit this post if it works or not, thanks for the replies either way.

EDIT: Visual Studio Express 2013 is free to use indefinitely, but VS Express 2012 is saying I have a 30-day trial? The strange thing is that I could only find a link to VS Express 2012 on google, I couldn't find a link to it directly through http://www.visualstudio.com .

So, are VS Express 2013 and VS Express 2010 the only *free* ones?

EDIT 2: I reinstalled VS Express 2013, and here is the error message I get. I cannot find what it suggests for me to do.

Code: Select all

Error   1   error MSB8020: The build tools for Visual Studio 2012 (Platform Toolset = 'v110') cannot be found. To build using the v110 build tools, please install Visual Studio 2012 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...".  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets   64  5   01.HelloWorld
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Setup Confusion with Code::Blocks

Post by CuteAlien »

Try the upgrade solution, that should work I guess. We don't have project files for VS 2013 so far.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply