Previously working NML code won't compile now

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Previously working NML code won't compile now

Post by NekoMaster »

So the last time I made an update to the NARS ADDON SET of mine was back around late november, which was version r0045.

So I decided to try setting up NML and the compiling environment on Windows 10 using the Subsystem for Linux method which I have working, but make is giving me issues.

Code: Select all

nekomaster@PC1-MATT:/mnt/d/USERS/MATTHEW/Dropbox/~ OpenTTD Projects ~/NARS_ADDON_SET$ make -b -r -R
[CPP] NARS_ADDON_SET.nml
NARS_ADDON_SET.pnml:29:36: fatal error: src/DIESEL/EMD_FP45.PNML: No such file or directory
 #include "src/DIESEL/EMD_FP45.PNML"
                                    ^
compilation terminated.
make: *** [NARS_ADDON_SET.nml] Error 1
I haven't changed anything with the code since November and the stuff is all in the same place as before so I dunno why its complaining that the EMD_FP45.PNML isn't there anymore.

I can provide a link to my project if anyone wants to take a look at whats wrong. I checked everything myself and the location, spelling and CASE of everything should be fine.
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Previously working NML code won't compile now

Post by Alberth »

Not much to go on, I am afraid.

A good way to check whether a file exists is to use "ls". It lists files and directory contents much like DIR, and as it is a common program, you're likely to have it.

Code: Select all

ls src/DIESEL/EMD_FP45.PNML
should simply reply with listing the path that you specify. That tends to be a fast and very accurate check on file existence.

I am a little worried about your fancy "~ OpenTTD Projects ~" directory, with spaces and weird "~" characters that mean $HOME. However, I would expect a different path reported by cpp then, so maybe it's ok.
You could try making a copy of the project in say c:\tmp or some other blunt and simple path to see if that fixes the problem.

I had the spaces problem with 'make' in another project too, and decided to have a closer look. Basically, "make" splits at space, and it's not avoidable and its devs consider it non-fixable (it would break existing projects when they would fix this bug).
Being a retired OpenTTD developer does not mean I know what I am doing.
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Previously working NML code won't compile now

Post by NekoMaster »

the spacing shouldn't be a problem as I've been doing things from my Dropbox folder in case my computer dies or I want to work from another device.

ALSO, I just put together a wagon/coach only version of 2cc Trains in NML which I'm dubbing "2cc Wagons in NML" or 2ccWIN, but I'll only be releasing that if its ok with the guys over at 2cc Trains in NML.

All I can say is that 2cc Wagons in NML compiled just fine from the Same "D:\USERS\MATTHEW\DROPBOX\~ OPENTTD PROJECTS~" folder that I keep both NARS_ADDON_SET and 2CCWIN



Heres what I get if I try compiling from the root of my D:\ drive.

Code: Select all

D:\NARS_ADDON_SET>bash -c "make -b -R -r"
[CPP] NARS_ADDON_SET.nml
NARS_ADDON_SET.pnml:29:36: fatal error: src/DIESEL/EMD_FP45.PNML: No such file or directory
 #include "src/DIESEL/EMD_FP45.PNML"
                                    ^
compilation terminated.
make: *** [NARS_ADDON_SET.nml] Error 1

EDIT : I'm using make through the bash shell on Windows 10, using the Subsystem for Linux method of compiling NML Grfs... and it might have been that being Linux based, make didn't like that I was trying to include EMD_FP45.pnml when the file was actually EMD_FP45.PNML.

This is a case of trying to include a file where the real file name in windows has different case extensions then what I put down for inclusion in NARS_ADDON_SET.pnml

I think I pretty much just solved my problem, just have to watch the capitalization of things when using linux bash/make.
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: Previously working NML code won't compile now

Post by Transportman »

Linux is a bit more strict about lower and upper case than Windows, and the Subsystem for Linux is using real Linux.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Previously working NML code won't compile now

Post by NekoMaster »

Transportman wrote:Linux is a bit more strict about lower and upper case than Windows, and the Subsystem for Linux is using real Linux.
Yeah, I know that much about linux as I dabble with it every now and then, I just didn't think that make was going to freak out about case sensitivity as well. Also I just assumed that with my usual way of doing things lately for mods that everything was in upper case, so for example "WESTINGHOUSE_BLUE_GOOSE_GTEL.PNML" instead of "WESTINGHOUSE_BLUE_GOOSE_GTEL.pnml"

Anyways I got it all fixed but it turns out I actually did modify some of the code since the last time I compiled NARS Addon, as I was trying to experiment with code from 2cc Trains to make long locomotives work properly. Needless to say it didn't work. I might just try recoding my addon again to use the 2cc trains frame work if possible.
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: Previously working NML code won't compile now

Post by Transportman »

NekoMaster wrote:
Transportman wrote:Linux is a bit more strict about lower and upper case than Windows, and the Subsystem for Linux is using real Linux.
Yeah, I know that much about linux as I dabble with it every now and then, I just didn't think that make was going to freak out about case sensitivity as well. Also I just assumed that with my usual way of doing things lately for mods that everything was in upper case, so for example "WESTINGHOUSE_BLUE_GOOSE_GTEL.PNML" instead of "WESTINGHOUSE_BLUE_GOOSE_GTEL.pnml"

Anyways I got it all fixed but it turns out I actually did modify some of the code since the last time I compiled NARS Addon, as I was trying to experiment with code from 2cc Trains to make long locomotives work properly. Needless to say it didn't work. I might just try recoding my addon again to use the 2cc trains frame work if possible.
Long locomotives are indeed a bit of a hassle, I use 8-X for long vehicles, as that was easier in depots, but I saw in the changelog of OpenTTD that for articulated vehicles it selects the entire vehicle.

Also, if you plan on recoding your addon using the 2cc TrainsInNML as a framework, you might want to wait a few more weeks with that, as I am working on a major overhaul, which I hope to iron out the last problems this weekend before it can be tested.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Previously working NML code won't compile now

Post by NekoMaster »

Transportman wrote:
NekoMaster wrote:
Transportman wrote:Linux is a bit more strict about lower and upper case than Windows, and the Subsystem for Linux is using real Linux.
Yeah, I know that much about linux as I dabble with it every now and then, I just didn't think that make was going to freak out about case sensitivity as well. Also I just assumed that with my usual way of doing things lately for mods that everything was in upper case, so for example "WESTINGHOUSE_BLUE_GOOSE_GTEL.PNML" instead of "WESTINGHOUSE_BLUE_GOOSE_GTEL.pnml"

Anyways I got it all fixed but it turns out I actually did modify some of the code since the last time I compiled NARS Addon, as I was trying to experiment with code from 2cc Trains to make long locomotives work properly. Needless to say it didn't work. I might just try recoding my addon again to use the 2cc trains frame work if possible.
Long locomotives are indeed a bit of a hassle, I use 8-X for long vehicles, as that was easier in depots, but I saw in the changelog of OpenTTD that for articulated vehicles it selects the entire vehicle.

Also, if you plan on recoding your addon using the 2cc TrainsInNML as a framework, you might want to wait a few more weeks with that, as I am working on a major overhaul, which I hope to iron out the last problems this weekend before it can be tested.
Basically I just want something I can use thats easy for a newbie to understand and just plug in their own graphics and data without needing to understand the full nine-yards of NML coding. I'm pretty bad at understanding how to program things, which is why I've given up on becoming a game developer and decided to go for something else I can enjoy, welding and metal working.

I also need something that can handle long locomotives, like 9/8, 10/8, and 11/8 (Turbine Locomotives and some american electrics are very long locomotives compared to normal diesels).
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot], Google Feedfetcher and 63 guests