News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

Cannot open include file "revision.h"

Started by Ves, January 14, 2017, 12:38:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ves

When trying to compile the latest commit, the compilation fails because alot of files are looking for the "revision.h" file. I thought it could be that only the file was missing, so I looked through the entire development folder and only found "revision.jse", no "revision.h".

The problem was first initiated with the commit f0dd6392b967f4d9620737ec5c2936c358513729.

jamespetts

The latest version of simutrans-experimental.vcxproj should include a system for creating revision.h automatically with each build; have you not loaded the latest version?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

Im compiling with cfd9f9ff8003e6a1fcf974f47c26e098b68ad89f on the devel-new-2 branch. I use "Simutrans-Experimental.vcxproj" on msvs2015.
with this, it still complains about the missing revision.h -file.

jamespetts

That is exceedingly odd. I am having some trouble understanding this. Commit d040c3d5a3cfcd385152b03c85c6646d43557d28 specifically added a mechanism for building revision.h before compiling the code to the .vcxproj file, by using the revision.jse file, which you indicated that you have. Have you tried re-loading the .vcxproj file?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

My usual procedure when updating the game is to first open the .vcxproj file, then the GitHub program and synking with latest build.
That means that msvs2015 is running while the repository gets synked. I then press reload all to reload the pages.
So no, I have actually not tried reload the .vcxproj file!  Could that be the problem?
Will have a go with that but I'm not home this weekend so it will have to wait though.

jamespetts

I am not sure whether this would cause the problem, but it is worth trying, I think. Do have a splendid week-end away!
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.


Ves

I tested again last night with the latest build, but the behavior is still present. What can I do to narrow it down you think?

jamespetts

One thing that you might do is add a blank revision.h to the project, with a single line, "#define REVISION 0". Make sure that that and revision.jse are included in your project. You should also make sure that "REVISION_FROM_FILE" is defined. You could also make sure that the changes to the Visual Studio project in commit no. d040c3d5a3cfcd385152b03c85c6646d43557d28 are in fact incorporated into your .vcxproj file (and that they were not, for example, overwritten when you compiled Simutrans-Experimental with your already open project after merging the changes).
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

ok... I have really no clue as to what just happened, however it is working now!

What I did:
Created an empty text file called revision.h
Open the project and drag the new revision.h -file into the project.
A warning came that such a file already existed in the first place, disallowing me to import this file again.
Hitted compile now to see what happen, and tada.. the game compiles! :P

jamespetts

Excellent! Does it have the correct version number?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

Is that the 'r'-number in the window bar in the upper end of the screen? It reads this:

Simutrans 120.1.2 Experimental Nightly development build 12.9000 - r12.9000

jamespetts

No, sadly this is not the correct number. It should be something like 086da1f. Can you include revision.jse into the project, too?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

This is very odd!

The revision.h is included in the project, including the phrase "#define REVISION 0".
The revision.jse is also included in the project.
The Simutrans-Experimental.vcxproj appears to have "REVISION_FROM_FILE" (opened the file in wordpad and made a positive search for the word).
The Simutrans-Experimental.vcxproj appears also to be identical to the one you have, I even downloaded the one from Github manually.

But still, the window bar says:

Simutrans 120.1.2 Experimental Nightly development build 12.9000 - r12.9000

Im compiling on windows 10 with msvs2015, are other people compiling on a similar setup getting the correct r-number?

jamespetts

Can you confirm that "REVISION_FROM_FILE" is defined in the build setup that you are using? This is not the same as it being somewhere in the .vcxproj file.

To check this, right click on "Simutrans-Experimental" under the heading "Solution 'Simutrans-Experimental' (1 project)" text on the left-hand "solution explorer" pane, navigate to C/C++ > preprocessor under "Configuration properties" and make sure that "REVISION_FROM_FILE" is somewhere in the list of various things under "Preprocessor definitions".
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

I confirm that it is present there.

In fact it was present twice, I thought that I should remove one of the entries but doing so removes both. It compiled fine also without that defined but I added it back again, but now it only added one entry.
Compiling again, I now get "r0" instead of "r12.9000".

Thought I recognized that zero from the revision.h file, so I tried writing "undefined" (which I took from the revision.jse file) but that created "rundefined".

So, it appears that the "REVISION_FROM_FILE" can only be once in the .vcxproj file, however, it appears to not know where to find the correct value to insert there

jamespetts

It seems as though it is not executing the pre-build .jse script so as to re-write the contents of revision.h. Can you check whether your .vcxproj file added in this commit using a text editor (such as WordPad)?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

Those commits are identical to the ones in my .vcxproj file. I can see it is also refers to something called "cscript.exe" which looks like it should execute the command. Could it be that the problem is with that (cscript.exe) instead? Where am I supposed to look after that program? There is no such thing in my simutrans directory.

jamespetts

I have to say that I do not know how this works, as I have never looked into it in detail: all that I did was copy the relevant lines into my .vcxproj file and it worked for me.

I wonder whether one of the Standard developers who worked on this system might be able to assist?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Junna

#19
I get

Quote1>  C:\simuscr2\revision.jse(9, 1) WshShell.Exec: File could not be found.

Edit:
Though I can compile using an empty revision.h file in folder.

jamespetts

That is very odd. It is very difficult for me to assist with this, since I do not know how the underlying system works.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.