Compiling Code under Windows

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Post by TrueBrain »

Do you have mainicon.ico in your root dir? And you should _not_ add it to your project, but ttd.rc should.. and yes, make a makefile, I will compare it with mine!
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

TrueLight wrote:Do you have mainicon.ico in your root dir? And you should _not_ add it to your project, but ttd.rc should.. and yes, make a makefile, I will compare it with mine!
the root directory means the directory where are all source files? if it is, yes, i put there mainico.ico

in the "other files" diectory, what i have to put?
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Post by SHADOW-XIII »

well ... it didn't find mainicon.ico file ... so I did add OTT project path to the project (resources tab) and it worked .. but how the hell run the EXE (I still got LANG error) :evil:
what are you looking at? it's a signature!
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

Darkvater wrote:
SHADOW-XIII wrote:yes yes ... I meant that there are /LANG and /DATA directories ... it is the same directory where I installed OTTD
So I ask you again. Have you put all .txt files in the LANG/ directory? Have you compiled each of them using strgen, such that next to all .txt files, there are also .lng files in the LANG/ directory?

If the openttd executeable is in root, where LANG/ is a subdirectory of, it should work. If openttd executeable is in the debug folder for example, you might need to set the working directory in mingw to the root directory.
to Shadow-XIII
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Post by SHADOW-XIII »

thx :oops: I did it
what are you looking at? it's a signature!
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

SHADOW-XIII wrote:thx :oops: I did it
Meaning? You had your files in the wrong place, or openttd magically started working? It's nice to hear how people solved their problems.
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
User avatar
dominik81
OpenTTD Developer
OpenTTD Developer
Posts: 768
Joined: 16 Aug 2003 12:55
Location: Bonn, Germany

Post by dominik81 »

SHADOW-XIII wrote:thx :oops: I did it
You should consider writing a How-To, to make it easier for other people to get the same problems solved that you encountered.
"There's a readme that comes with the source. I suggest you read it."
- Korenn
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Post by SHADOW-XIII »

I will do that in the aftertnoon (g2g no)

and I fixed that by running strgen in OTTD source directory and copying english.lng from SOURCE_OTTD_DIR/LANG directory to the the COMPILED_OTTD_DIR/LANG subdirectory
what are you looking at? it's a signature!
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

ok, thanks Shadow-XIII

now i got a new error, it seems to be a syntax error or something else, maybe the file is an old release...

Code: Select all

Compiling source file(s)...
StdAfx.c
ai.c
aircraft_cmd.c
..\ottd-svn_files\main\aircraft_cmd.c: In function `CmdBuildAircraft':
..\ottd-svn_files\main\aircraft_cmd.c:248: error: `STR_SV_AIRCRAFT_NAME' undeclared (first use in this function)
..\ottd-svn_files\main\aircraft_cmd.c:248: error: (Each undeclared identifier is reported only once
..\ottd-svn_files\main\aircraft_cmd.c:248: error: for each function it appears in.)

ottd-svn.exe - 3 error(s), 4 warning(s)
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

Code: Select all

aircraft_cmd.c
..\ottd-svn_files\main\aircraft_cmd.c: In function `CmdBuildAircraft':
..\ottd-svn_files\main\aircraft_cmd.c:248: error: `STR_SV_AIRCRAFT_NAME' undeclared (first use in this function)
I'll bet you my 2 cents that you haven't run strgen yet :). Strgen.exe creates strings.h where all these things are defined.
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

Darkvater wrote:

Code: Select all

aircraft_cmd.c
..\ottd-svn_files\main\aircraft_cmd.c: In function `CmdBuildAircraft':
..\ottd-svn_files\main\aircraft_cmd.c:248: error: `STR_SV_AIRCRAFT_NAME' undeclared (first use in this function)
I'll bet you my 2 cents that you haven't run strgen yet :). Strgen.exe creates strings.h where all these things are defined.
now i'll get the latest strgen from nightly build's site

edit: it is sufficient only execute it?

edit^2: yes, it was
now?

Code: Select all

