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

Build failure in VS2017 (warning C4530) #132

Closed benkaraban closed 7 years ago

benkaraban commented 7 years ago

I followed the instructions in docs/building.md but when building in VS2017 Community Edition, I got a large number of "warning C4530: C++ exception handler used, but unwind semantics are not enabled" in the sc2* projects.

And since warnings are treated as errors, the build failed.

I was able to fix this by adding this line at the right place in CMakeLists.txt: set(CMAKE_CXX_FLAGS "/EHsc" CACHE STRING "" FORCE)

But I'm not sure if this is a problem with my own setup or with the project itself?

kuzi117 commented 7 years ago

I'm not sure about your issue, but I did want to point out that you've effectively removed all cxx flags except for the one you set the since the command overwrites the flags. Try "/EHsc ${CMAKE_CXX_FLAGS}" to concatenate it and to make sure that removing a flag also want the solution. Also using cache and force seems unneeded to me, I've modified cxx flags without those before. Was it not working without them?

AnthonyBrunasso commented 7 years ago

We use 2017 professional in the office and believe have at least tested for a clean compile with the community edition. I can try again again with the community edition when I get in today.

benkaraban commented 7 years ago

You can forget about this. I've regenerated everything from scratch on a fresh clone and it worked fine.

The first time I launched CMake, I was missing some VS components and needed to rerun it after the VS installer. I guess CMake's first run left some intermediate files that confused it when run for the second time.

In any way, this was indeed a quirk on my side and not a problem with the project.

Sorry for the noise and thanks for the support.

AnthonyBrunasso commented 7 years ago

Oh that's great to hear! Thanks for letting me know.