eezstreet Posted April 3, 2015 Posted April 3, 2015 (edited) Update (10/23/2024): This thread is out of date, to compile, you can either follow OpenJK's compilation guide or Flate's Ubuntu/Debian tutorial here. Prerequisites Currently JKGalaxies can be compiled on the following platforms: Win32 VS2014 and below Win32 VS2015 Win64 VS2015 It currently does NOT compile on the following platforms: Mac Linux Win64 VS2014 and below MinGW The following platforms will compile with some features omitted: Visual Studio 2015 In addition to one of the above platforms, you will need: CMake Git (for the `develop` branch) Compiling Guide You'll need to acquire the source code for JKGalaxies. This can be done on our Github page by either cloning the repository or downloading a zipped version of it. If you wish to contribute to the project, it is highly recommended that you create a fork of the project and clone your fork. When you have changes pushed to your fork, you can use a pull request. Currently, the directions for compilation are identical to the OpenJK Windows tutorial, located here: http://jkhub.org/tutorials/article/145-compiling-openjk-win32-must-read-for-new-coders/ Extra Steps for Visual Studio 2015 Visual Studio 2015 has a radically altered C runtime library (CRT) and as a result of this change, the game does not compile correctly because some of the libraries were compiled with older CRTs. To counter this, you'll need to disable the OpenSSL cryptography package (currently not used). Assuming you've loaded up the project in Visual Studio, right click on the MP Game Library in the Solution Explorer and select properties. Along the left hand side of the properties panel, do Configuration Properties > C/C++ > Preprocessor. On the line labelled Preprocessor Definitions, toggle the drop down and hit Edit. On a new line, add NO_CRYPTOGRAPHY. You'll also need to use a different version of SDL, the window, sound and input manager used by OpenJK and its derivatives. If you don't have the Properties panel open, right click on the MP Client project and hit Properties. If you still have the properties panel open, simply click on the MP Client project in the Solution Explorer. From here, do Configuration Properties > Linker > Input. On the line labelled Additional Dependencies, toggle the drop down and hit Edit. Find these lines: ..\..\codemp\libraries\SDL2\lib\x86\SDL2.lib ..\..\codemp\libraries\SDL2\lib\x86\SDL2main.lib and change it to this: ..\..\codemp\libraries\SDL2\lib\x86\vs2015\SDL2.lib ..\..\codemp\libraries\SDL2\lib\x86\vs2015\SDL2main.lib Edited October 23 by Futuza Linking to more up to date guide. Smoo and Futuza like this
eezstreet Posted April 3, 2016 Author Posted April 3, 2016 Ask @@Xycaleth. He had luck getting it to compile for Linux. Smoo likes this
Xycaleth Posted April 3, 2016 Posted April 3, 2016 I got it compiling for OSX. I don't know if it will compile under Linux. Smoo likes this
Smoo Posted April 3, 2016 Posted April 3, 2016 I just tried it, it compiled but when i do make it stops at 20% and I get this error:codemp/CMakeFiles/jkgalaxies.x86_64.dir/build.make:1802: recipe for target 'codemp/CMakeFiles/jkgalaxies.x86_64.dir/libraries/mp3code/csbt.c.o' failedmake[2]: *** [codemp/CMakeFiles/jkgalaxies.x86_64.dir/libraries/mp3code/csbt.c.o] Error 1CMakeFiles/Makefile2:125: recipe for target 'codemp/CMakeFiles/jkgalaxies.x86_64.dir/all' failedmake[1]: *** [codemp/CMakeFiles/jkgalaxies.x86_64.dir/all] Error 2Makefile:136: recipe for target 'all' failedmake: *** [all] Error 2
Futuza Posted April 11, 2016 Posted April 11, 2016 Which build did you try @ were you on the master branch or a different one? Which compiler?
eezstreet Posted April 11, 2016 Author Posted April 11, 2016 I just tried it, it compiled but when i do make it stops at 20% and I get this error:codemp/CMakeFiles/jkgalaxies.x86_64.dir/build.make:1802: recipe for target 'codemp/CMakeFiles/jkgalaxies.x86_64.dir/libraries/mp3code/csbt.c.o' failedmake[2]: *** [codemp/CMakeFiles/jkgalaxies.x86_64.dir/libraries/mp3code/csbt.c.o] Error 1CMakeFiles/Makefile2:125: recipe for target 'codemp/CMakeFiles/jkgalaxies.x86_64.dir/all' failedmake[1]: *** [codemp/CMakeFiles/jkgalaxies.x86_64.dir/all] Error 2Makefile:136: recipe for target 'all' failedmake: *** [all] Error 2 This seems to be an issue with MP3 code. Paging @@ensiform to see if anything has changed with OpenJK. Also updating the first post. Smoo likes this
Smoo Posted April 13, 2016 Posted April 13, 2016 I think i was trying the jkg that I forked and not the official one though, or do forks also get updated automatically?
eezstreet Posted April 13, 2016 Author Posted April 13, 2016 Forks have to get updated manually. Do you have just your fork cloned? Updating is rather simple.
Smoo Posted April 14, 2016 Posted April 14, 2016 Actually I realised I didn't fork jkg cause It just take me to my openjk fork if i try to lol so yeah not sure what issue is
Futuza Posted April 14, 2016 Posted April 14, 2016 Actually I realised I didn't fork jkg cause It just take me to my openjk fork if i try to lol so yeah not sure what issue isFirst of all I recommend using SourceTree if your on windows or mac, to make using git easier, especially when it comes to merging (you're still going to want a comparison tool like kdiff3 though). However, if you just want to use the git bash shell here's some basic guidelines: Do this with git: git clone https://github.com/JKGDevs/JediKnightGalaxies.gitAlternatively, you can do what I do and make your own github fork, just click the fork button or this link. Then use the url of your fork instead of the JKGDevs master copy. You then have to remember to do pull requests when you're ready to submit changes. I mostly do this so I can commit changes as often as I like and easily switch machines without having to mess the JKGDevs git all up, so for example if I'm in the middle of working on a function, but I don't have time to finish it I can submit it then go to work and pull it, and work on it on my freetime at work. If you're just going to be working on one machine then it's probably overkill doing this. When ready to submit code do: git add * git commit -m "Message about what you're submitting"When ready to send to remote server: git push origin masterORnameofbranchTo get latest updates and update your local copy: git pull originTo get latest updates and update your local copy without keeping any of your changes (overwrite all your stuff, no merging): git fetch origin git reset --hard originTo switch branches git checkout nameofbranch eezstreet and Smoo like this
Smoo Posted June 4, 2016 Posted June 4, 2016 Tried to compile just the severside on linux today and got this error:"codemp/game/CMakeFiles/gamex86_64.dir/build.make:974: recipe for target 'codemp/game/CMakeFiles/gamex86_64.dir/g_session.cpp.o' failedmake[2]: *** [codemp/game/CMakeFiles/gamex86_64.dir/g_session.cpp.o] Error 1CMakeFiles/Makefile2:167: recipe for target 'codemp/game/CMakeFiles/gamex86_64.dir/all' failedmake[1]: *** [codemp/game/CMakeFiles/gamex86_64.dir/all] Error 2Makefile:136: recipe for target 'all' failedmake: *** [all] Error 2" The jkgalaxiesded.x86_64 file worked but the I guess the rest of the code didn't. Lol
eezstreet Posted June 4, 2016 Author Posted June 4, 2016 Errr...it says that there was an error with g_session.cpp. I can't really tell much more from that error log. Smoo likes this
Futuza Posted June 5, 2016 Posted June 5, 2016 So that's your make file's error, are you getting a compiler error as well? Smoo likes this
Smoo Posted June 7, 2016 Posted June 7, 2016 So that's your make file's error, are you getting a compiler error as well?I had no compiler error
Futuza Posted July 20, 2016 Posted July 20, 2016 (edited) I realize this is not at all helping with the issue you were having NubSmoo, and I hope to start looking at linux compiles soonish, but want to make a few notes when it comes to compiling JKG with vs2015 that are not included in eezstreet's original post. Please also note, I have not extensively tested my findings yet on multiple machines, so there may be things I missed. To begin, note that I'm using vs2015 with the latest update so it is entirely possible this may not work with vanilla vs2015 entirely. For easy building copy the CreateVisualStudio2013Projects.bat and then rename it to CreateVisualStudio2015Projects.bat and change the 12 to a 14, like so: cmake -G "Visual Studio 12" -D CMAKE_INSTALL_PREFIX=../install .. cmake -G "Visual Studio 14" -D CMAKE_INSTALL_PREFIX=../install .. Run the batch (make sure you have CMake installed) and it will build the solution and project. In JediKnightGalaxies\codemp\libraries\json\cJSON.cpp change line 46-50 from: #ifdef WIN32 #define snprintf sprintf_s #endif to #ifdef WIN32 #if (_MSC_VER < 1900) //No longer necessary in vs2015 --Futuza #define snprintf sprintf_s #endif #endif Finally, you need to replace the SDL2 source with the latest version that has fixes for vs2015 ( JediKnightGalaxies\codemp\libraries\SDL2\ ), you can get it here. You also will need to use the SDL2.dll from this build in your builds. I plan on making these changes and possibly others (if I encounter other issues while testing) in a new commit once I've finished some other fixes and I'll update the github source so doing these steps will no longer be necessary, until then make sure you implement these changes if using vs2015 if you want it to compile. And yes, I suppose this means I'm working on JKG again for the moment. EDIT: The necessary changes have been pushed to the latest master branch on the github, vs2015 should work fine now. Edited August 2, 2016 by Darth Futuza Updating Information Smoo likes this
eezstreet Posted July 20, 2016 Author Posted July 20, 2016 You should submit a pull request with those changes to the code, if you haven't already. Also I'm about 90% sure that issues with SDL are fixed in latest OpenJK. Smoo likes this
Futuza Posted July 28, 2016 Posted July 28, 2016 Okay so I just got back from my trip I'll see if I have time to add this while I'm at work. @@eezstreet did you want me to use the code from openjk regarding the sdl, or just grab the latest sdl and use that? Cause I really don't want to try to merge jkgalaxies with openjk at the moment, that'll be like 1000+ commits to sift through. Smoo likes this
eezstreet Posted July 28, 2016 Author Posted July 28, 2016 Just pull and resolve conflicts using mergetool. Make the software do the work. Smoo likes this
Futuza Posted July 28, 2016 Posted July 28, 2016 Just pull and resolve conflicts using mergetool. Make the software do the work.I'm not quite sure it'll be as magic as you make it sound, but I'll give it a go. You going to be on irc tonight or tomorrow in case I run into problems? What tool do you usually use for diff comparisons, kdiff, something else? Smoo likes this
eezstreet Posted July 28, 2016 Author Posted July 28, 2016 kdiff works.You need to set up a remote for the OpenJK repository if you haven't already. Here's how you would do it: git remote add openjk https://github.com/JACoders/OpenJK Switch to 'develop' branch: git checkout develop Pull from OpenJK: git pull openjk master Resolve conflicts: git mergetool Smoo likes this
Futuza Posted August 2, 2016 Posted August 2, 2016 So I pushed the changes I mentioned in my previous post (finally, lol) so if you're using vs2015 it should work fine now. I then tried to do the merge with openjk. After about 4 hours of trying to resolve conflicts correctly so there were no more errors I gave up and couldn't get it to compile, I'll try again latter when I'm feeling a bit more motivated. Smoo likes this
JaceSolarisVIII Posted August 4, 2016 Posted August 4, 2016 Does OpenJK still compile in VS2010 ? I thought the aim was to make the JKA code stable and fixing errors.Not modifying it to a point where people have to by a new PC with the latest program's just to get it to compile?. If this is not the case then i just want to ask where can i get a Jedi Academy source code in OpenJK format that will compile in VS2010..Wasn't that the original idea?
Stoiss Posted August 4, 2016 Posted August 4, 2016 OpenJK can compile in VS C++ 2010 there is a bat file for that in OpenJk's folder that you can use after have make the cmake setup
Xycaleth Posted August 4, 2016 Posted August 4, 2016 Does OpenJK still compile in VS2010 ? I thought the aim was to make the JKA code stable and fixing errors.Not modifying it to a point where people have to by a new PC with the latest program's just to get it to compile?. If this is not the case then i just want to ask where can i get a Jedi Academy source code in OpenJK format that will compile in VS2010..Wasn't that the original idea?The original idea was to make the code stable. Newer language features can make this easier to achieve which require newer compilers. The original code had many instances of invalid (non-compliant) code as well which newer compilers will flag up as errors.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now