In file included from ..\ottd-svn_files\main\engine.c:4:
..\ottd-svn_files\main\table\engines.h:1: error: redefinition of `struct EngineInfo'
..\ottd-svn_files\main\table\engines.h:7: error: redefinition of `EngineInfo'
..\ottd-svn_files\main\engine.h:35: error: `EngineInfo' previously declared here
..\ottd-svn_files\main\table\engines.h:12: error: conflicting types for `_engine_info'
..\ottd-svn_files\main\engine.h:132: error: previous declaration of `_engine_info'
..\ottd-svn_files\main\table\engines.h:271: error: conflicting types for `_rail_vehicle_info'
..\ottd-svn_files\main\engine.h:133: error: previous declaration of `_rail_vehicle_info'

ottd-svn.exe - 7 error(s), 0 warning(s)
edit^3: oh, maybe this is an older version?
it is possible that i'm all an error?
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

it works it works!!

err.... doh!
where i can get libz.dll, and when found it, where i have to put it?
if i compile the game with "WITH_ZLIB" the game doesn't start, instead w/o "WITH_ZLIB" the game works...

another question, how i can make my own title screen?
Last edited by Wolf01 on 02 Jul 2004 17:15, edited 1 time in total.
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

Wolf01 wrote:it works it works!!

err.... doh!
where i can get zlib.dll, and when found it, where i have to put it?
Finally :D. You usually have to put it in the main development directory. Don't worry, if it's in the wrong place, the compiler will complain, so you will find out soon enough.
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

Darkvater wrote:
Wolf01 wrote:it works it works!!

err.... doh!
where i can get zlib.dll, and when found it, where i have to put it?
Finally :D. You usually have to put it in the main development directory. Don't worry, if it's in the wrong place, the compiler will complain, so you will find out soon enough.
ok, but where i can get the file?
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

Wolf01 wrote:ok, but where i can get the file?
*Magic* http://www.tt-forums.net/viewtopic.php?t=6616 :lol:
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

"i thought that was the end... but it was only the beginning"

after put these files in the main directory i got an error:

Code: Select all

E:\ottd-svn\Debug\saveload.o(.text+0x1823): In function `InitReadZlib':
E:\ottd-svn\..\ottd-svn_files\main\saveload.c:822: undefined reference to `inflateInit_@12'
E:\ottd-svn\Debug\saveload.o(.text+0x18dc): In function `ReadZlib':
E:\ottd-svn\..\ottd-svn_files\main\saveload.c:843: undefined reference to `inflate@8'
E:\ottd-svn\Debug\saveload.o(.text+0x1924): In function `UninitReadZlib':
E:\ottd-svn\..\ottd-svn_files\main\saveload.c:856: undefined reference to `inflateEnd@4'
E:\ottd-svn\Debug\saveload.o(.text+0x197c): In function `InitWriteZlib':
E:\ottd-svn\..\ottd-svn_files\main\saveload.c:863: undefined reference to `deflateInit_@16'
E:\ottd-svn\Debug\saveload.o(.text+0x1a1f): In function `WriteZlibLoop':
E:\ottd-svn\..\ottd-svn_files\main\saveload.c:880: undefined reference to `deflate@8'
E:\ottd-svn\Debug\saveload.o(.text+0x1b24): In function `UninitWriteZlib':
E:\ottd-svn\..\ottd-svn_files\main\saveload.c:900: undefined reference to `deflateEnd@4'

ottd-svn.exe - 6 error(s), 4 warning(s)
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

Wolf01 wrote:"i thought that was the end... but it was only the beginning"
Which file was it? Have you read the whole post? Have you put the files from useful.zip or from the attachment?
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Post by SHADOW-XIII »

I search my PC for zlib.dll ... copied it into OTTD dir and renamed to libz.dll .. this way it worked
what are you looking at? it's a signature!
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

Darkvater wrote:
Wolf01 wrote:"i thought that was the end... but it was only the beginning"
Which file was it? Have you read the whole post? Have you put the files from useful.zip or from the attachment?
yes, i done all
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

Wolf01 wrote:
Darkvater wrote:
Wolf01 wrote:"i thought that was the end... but it was only the beginning"
Which file was it? Have you read the whole post? Have you put the files from useful.zip or from the attachment?
yes, i done all
Which one? One of them has to work. You can try removing 'WITH_ZLIB' if you don't want zlib support.
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 17 guests