Compiling Source in VS 2022

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
Carolusclen
Engineer
Engineer
Posts: 8
Joined: 31 Dec 2016 10:59

Compiling Source in VS 2022

Post by Carolusclen »

Hey everyone

I would like some assistance with compiling the source code for OpenTTD 12.2 please

So to start, im pretty new to C++ but I am no stranger to coding and scripting so I know my way around a fare bit
I have gone through the tutorials and guides, gone through the forums to check for some of the issues and what not and got an understanding but I am at the point now where I am a little lost

So I have VS 2022, I went to the GIT for TTD and downloaded it into VS via https://github.com/OpenTTD/OpenTTD.git
VS pulled it and opened it. I compiled it right away and it works fine. compiling has no issues.

I noticed that the revision version was "norev0000" which I discovered means that something is not set up correctly and that multiplayer is disabled
I require MP as the changes I made are for myself and a friend to play around on

The output in VS has a part that says

CMake Warning at cmake/scripts/FindVersion.cmake:118 (message):
No version detected; this build will NOT be network compatible

After doing some more digging I found that there are some requirements too, so I followed the documents on how to set everything up, none of which helped me, mostly because of links leading to dead pages and nothing really pertaining to VS
I tried doing things through GIT for windows, installing CMAKE and vcpkg and then pulling down the libraries like zlib and such, but then I just cant get that to function as intended or know how to link it back to the VS for compiling.

As much as I enjoy mucking around with stuff like this, I have come to a point where I dont know what else to try or what I am doing :P

Is someone able to tell me how to get a working modified variation of the source, with a working revision number and the required libraries loaded please.
Even a bullet point list of, do this, then that then that would be helpful too.

Any help will be appreciated thanks :)
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Compiling Source in VS 2022

Post by Eddi »

i have no experience with VS, but the two things i'd ask at that point:
  • did you make a clone of the repository (i.e. do you have local access to the full history) or just get a source bundle?
  • is the git executable in your PATH? (can you open a CMD window, go to the directory where you downloaded the source, and type "git status"?)
Carolusclen
Engineer
Engineer
Posts: 8
Joined: 31 Dec 2016 10:59

Re: Compiling Source in VS 2022

Post by Carolusclen »

hey ^.^

So yes, I made a clone of the repository so that VS auto pulls down all the content into the repo
And yes, everything, GIT, CMAKE and vcpkg are all in my PATH variable on my PC

Part of the issue is I dont really know what commands to use, how to use them or what order to do them in

to put it simply, what I have read in the way of documentation so far feels like

1) Download Requirements
2) Compile the code

I feel like its like that meme on how to draw an Owl, you draw 2 circles then draw the rest of the owl, not very helpful
well for me anyway :(
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: Ahrefs [Bot] and 0 guests