Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: LCS Github Compiling?  (Read 3820 times)

Patar

  • Bay Watcher
    • View Profile
LCS Github Compiling?
« on: October 05, 2016, 05:06:36 am »

I'm completely out of my depth. I'm on Windows 10, the latest updates included. I don't really understand what compiling is. Reading through the different files in Liberal Crime Squad-master makes it sound like it it's for linus only? Can someone explain this stuff to me?
Logged

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
    • JJoseph on Deviantart
Re: LCS Github Compiling?
« Reply #1 on: October 05, 2016, 08:09:04 am »

I'm completely out of my depth. I'm on Windows 10, the latest updates included. I don't really understand what compiling is. Reading through the different files in Liberal Crime Squad-master makes it sound like it it's for linus only? Can someone explain this stuff to me?
Ah, to be young again, having never gone through the hell of getting a C++ program to compile.
I'll be blunt, I only barely know how to get it to compile, and Microsoft has me in a vise due to their insane business practices.

If you download and install Visual Studio 2015 (from Microsoft, though googling it is easier than navigating Microsoft's homepage), then you can use the project file from my fork of the GitHub repo.
http://www.mediafire.com/file/48nxbz0so4d6mz5/v4.10.i+Source+%28No+Music%29.zip
[\shameless self-promotion]
(using the straight GitHub repo doesn't work in this instance, because the project file included there is both outdated and for an older version of Visual Studio, which Microsoft no longer supports.  This is why I hate Microsoft.)
It's not the best way, but it is the easiest.

The project file is
\workspaces\game.vcxproj
It's about as automatic as it gets, for C++.

Visual Studio 2015 should automatically associate with the filetype, so the icon will change to this weird purple, or maybe black and white icon.
If, instead of using my fork you want to use Kamal-Sadek or Fox's version, Visual Studio 2015 will require some additional work for setup, or you can use an older version of Visual Studio, (I think 2010 SP1).

I hope that helps.
« Last Edit: October 07, 2016, 02:21:06 pm by IsaacG »
Logged
LCS 4.12 Thread
https://discord.gg/HYbss8eswM
Quote
Many people, meeting Aziraphale for the first time, formed three impressions: that he was English, that he was intelligent, and that he was gayer than a tree full of monkeys on nitrous oxide.
Constitution of the Confederate States
Article I Sec. 9 4
No bill of attainder, ex post facto law, or law denying or impairing the right of property in negro slaves shall be passe

Patar

  • Bay Watcher
    • View Profile
Re: LCS Github Compiling?
« Reply #2 on: October 05, 2016, 12:50:14 pm »

Thanks for responding!

If you download and install Visual Studio 2015

Just googled it and found https://www.visualstudio.com. Which one do I pick? I found another link to the windows store. Visual Studio 2015 was priced in the thousands of dollars...
Logged

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
    • JJoseph on Deviantart
Re: LCS Github Compiling?
« Reply #3 on: October 05, 2016, 02:02:56 pm »

Thanks for responding!

If you download and install Visual Studio 2015

Just googled it and found https://www.visualstudio.com. Which one do I pick? I found another link to the windows store. Visual Studio 2015 was priced in the thousands of dollars...
(I know, $5,999?  Visual Studio 2010 allowed auto-generation of MakeFile.am, but that version of 2015 doesn't.)

Yep, if it were simple, clear, and reasonably priced, asking for help compiling wouldn't be the most common thread on this forum.
(Urgh, they even changed the site layout from when I downloaded Visual Studio last year.)

Make sure of the following.
1: You have an internet connection that can download a several GB file and install it without needing to interrupt the connection.
(Fairly common, but not everyone has one.)
2: Your copy of Windows 10 is completely legal.
(No judgements, and can be circumvented the same way as item #1.)
3: Object Oriented Programming, Test Driven Development, vector<String>.
You know what at least two of these three items mean without looking them up.  You don't need to be able to use them, just know what they are as a baseline.
(If you're familiar with vector<String> but not the other two, then you are in the opposite place I was last year.)

Still here?  Good.

https://www.visualstudio.com/
On the Visual Studio page, select Download, followed by:
Visual Studio Community
Free, fully-featured IDE for students, open-source and individual developers

vs_community__[bunch of weird letters].exe
209 KB binary file

Run the installer.
Make sure anything with "C++" or "SDK" in the name is set to install.
But you can skip anything with "C#", "Mobile", or "Android" in its name or description.

Beyond that, any customization options are your choice, just keep clicking "next" if you're not sure, but keep an eye out for free trials and search bars they might attempt to trick you into installing.  Especially Bing.

[Once Installed]

.vcxproj files should automatically become associated with Visual Studio Community 2015, allowing you to open the file and VS will take care of most of the rest.

Select whatever appearance you like.

Somewhere along the top few bars of the GUI will be the word "Debug" or the word "Release".  Set it to "Release" if it isn't already.

Along the side of the screen there should be a box labeled "Solution Explorer", or possibly "Project Solution" or "crimesquad".
Right click it and select "Build Solution", or "Rebuild Solution", or "Build All", that will compile the program and export the .exe in the folder \Release
For this first run they all do the same thing, since this project only has a single solution.
This should take a few minutes to compile.  If it completes immediately, select "Rebuild" (the goal here isn't to compile, it's to make sure the computer can compile the project)

Visual Studio will generate a bunch of .obj files and crimesquad.exe
This .exe file will have a filesize of either 1MB or 10MB.  Either way, it works and should run properly, so long as it is run from a directory that contains all the data files and natives for LCS (mainly the .dll files and the art folder (music optional)).
If it compiles and runs, you're done.
If the file is 10MB it will still work fine, just oversized (and technically it will run faster, but that's not normally a concern in LCS, which is why we aim for the 1MB version).

That should be everything you need.
Logged
LCS 4.12 Thread
https://discord.gg/HYbss8eswM
Quote
Many people, meeting Aziraphale for the first time, formed three impressions: that he was English, that he was intelligent, and that he was gayer than a tree full of monkeys on nitrous oxide.
Constitution of the Confederate States
Article I Sec. 9 4
No bill of attainder, ex post facto law, or law denying or impairing the right of property in negro slaves shall be passe

Azerty

  • Bay Watcher
    • View Profile
Re: LCS Github Compiling?
« Reply #4 on: October 06, 2016, 02:16:12 am »

Thanks for responding!

If you download and install Visual Studio 2015

Just googled it and found https://www.visualstudio.com. Which one do I pick? I found another link to the windows store. Visual Studio 2015 was priced in the thousands of dollars...
(I know, $5,999?  Visual Studio 2010 allowed auto-generation of MakeFile.am, but that version of 2015 doesn't.)

Yep, if it were simple, clear, and reasonably priced, asking for help compiling wouldn't be the most common thread on this forum.
(Urgh, they even changed the site layout from when I downloaded Visual Studio last year.)

Make sure of the following.
1: You have an internet connection that can download a several GB file and install it without needing to interrupt the connection.
(Fairly common, but not everyone has one.)
2: Your copy of Windows 10 is completely legal.
(No judgements, and can be circumvented the same way as item #1.)
3: Object Oriented Programming, Test Driven Development, vector<String>.
You know what at least two of these three items mean without looking them up.  You don't need to be able to use them, just know what they are as a baseline.
(If you're familiar with vector<String> but not the other two, then you are in the opposite place I was last year.)

Still here?  Good.

https://www.visualstudio.com/
On the Visual Studio page, select Download, followed by:
Visual Studio Community
Free, fully-featured IDE for students, open-source and individual developers

vs_community__[bunch of weird letters].exe
209 KB binary file

Run the installer.
Make sure anything with "C++" or "SDK" in the name is set to install.
But you can skip anything with "C#", "Mobile", or "Android" in its name or description.

Beyond that, any customization options are your choice, just keep clicking "next" if you're not sure, but keep an eye out for free trials and search bars they might attempt to trick you into installing.  Especially Bing.

[Once Installed]

.vcxproj files should automatically become associated with Visual Studio Community 2015, allowing you to open the file and VS will take care of most of the rest.

Select whatever appearance you like.

Somewhere along the top few bars of the GUI will be the word "Debug" or the word "Release".  Set it to "Release" if it isn't already.

Along the side of the screen there should be a box labeled "Solution Explorer", or possibly "Project Solution" or "crimesquad".
Right click it and select "Build Solution", or "Rebuild Solution", or "Build All", that will compile the program and export the .exe in the folder \Release
For this first run they all do the same thing, since this project only has a single solution.
This should take a few minutes to compile.  If it completes immediately, select "Rebuild" (the goal here isn't to compile, it's to make sure the computer can compile the project)

Visual Studio will generate a bunch of .obj files and crimesquad.exe
This .exe file will have a filesize of either 1MB or 10MB.  Either way, it works and should run properly, so long as it is run from a directory that contains all the data files and natives for LCS (mainly the .dll files and the art folder (music optional)).
If it compiles and runs, you're done.
If the file is 10MB it will still work fine, just oversized (and technically it will run faster, but that's not normally a concern in LCS, which is why we aim for the 1MB version).

That should be everything you need.

Can CodeBlocks be used for this project?
Logged
"Just tell me about the bits with the forest-defending part, the sociopath part is pretty normal dwarf behavior."

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
    • JJoseph on Deviantart
Re: LCS Github Compiling?
« Reply #5 on: October 06, 2016, 08:02:29 am »

Can CodeBlocks be used for this project?
Short answer, no; Microsoft doesn't really make things compatible.
Good news is that, since LCS is open source, it should be more than possible to port it manually.
I think I've seen you on the forums before.  This is why I hate C++, the language has been around for decades, yet there's still no easy way to just compile a frickin' project if using a different IDE.
I'm downloading Code::Blocks now, and mark my words, within thirty six hours I will have instructions for how to compile LCS in it!
Logged
LCS 4.12 Thread
https://discord.gg/HYbss8eswM
Quote
Many people, meeting Aziraphale for the first time, formed three impressions: that he was English, that he was intelligent, and that he was gayer than a tree full of monkeys on nitrous oxide.
Constitution of the Confederate States
Article I Sec. 9 4
No bill of attainder, ex post facto law, or law denying or impairing the right of property in negro slaves shall be passe

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
    • JJoseph on Deviantart
Re: LCS Github Compiling?
« Reply #6 on: October 06, 2016, 12:54:13 pm »

Can CodeBlocks be used for this project?
Short answer, no; Microsoft doesn't really make things compatible.
Good news is that, since LCS is open source, it should be more than possible to port it manually.
I think I've seen you on the forums before.  This is why I hate C++, the language has been around for decades, yet there's still no easy way to just compile a frickin' project if using a different IDE.
I'm downloading Code::Blocks now, and mark my words, within thirty six hours I will have instructions for how to compile LCS in it!

It's been four hours.  Still haven't gotten it to work.  I hate C++.  I hate C++ very, very much.
Would anyone complain if I just ported the damn thing to Java?  I feel like that might actually be easier.  Practically rewriting the game from scratch...
I mean, every third thread here is someone who wants help just getting it to compile, and I'm not sure any of us know how to do that.
« Last Edit: October 06, 2016, 01:04:28 pm by IsaacG »
Logged
LCS 4.12 Thread
https://discord.gg/HYbss8eswM
Quote
Many people, meeting Aziraphale for the first time, formed three impressions: that he was English, that he was intelligent, and that he was gayer than a tree full of monkeys on nitrous oxide.
Constitution of the Confederate States
Article I Sec. 9 4
No bill of attainder, ex post facto law, or law denying or impairing the right of property in negro slaves shall be passe

ThunderGraham

  • Escaped Lunatic
    • View Profile
Re: LCS Github Compiling?
« Reply #7 on: October 06, 2016, 04:32:36 pm »

If you're using Windows 10, I would highly recommend downloading Bash and then following the instructions in COMPILE_README for compiling in Linux. After countless fruitless hours of wrestling with CodeBlocks and Visual Studio, getting the [gosh diddly darn] game to finally run was satisfying. From my experience, compiling in Linux as-is will get everything to work except for music (as far as I can tell).
How to install Bash on Windows 10: http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/
Good luck!
Logged

IsaacG

  • Bay Watcher
  • Mad Engineer
    • View Profile
    • JJoseph on Deviantart
Re: LCS Github Compiling?
« Reply #8 on: October 07, 2016, 02:17:40 pm »

Can CodeBlocks be used for this project?
it can now

Problems:
It doesn't generate the icon (the .res file is "unknown filetype", and had to be removed)
The command line generates both std=c++98 and std=c++11, but since the second one overwrites the first, it just looks bad, it doesn't cause any errors.
There are a boatload of warnings, but nothing dangerous.  Mostly it's unused imports.

But it compiles and runs just fine
The only real problem is that automatically generated multi-save files don't work properly.  All this means is that when you get the message "in what world..." don't leave your answer blank more than once.  I didn't even know it had the functionality, but now it doesn't until I figure out how to fix it to work in Code::Blocks.  You can still have multiple savefiles.

Download my fork,
http://www.mediafire.com/file/48nxbz0so4d6mz5/v4.10.i+Source+%28No+Music%29.zip
and
workspaces\game.cbp
I have updated the Code::Blocks project file to function.
http://www.codeblocks.org/downloads/26
codeblocks-16.01mingw-nosetup.zip
This is the release of Code::Blocks I used to do this.  You're [very] welcome.  This was a valuable learning experience/torture.
Welcome to the community.  :D
« Last Edit: October 07, 2016, 02:33:50 pm by IsaacG »
Logged
LCS 4.12 Thread
https://discord.gg/HYbss8eswM
Quote
Many people, meeting Aziraphale for the first time, formed three impressions: that he was English, that he was intelligent, and that he was gayer than a tree full of monkeys on nitrous oxide.
Constitution of the Confederate States
Article I Sec. 9 4
No bill of attainder, ex post facto law, or law denying or impairing the right of property in negro slaves shall be passe