Blizzard / s2client-api

StarCraft II Client - C++ library supported on Windows, Linux and Mac designed for building scripted bots and research using the SC2API.
MIT License
1.66k stars 281 forks source link

How to build the api ? #73

Closed raynor636 closed 7 years ago

raynor636 commented 7 years ago

Hi, After following the building.md tutorial in docs folder i run cmake as it is explained but i got this error I have added the paths of the binaries to environement variable PATH for cmake and msbuild as well Thank you

cmd_2017-08-14_22-33-49

davechurchill commented 7 years ago

Try using the MSVC developer console instead of the normal CMD console

raynor636 commented 7 years ago

I have Visual Studio 2017 Community installed does it work with it ?

agrutter87 commented 7 years ago

I was able to use the Community version.

Is this your first time installing Visual Studio like it was for me? At first I didn't know what components to select, and the basic install wasn't enough. I had to select the C++ tools and all that by running the "Visual Studio Installer" and selecting "Modify". Here's the components I have selected:

image

image

image

image

image

I am by no means an expert on this, but I did manage to get it to build after hours of installing and uninstalling things. Also, at one point I uninstalled everything and reinstalled Visual Studio before CMake. Wasn't sure if it mattered but what the hell noobs have to just try stuff, right? LOL

raynor636 commented 7 years ago

Thank you @agrutter87 am not an expert too so i have opened the solution named bot.sln in the project folder and it asked to install about 4 Go of packages then now i get this error when i click on generate the solution

devenv_2017-08-15_01-07-43

Then when i open main.cpp i get this

devenv_2017-08-15_00-58-11

kuzi117 commented 7 years ago

That looks like your include directories aren't set up correctly. Did you set your project's include path?

AnthonyBrunasso commented 7 years ago

The bot solution is for generating the prebuilt binary solution.

The solution file you want to open is build/s2client-api.sln. Sorry for the confusion.

raynor636 commented 7 years ago

@kuzi117 it saying to don't touch it

devenv_2017-08-15_01-17-57

AnthonyBrunasso commented 7 years ago

image

You want to open this solution.

raynor636 commented 7 years ago

great ! how do you build this folder @AnthonyBrunasso ?

AnthonyBrunasso commented 7 years ago

It's the output of cmake, you would have created the folder and got the solution from the cmake command working in your first post.

You could alternatively download this package if you don't want to build the api from source: http://blzdistsc2-a.akamaihd.net/SC2API_Binary_vs2017.zip

raynor636 commented 7 years ago

yes @davechurchill said to build it inside MSVC so i've started something and i found myself doing something else, i've tryed again cmake and i still got the same error even with the gui

cmake-gui_2017-08-15_01-35-13 cmake-gui_2017-08-15_01-35-38

AnthonyBrunasso commented 7 years ago

If you want to build from source please follow our building docs (https://github.com/Blizzard/s2client-api/blob/master/docs/building.md) and you'll likely need to install the components @agrutter87 recommended, this is actually a step I was not aware of so I'll have to update our docs appropriately, thank you, agrutter. Basically your environment needs to be set up in such a way that cmake finds your compiler.

If you download http://blzdistsc2-a.akamaihd.net/SC2API_Binary_vs2017.zip that package comes with prebuilt library files so you don't have to worry about any of this. You should just be able to extract it somewhere and open bot.sln and build.

raynor636 commented 7 years ago

it would be nice to have a tutorial on yt explaining how to build it by following the building.md steps thx @AnthonyBrunasso for the package it works !

2017-08-15_01-51-45

AnthonyBrunasso commented 7 years ago

Glad I could help @raynor636!

I will close this issue unless you have any other questions.

raynor636 commented 7 years ago

it's okey @AnthonyBrunasso the issue is closed and now i am on the code so it worked by installing in VS the components that @agrutter87 talked about and then i was abeld to build it by running the command and steps of building.md

https://youtu.be/TTrO-HQLBdQ thx a lot guys 🔢

sihuaiwei commented 7 years ago

@raynor636 Where is bot.exe? need install StarCraft II?when i make successful ,i do not know how to run the example ,and where is bot.exe

raynor636 commented 7 years ago

When it is build you need to open the s2client-api.sln solution and compile everything but it should be another issue if you can open it (like "how to build a first bot") it can be cool i am not gone far from this point waiting to watch people making vids and tutorials on social nets 📻 or you can find it by downloading the package that have posted @AnthonyBrunasso btw yes i think SC2 have to be installed first to run any AI

2017-08-18_12-50-37

sihuaiwei commented 7 years ago

@raynor636 i what now in windows, after start s2client-api.sln do what?

raynor636 commented 7 years ago

let's move here https://github.com/Blizzard/s2client-api/issues/93 :taco: