Need help compiling in Code::Blocks

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Zanman777
Engineer
Engineer
Posts: 32
Joined: 02 Feb 2012 00:09

Need help compiling in Code::Blocks

Post by Zanman777 »

I'm trying to compile the OpenTTD latest stable version (1.3.2) in Code::Blocks, but I can't.

I'm using Code::Blocks version 12.11, on Windows 7 Home Premium edition. I import the OpenTTD_vs80.sln solution using Code::Blocks File -> Import project -> MS Visual Studio Solution. It asks me if I want to keep the default project compiler settings, and I say yes. Then it asks if I want to keep the default project release and debug settings, and I say yes again. It starts importing each project... Then it fails at "generate" project, giving an error dialog: "Invalid file format".

It seems to still import all other projects, though. Out of curiosity, I tried to compile it anyway. It gave a

Code: Select all

fatal error: Table/strings.h: No such file or directory
preceded by a lot of

Code: Select all

warning: multi-character constant [-Wmultichar]
How do I overcome this?
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: Need help compiling in Code::Blocks

Post by Eddi »

that means it hasn't run strgen (which probably is part of "generate")

strings.h is created from src/lang/english.txt

even if you get that sorted manually, the next would be settings.h
Zanman777
Engineer
Engineer
Posts: 32
Joined: 02 Feb 2012 00:09

Re: Need help compiling in Code::Blocks

Post by Zanman777 »

What does that mean in plain English? :P Why hasn't it run strgen? Why does it give an error on generate file format?
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Need help compiling in Code::Blocks

Post by Alberth »

Some files are created during the build. If you skip the project that performs that task, you will be missing files like table/strings.h

As how to fix it, I don't know; I use neither code::blocks nor windows.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Need help compiling in Code::Blocks

Post by planetmaker »

Zanman777 wrote:What does that mean in plain English? :P Why hasn't it run strgen? Why does it give an error on generate file format?
Bad import filter?

After all the VS* project files are for visual studio and not code:blocks. And using those, a number of visual basic scripts need be run to generate parts of the code before the actual compiler can be launched. This is covered in the project files which visual studio understands and executes as intended. But I also use neither windows nor code:blocks.
Zanman777
Engineer
Engineer
Posts: 32
Joined: 02 Feb 2012 00:09

Re: Need help compiling in Code::Blocks

Post by Zanman777 »

What do you use, then?
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Need help compiling in Code::Blocks

Post by planetmaker »

Kate on linux. TextWrangler on OSX. And happily the xterm to compile on both: ./configure && make
Zanman777
Engineer
Engineer
Posts: 32
Joined: 02 Feb 2012 00:09

Re: Need help compiling in Code::Blocks

Post by Zanman777 »

Can anybody help me, please? I'm sure several people use Code::Blocks around here, as I've seen it mentioned in forum topics... I'd like to stick to Code::Blocks since it works in every platform, whereas Microsoft Visual Studio is Windows-specific... I'm a very unexperienced programmer, so maybe the solution is even simple... Do I need to install a Microsoft SDK of some sort, or anything?
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Need help compiling in Code::Blocks

Post by Zuu »

For OpenTTD, I would recommend using one of the two well documented methods to compile on Windows: Visual Studio or MinGW. On Linux, you'll use ./configure && make in the terminal to compile and a text editor of your choice to edit the code.

If you want to use a similar way in both Linux and Windows, go for MinGW in Windows. If you want an IDE with a good debugger, go for Visual Studio. Both options are free of charge.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
TinyMusic
Tycoon
Tycoon
Posts: 1422
Joined: 02 Feb 2013 02:03

Re: Need help compiling in Code::Blocks

Post by TinyMusic »

Formerly known as UseYourIllusion.
Java Scenario Found Here - Version 2 out
[tweɪ̂ pû tɕʰì wɔ̀ mǐlɤ lû tɕʰìŋ nì pɑ́ŋmɑ̌ŋ]
Zanman777
Engineer
Engineer
Posts: 32
Joined: 02 Feb 2012 00:09

