1>C:\Users\Bonne\Downloads\simutrans-extended-master\simutrans-extended-master\utils\simthread.h(34,10): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory (compiling source file gui\tool_selector.cc)
1>Done building project "Simutrans-Extended.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Even though the that pthread,h file is there. I don't know what to do. Please help!
It is in the utilities folder yet it still can't read it. And the Japanese is fine. If you have the same 2019 version mine should match up with yours and I can just use mine as a reference.
Here is my source code: C:\Users\Bonne\Downloads\simutrans-extended-master\simutrans-extended-master\utils\openttd
edit: Just doubled checked and it is not in that folder. Sorry, I will move it there and see if it works.
I transferred it to the folder but it's still saying that it can't find that file. I just might leave Simutrans as is and forget about converting units from metric to us for now and come back to it another time. Thank you for your help by the way.
If you put your changes on github, I could try to compile it on my machine to see if it works
Thank you. That will be a big help. If you can't get it can you tell me what I did wrong?
Here's the link:
https://github.com/MasterJedi1996/TheRoadmaster1996-Simutrans-Extended-Source-Codes-U.S.-Units
It is a 7zip so I can get it uploaded under the 150MB limit.
Quote from: TheRoadmaster1996 on July 06, 2020, 03:21:49 PM
Thank you. That will be a big help. If you can't get it can you tell me what I did wrong?
Here's the link:
https://github.com/MasterJedi1996/TheRoadmaster1996-Simutrans-Extended-Source-Codes-U.S.-Units
It is a 7zip so I can get it uploaded under the 150MB limit.
This isn't quite what I meant by put it on github! usually we create a fork of the original. either way i am looking into it now...
Oh sorry. I'm new to all of this (adding stuff to github that is) and not that tech savvy to begin with so I'm not that familiar with those kinds of terms. And thank you for your help. You don't know what a headache it has been trying to figure out what's wrong even though it looks fine.
I found a problem: you redefined some functions as yards, then tried to call them as feet. In effect, you were trying to call functions that did not exist. Yards in particular are problematic because the code already uses internal units called yards (which are not equivalent to imperial yards). I understand this is a test at this stage. Are you new to c++? If so, I would probably not pursue this change right now. If not, carry on but it will only get more complicated.
Okay thank you. If I change the yards to feet will that work? (I did mess up when changing it from meters. It should have been feet.) And I would like to try it.
Quote from: TheRoadmaster1996 on July 07, 2020, 02:05:39 PM
Okay thank you. If I change the yards to feet will that work? (I did mess up when changing it from meters. It should have been feet.) And I would like to try it.
You'd have to go back to before you made the change, otherwise you'd have no way to distinguish what was originally yards with what was originally meters. Changing the names of functions will work so long as it's done consistently. Of course this has no effect on its own.
What do you mean? Are you saying that I'll have to change say if 1 tile is 1000 meters or such? That shouldn't be difficult.
Quote from: TheRoadmaster1996 on July 07, 2020, 03:27:59 PM
What do you mean? Are you saying that I'll have to change say if 1 tile is 1000 meters or such? That shouldn't be difficult.
Unfortunately the way the code is set up makes it extremely difficult if you wish to actually convert the units and keep both systems as options. If you simply want to display "mph" in place of "km/h", but using km/h as the actual hidden unit, you would need to go through the translation texts and any string that are used to display texts. a search-and-replace would change parts of the code you didn't intend to change.
That's the thing. I dont want both I just want US units instead of metric in the game is all.
I got one more shot at this. I want to ask you something freddyhayward, where did you put the pthread.h file? Is it in the Openttd folder?
Quote from: TheRoadmaster1996 on July 08, 2020, 02:52:32 AM
I got one more shot at this. I want to ask you something freddyhayward, where did you put the pthread.h file? Is it in the Openttd folder?
I didn't move pthread.h at all; i moved plainstring.h from the main folder into the utils folder.
Well, that's it then. I officially give up and will leave Simutrans as it is. I have done all I could with the resources available and I've even asked the online community for help and you guys have provided and I still cannot get it. It is simply not to be. Thank you guys for your help.
Can I check - are you able to compile Simutrans-Extended before you have made any changes to the code? I note that you are unable to compile, but that others have pointed out that you have made changes that do not seem to relate to the issue that you are having with compiling.
May I ask whether you are familiar with how to set up code to compile? The error that you report suggests that you have not installed the necessary header files on which Simutrans-Extended relies (in this case, pthreads, the which deals with multi-threading). You need to install header file/library file combinations for quite a few libraries on which Simutrans-Extended relies, including pthreads for multi-threading, libpng for graphics, zlib for compression and a few others. There are guides for this already on the forum, I belive - have you looked at those?
No I have not. Where can I find those. Are they on this form or do I need to install them else where
Oh, it's this topic. I should have known. Thank you.
OK. So I tried compiling the game with out changing anything and it still fails saying that it cannot open libbz2.lib. The pthread error went away so that's progress!
Quote from: TheRoadmaster1996 on July 21, 2020, 10:57:45 PM
OK. So I tried compiling the game with out changing anything and it still fails saying that it cannot open libbz2.lib. The pthread error went away so that's progress!
Excellent - you now need to install and configure the header/library files for libbz2 (a .lib file is a library file, so you need to make sure that libbz2.lib is in one of the folders that Visual Studio is configured to check for library files) to overcome this error.
It is always best to try to compile the code without making any changes before trying to change anything in the code.
OK. Again where can I find it because I looked and it's nowhere.
Quote from: TheRoadmaster1996 on July 21, 2020, 11:24:30 PM
OK. Again where can I find it because I looked and it's nowhere.
Does the link in the thread to which Ranran posted a link above not work?
It does, and I have used that topic many times but it dose not provide the libbz2.lib.
Can you clarify Ran? I don't understand what you mean.
So do I need to download both versions?
Quote from: TheRoadmaster1996 on July 22, 2020, 01:51:27 AM
So do I need to download both versions?
No - you need to download the 32-bit version if you are compiling a 32 bit executable or a 64-bit version if you are compiling a 64-bit executable. You only need to download both if you are compiling both types.
Simutrans-Extended is best compiled as a 64-bit executable, since the larger games run out of memory when compiled as 32-bit executables. You need to make sure that all your libraries are the 64-bit versions, or else you will not be able to compile the executable.
I see. I've always done 64-bit seeing that that is what my laptop runs. Still, I'll bet something is wrong with the version I download. I don't know at this point I'm not worried about changing over. I'm just going to leave Simutrans as is and move on. I would like to add another horse or two and then an eighteen wheeler, plus a bus and then move on to railroads. I would like to have an older locomotive from the 1830s, an older Civil War era locomotive, a newer 1930s '40s era and then a modern day locomotive. Then a boat, a plane, some houses, factories, signals and stations and then I will be ready to post the first version of my pakset.
So what if the reason I'm having trouble is because I'm using the newest version of visual studio? Should I try an earlier version what version does everyone else use?
Quote from: TheRoadmaster1996 on August 17, 2020, 07:21:56 PM
So what if the reason I'm having trouble is because I'm using the newest version of visual studio? Should I try an earlier version what version does everyone else use?
Which version are you using? Using a newer version should not by itself prevent you from being able to compile the code.
I was using the 2017 version. The guide I was using said to use 2015. So my thought was that for the newer version it required more stuff then the older one. That was my theory.
Quote from: TheRoadmaster1996 on August 17, 2020, 10:50:23 PM
I was using the 2017 version. The guide I was using said to use 2015. So my thought was that for the newer version it required more stuff then the older one. That was my theory.
I use the 2017 version myself, so this will not be the cause of your problem. Did you get anywhere with checking that you were using the 64 bit versions of the libraries?
No I did not. Maybe I just need to re-download Visual Studio but I'm not worried about changing, I was just thinking out loud.
Quote from: TheRoadmaster1996 on August 17, 2020, 10:55:44 PM
No I did not. Maybe I just need to re-download Visual Studio but I'm not worried about changing, I was just thinking out loud.
If you want to be able to compile Simutrans-Extended, you would do well to investigate the libraries as I suspect that that is where the difficulties that you have been having are likely to lie.