Jump to content

Code just stopped compiling...?


Go to solution Solved by eezstreet,

Recommended Posts

An odd thing happened to me. About a week ago, I seemed to be able to compile my code. Now it won't compile, and I'm 99% sure I didn't change anything. The code on my PCs (I tried it on both, same problem) should have been and definitely is right now in sync with my github repository. Not sure what went wrong.

 

The issues seem to be with code/server/sv_game.cpp and shared/sdl/sdl_input.cpp.

 

In sv_game.cpp the identifier CL_InitCGameVM isn't recognized and in sdl_input.cpp the identifier cl_consoleKeys is not recognized. Anyone have any idea what could have caused this? Am I missing a file somewhere? I tried replacing those files with re-downloaded files from my own repo/fork and with versions of those files from the latest OpenJK build.

 

 

Link to comment

Do you have the latest SDL2 library installed on your system?

 

Hmm, not sure. I was just looking on the website? How do I install it? Do I just extract the dll to my Windows folder or something?

 

Do you have actual compiler errors we can look at? You're being very vague.

 

The output log:

 

2r27y82.jpg

 

Error list:

 

2vvw9sj.jpg

 

 

These are the two red errors in the code that I'm guessing are causing all the other errors:

 

211ma00.jpg

 

24f9oj4.jpg

Link to comment

Hmm, not sure. I was just looking on the website? How do I install it? Do I just extract the dll to my Windows folder or something?

It's best to install it through Windows Update on Windows. It should offer the latest version.

Link to comment

It's best to install it through Windows Update on Windows. It should offer the latest version.

Wtf? SDL isn't offered through Windows Update...

Google SDL and download the development files. I'm like 90% sure they're included with OpenJK anyway.

Link to comment

Close VS and try running CMake again to re-generate the project files. Make sure the lines involved in the errors here aren't different to the upstream OpenJK code.

 

I tried those things (deleting my local repository and re-cloning, using the latest versions of the problem files from OpenJK, rerunning CMake). Didn't seem to work.

 

 

Sorry, you're right. I guess I've gotten too used to the convenience of Linux.

 

https://www.libsdl.org/download-2.0.php

 

I saw the downloads there. The download just seems to be a dll file. How do I "install" it? I can't find any instructions. Do I put it in with my OpenJK source code somewhere? Do I put it in my computer's operating system folder? My apologies, I'm not saavy with all this stuff yet.

Link to comment

Do a search for the file on your PC. If you have/had a previous version of SDL it will show up (I think it's in the "system" folder in Windows). You can put it either directly in the game's directory, or system-wide into Windows. But if you're compiling, I guess you'll need it to be installed system-wide.

 

Have you tried what @@Didz said?

Link to comment
  • Solution

I took another look. The problem isn't SDL related. You're missing a cvar definition, so the problem isn't restricted to those lines of code. You'll need to find where cl_consolekeys is defined in OpenJK and add the definition back in.

Cerez likes this
Link to comment

Ok, I fixed all the code. It turns out there was some missing/faulty code in client.h which was causing problems. Thanks for all the help guys.

 

I still have one more problem though. It seems I need the SDL2 thing that yall were talking about. I get an error when I try to start the game saying "The program can't start because SDL2.dll is missing from your computer".

 

How do I install it exactly? I know where to download the file, just not what to do with it. Do I put it somewhere on my computer, or combine it with my source code somehow?

 

 

EDIT: Oh wow. I just put SDL2.dll into my gamedata folder and that was it. :lol:

Cerez and Asgarath83 like this
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...