Re: Need help compiling in Code::Blocks

Post by Zanman777 »

Ok, I think I'll go for Visual Studio, since I want an IDE. Which version should I use? Express editions are the free ones, right? Do I need .NET?
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: Need help compiling in Code::Blocks

Post by Eddi »

you should find everything that is needed on the wiki
Zanman777
Engineer
Engineer
Posts: 32
Joined: 02 Feb 2012 00:09

Re: Need help compiling in Code::Blocks

Post by Zanman777 »

Ok, thanks. In the meantime, if anyone using Code::Blocks could chime in, that would be great. I'm puzzled by the necessity of installing a 5 Gb IDE just to open & edit a 10 Mb OpenTTD. Code:Blocks is like 20 times smaller than Visual Studio. I'm sure VS has a ton of stuff I won't be using... Like the C# and Basic compliance. Sigh...
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Need help compiling in Code::Blocks

Post by planetmaker »

You're not required to use MSVC. You can also go for MinGW.

And if you want Code::Blocks support: go, and create it. It won't magically appear.
Zanman777
Engineer
Engineer
Posts: 32
Joined: 02 Feb 2012 00:09

Re: Need help compiling in Code::Blocks

Post by Zanman777 »

Create Code::Blocks support? What on earth do you mean?
lukasz1985
Route Supervisor
Route Supervisor
Posts: 429
Joined: 27 Mar 2013 08:58
Location: Strumien
Contact:

Re: Need help compiling in Code::Blocks

Post by lukasz1985 »

Haha, I like how complete noobs get into compiling C++. No ofense of course :) You should know that there is a lot to learn and it's almost impossible for newcomer to get things done right.
TinyMusic
Tycoon
Tycoon
Posts: 1422
Joined: 02 Feb 2013 02:03

Re: Need help compiling in Code::Blocks

Post by TinyMusic »

Zanman777 wrote:Create Code::Blocks support? What on earth do you mean?
He meant that if you want Code::Blocks to support compiling OpenTTD, you have to do it yourself.
Formerly known as UseYourIllusion.
Java Scenario Found Here - Version 2 out
[tweɪ̂ pû tɕʰì wɔ̀ mǐlɤ lû tɕʰìŋ nì pɑ́ŋmɑ̌ŋ]
Zanman777
Engineer
Engineer
Posts: 32
Joined: 02 Feb 2012 00:09

Re: Need help compiling in Code::Blocks

Post by Zanman777 »

UseYourIllusion wrote:
Zanman777 wrote:Create Code::Blocks support? What on earth do you mean?
He meant that if you want Code::Blocks to support compiling OpenTTD, you have to do it yourself.
Duh. .. Would it be a surprise If i Told you that Didnt help one Bit at all? I Dont need Help from The forum to be Told to do it myself...
If it doesnt compile in codeblocks, its either Me Whos doing Sth Wrong (in Which Case you Guys Could help me) or you Did a Bad jpb making truly portable code, saying do it yourdelf is a tremendous demonstratipn of Unwillingness to help.
I Dont know How to "Create compatibility with codeblocks", thats Why im asking for Help. .
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Re: Need help compiling in Code::Blocks

Post by WWTBAM »

Have a look at Section 7.2 of the readme. It may not tell you anything about how to compile it.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: Need help compiling in Code::Blocks

Post by Lord Aro »

code is very portable, especially compared to some programs. some IDEs have trouble understanding it's layout though (and i can assume you, the code layout will not be changed for 1 IDE)

iirc, when i tried to get codeblocks working (and failed) the project files had trouble with '..' in the file paths, or understanding the makefile system (hence lack of finding that file)

oh and btw, no one here is obligated to help you, especially if no one actually has any experience with the issue (i don't think anyone ever actually got codeblocks working in a 'portal' manner)
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 33 guests