GameAnalytics / GA-SDK-CPP

Repository for GameAnalytics C++ SDK.
MIT License
20 stars 16 forks source link

Problem when compiling the lib for target win32-vc140-static #72

Closed andresantacruz closed 5 years ago

andresantacruz commented 5 years ago

I'm trying to compile the GA library to use in a project I'm working on.

The project is built using VC++ v141 and Visual Studio 2017 but all the build system I could find in the makefile (as well as the binaries present in the "./precompiled/" folder) have only options for build with the VC++ compiler using the toolchain v120 and v140, which is strange as in the readme of this repository it says that the build system is using VS2017 as default and as far as I know the default toolchain for VS2017 is the v141.

The problem is that even with v140 installed and selecting "win32-vc140-static" for the build.bat it outputs an error I never see before.

You can find the complete output here: https://gist.github.com/andresantacruz/90c9fbf1bcc2c25ae08703c225b0425f

So I endup with these 2 questions: 1- If the build system is using VS2017 as default, why the command "build.bat -h" does not display any possible target using vc141? 2- About the error output specifically: any idea about the error? It seems that there is something missing in my VS installation. I already tried to repair the installation and completely uninstall and install again the VS, nothing seems to work. The error points to the fact that it can't find the VCTargetsPath variable, which should be set when installing the VS right?

Thanks in advance.

the1schwartz commented 5 years ago

In the latest commit on the master branch there has now been added precompiled libs for vc141 targets and the build script has also been updated to be able to manually build vc141 targets

andresantacruz commented 5 years ago

What about the dependencies (curl and openssl)? None of them are updated to v141. I found the version of the openssl but I couldn't find the version of curl is being used in the project. May you tell me the exact version of the libcurl? Or if you are planning to update the repository with the dependencies compiled with the toolchain v141.

Thanks again.

the1schwartz commented 5 years ago

Oh yeah. I will look into that to update them as well. Do you get errors if you use the v140 dependencies in a v141 project?

andresantacruz commented 5 years ago

Oh yeah. I will look into that to update them as well. Do you get errors if you use the v140 dependencies in a v141 project?

I didn't try that because it is highly unrecommended to do that, I rather just downgrade my whole project to v140 in order to use this GA CPP project untill the repository is updated to support the v141. One shouldn't mix binaries compiled with different versions of the toolchain.

the1schwartz commented 5 years ago

According to this post there should be no problem mixing vc141 binaries and vc140 binaries: https://www.reddit.com/r/cpp/comments/6gshou/vs2017vc141_is_binary_compatible_with_vs2015vc140/ which is also referencing Microsoft's own blog post: https://blogs.msdn.microsoft.com/vcblog/2017/03/07/binary-compatibility-and-pain-free-upgrade-why-moving-to-visual-studio-2017-is-almost-too-easy/

andresantacruz commented 5 years ago

According to this post there should be no problem mixing vc141 binaries and vc140 binaries: https://www.reddit.com/r/cpp/comments/6gshou/vs2017vc141_is_binary_compatible_with_vs2015vc140/ which is also referencing Microsoft's own blog post: https://blogs.msdn.microsoft.com/vcblog/2017/03/07/binary-compatibility-and-pain-free-upgrade-why-moving-to-visual-studio-2017-is-almost-too-easy/

Wow thanks for sharing this, I did not know that they made the toolchain v141 backward compatibility with v140.

I will still try to abuse a bit of your good will and ask you to share two little informations (assuming I want to rebuild the dependencies on my own): 1- what is the exact version of libcurl used in the GA-CPP project; and 2- as the dependencies source are not shipped in the repository can I safely assume you guys didn't made any change to these dependencies source code?

Thanks again in advance @the1schwartz !

the1schwartz commented 5 years ago

I can't actually remember but I think it is 7.37.1 for curl. We haven't altered anything in the source when we compiled, we have only used the defines in this file: https://github.com/GameAnalytics/GA-SDK-CPP/blob/master/source/dependencies/curl/build_defines_win.txt