Error Compiling grfcodec-master

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
User avatar
wallyweb
Tycoon
Tycoon
Posts: 5565
Joined: 27 Nov 2004 15:05
Location: Canada

Error Compiling grfcodec-master

Post by wallyweb » 17 Sep 2019 03:20

Assuming roadtypes are supported in grfcodec-master

Windows 10
msys64
mingw64

Code: Select all

User@wall10box MINGW64 ~
$ git clone https://github.com/OpenTTD/grfcodec.git
Cloning into 'grfcodec'...
remote: Enumerating objects: 4854, done.
remote: Counting objects: 100% (4854/4854), done.
remote: Compressing objects: 100% (1197/1197), done.
remote: Total 4854 (delta 3596), reused 4854 (delta 3596), pack-reused 0
Receiving objects: 100% (4854/4854), 872.06 KiB | 5.25 MiB/s, done.
Resolving deltas: 100% (3596/3596), done.

User@wall10box MINGW64 ~
$ cd ~/grfcodec

User@wall10box MINGW64 ~/grfcodec
$ make
[LD] objs/endian_check
[ENDIAN] Determining endianness
[CPP DEP] objs/pseudo_seq.o.d
[CPP DEP] objs/mapescapes.o.d
[CPP DEP] objs/language_mgr.o.d
[CPP DEP] objs/message_mgr.o.d
[CPP DEP] objs/help.o.d
[CPP DEP] objs/utf8.o.d
[CPP DEP] objs/strings.o.d
[CPP DEP] objs/sanity.o.d
[CPP DEP] objs/nforenum.o.d
[CPP DEP] objs/rangedint.o.d
[CPP DEP] objs/pseudo.o.d
[CPP DEP] objs/messages.o.d
[CPP DEP] objs/inject.o.d
[CPP DEP] objs/globals.o.d
[CPP DEP] objs/data.o.d
[CPP DEP] objs/command.o.d
[CPP DEP] objs/act14.o.d
[CPP DEP] objs/actF.o.d
[CPP DEP] objs/actB.o.d
[CPP DEP] objs/act79D.o.d
[CPP DEP] objs/act6.o.d
[CPP DEP] objs/act5.o.d
[CPP DEP] objs/act123_classes.o.d
[CPP DEP] objs/act123.o.d
[CPP DEP] objs/act0.o.d
[CPP DEP] objs/IDs.o.d
[CPP DEP] objs/grfstrip.o.d
[CPP DEP] objs/md5.o.d
[CPP DEP] objs/grfid.o.d
[CPP DEP] objs/grfcodec.o.d
[CPP DEP] objs/file.o.d
[CPP DEP] objs/readinfo.o.d
[CPP DEP] objs/path.o.d
[CPP DEP] objs/error.o.d
[CPP DEP] objs/info.o.d
[CPP DEP] objs/pngsprit.o.d
[CPP DEP] objs/pcxsprit.o.d
[CPP DEP] objs/sprites.o.d
[CPP DEP] objs/pcxfile.o.d
[CPP DEP] objs/grfcomm.o.d
[CPP] objs/grfcomm.o
src/grfcomm.cpp: In function 'char* spritefilename(const char*, const char*, const char*, int, const char*, int)':
src/grfcomm.cpp:125:31: error: too many arguments to function 'int mkdir(const char*)'
      if (mkdir(directory, 0755)) { // so try creating it
                               ^
In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/sys/stat.h:14,
                 from src/grfcomm.cpp:12:
C:/msys64/mingw64/x86_64-w64-mingw32/include/io.h:280:15: note: declared here
   int __cdecl mkdir (const char *) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
               ^~~~~
make: *** [Makefile:243: objs/grfcomm.o] Error 1

User avatar
jfs
Director
Director
Posts: 593
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Error Compiling grfcodec-master

Post by jfs » 17 Sep 2019 14:12

It's odd that the #define on grfcomm.cpp line 13 doesn't trigger, it should be redefining mkdir() to only take one argument to work around this. Perhaps it needs to check for MINGW64 symbol as well as MINGW symbol.

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5565
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Error Compiling grfcodec-master

Post by wallyweb » 13 Oct 2019 11:32

I'm back to this topic.
Questions:
1. Does grfcodec-master know about feature 12 (roadtype) and feature 13 (tramtype)?
If yes, we continue ...
2. Has anybody compiled grfcodec-master?
3. if yes, are you willing to share it?
If no, we continue ...
4. grfcodec-master source contains a file: 0compile.txt
It would seem that this is the instruction for compiling grfcodec-master.
The file says:
GRFCodec and NFORenum require Boost 1.36 or higher. The make system does
not check the Boost version, so compiling with a lower version of Boost
will result in compile failures.
but not even a hint as to where to get Boost.
Duck Duck Go found it for me.
There is a download link that points to a whole lot of source code as well as installers for various platforms. including Windows.
Once I get Boost installed, there is one more question ...
5. What is the simplest compiler for grfcodec-master so that it will run on WindowsXP, 7, 8 and 10? MinGW? MSYS2? or Visual Studio2019?

Any assistance will be rewarded with acknowledgement, lots of :bow: s and much appreciation.

User avatar
jfs
Director
Director
Posts: 593
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Error Compiling grfcodec-master

Post by jfs » 13 Oct 2019 14:59

Grfcodec does not know or care about NewGRF actions. It supports all current and future NewGRF spec extensions, at least as long as it's GRF version 8 or earlier.
NFOrenum is different, it probably won't support the spec additions.

https://www.openttd.org/downloads/grfco ... atest.html

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5565
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Error Compiling grfcodec-master

Post by wallyweb » 13 Oct 2019 17:34

jfs wrote:
13 Oct 2019 14:59
Grfcodec does not know or care about NewGRF actions. It supports all current and future NewGRF spec extensions, at least as long as it's GRF version 8 or earlier.
NFOrenum is different, it probably won't support the spec additions.

https://www.openttd.org/downloads/grfco ... atest.html
Thanks jfs. :bow:
Indeed, I would be looking for an update to nforenum.
Are the two (grfcodec+nforenum) not shipped together?
Is there a way to get a newer version of nforenum?

User avatar
jfs
Director
Director
Posts: 593
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Error Compiling grfcodec-master

Post by jfs » 13 Oct 2019 17:43

NFOrenum is part of the grfcodec source repository, and has not been updated since 2014.

This is the latest change in the history, that affects the functionality of NFOrenum.

User avatar
wallyweb
Tycoon
Tycoon
Posts: 5565
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Error Compiling grfcodec-master

Post by wallyweb » 13 Oct 2019 18:33

I noticed that a new issue was logged 10 days ago. Perhaps roadtypes/tramtypes will be considered when that new issue is addressed.
Thanks again jfs. :bow:

User avatar
OzTrans
Tycoon
Tycoon
Posts: 1510
Joined: 04 Mar 2005 01:07

Re: Error Compiling grfcodec-master

Post by OzTrans » 13 Oct 2019 22:49

wallyweb wrote:
13 Oct 2019 11:32
1. Does grfcodec-master know about feature 12 (roadtype) and feature 13 (tramtype)?
GRFCodec does not care about new features, it is ok as it is.
NFORenum ...
However, NFORenum is in desperate need for an update ...

The following are some of the errors, that are NOT errors :

Code: Select all

Feature 07 [houses], there is persistent storage
//!!Error (203): Offset 10: No persistent registers exist for this feature.
  499 * 30	 02 07 00 8A 1A 20 01 00 00 00 10 1A 00 09 00 00 00 ...

Feature 07 [houses], as above
//!!Warning (86): Offset 4: Testing nonexistant variable 7C.
  500 * 15	 02 07 50 82 7C 09 00 FF 01 50 00 01 01 00 00

Feature 07 [houses], certainly works
//!!Warning (103): Offset 6: Shifting variable 47 past its length.
  528 * 23	 02 07 09 89 47 10 FF FF 00 00 ...

Feature 10 [railtypes], Action 03, Cargo Type 0B
//!!Error (57): Offset 29: Invalid cargo type: 0B
 4927 * 34	 03 10 01 08 09 00 A3 00 01 A8 00 02 AB 00 03 AE 00 06 E1 00 08 B7 00 09 BA 00 0A BB 00 0B BD 00 FF 00

Feature 12 [roadtypes]
(all of it)

Feature 13 [tramtypes]
(all of it)

The following are not errors as far as OpenTTD is concerned, but are features in JGR-PP,
but may just as well be considered for inclusion :

Feature 06 [bridges], Action 00, Property 14
//!!Fatal Error (47): Offset 5: Invalid property 14.
 7237 * 58	 00 06 01 0D 00 14 23 0A 00 00 26 0A 00 00 ...

Feature 06 [bridges], Action 00, ID 0D .. 0F
//!!Error (141): ID 0D out of valid range (00..0C).
 9470 * 904	 00 06 01 01 0D 0D 00 07 F2 00 00 00 00 00 00 00 ... 
My five cents ...

Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 3 guests