Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win32 - Dependency Build Failures #8

Closed
geoffthemedio opened this issue Jun 1, 2016 · 51 comments
Closed

Win32 - Dependency Build Failures #8

geoffthemedio opened this issue Jun 1, 2016 · 51 comments
Labels

Comments

@geoffthemedio
Copy link
Member

After generating the SDK build solution, picking Build Solution in the GUI gives me some success, and some errors in the output:

sdk_build_errors

@adrianbroher
Copy link
Contributor

The README.md contains the steps on how to build the SDK (which doesn't involve any Visual Studio GUI).

I assume that the build breaks because you didn't select the RelWithDebInfo build configuration as the screen shows Debug as selected build configuration.

@geoffthemedio
Copy link
Member Author

I switched to RelWithDebInfo, and get some different errors, but I'm not sure if these are due to local config issues with Visual Studio, so will try repairing / updating that first...

@geoffthemedio
Copy link
Member Author

Fairly sure these are legit build errors:

13>C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python\Modules\timemodule.c(713): error C2065: 'timezone': undeclared identifier [C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python-build\CMakeBuild\libpython\libpython-shared.vcxproj]
13>     1>
13>C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python\Modules\timemodule.c(721): error C2065: 'timezone': undeclared identifier [C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python-build\CMakeBuild\libpython\libpython-shared.vcxproj]
13>     1>
13>C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python\Modules\timemodule.c(724): error C2065: 'daylight': undeclared identifier [C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python-build\CMakeBuild\libpython\libpython-shared.vcxproj]
13>     1>
13>C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python\Modules\timemodule.c(726): error C2065: 'tzname': undeclared identifier [C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python-build\CMakeBuild\libpython\libpython-shared.vcxproj]
13>     1>
13>C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python\Modules\timemodule.c(726): error C2109: subscript requires array or pointer type [C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python-build\CMakeBuild\libpython\libpython-shared.vcxproj]
13>           msvcrtmodule.c
13>     1>
13>C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python\PC\msvcrtmodule.c(400): warning C4101: 'st': unreferenced local variable [C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python-build\CMakeBuild\libpython\libpython-shared.vcxproj]
13>           posixmodule.c
13>     1>
13>C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python\Modules\posixmodule.c(4389): warning C4101: 'opath': unreferenced local variable [C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python-build\CMakeBuild\libpython\libpython-shared.vcxproj]
13>     1>
13>C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python\Modules\posixmodule.c(5350): warning C4996: 'GetVersion': was declared deprecated [C:\Users\Geoff\Desktop\freeorion-sdk\bin\python-prefix\src\python-build\CMakeBuild\libpython\libpython-shared.vcxproj]
13>           C:\Program Files (x86)\Windows Kits\8.1\Include\um\sysinfoapi.h(110): note: see declaration of 'GetVersion'
13>           _subprocess.c
13>     1>

@geoffthemedio
Copy link
Member Author

15>C:\Users\Geoff\Desktop\freeorion-sdk\bin\boost-prefix\src\boost\boost/python/detail/wrap_python.hpp(50): fatal error C1083: Cannot open include file: 'pyconfig.h': No such file or directory
15>
15>             call "C:\Users\Geoff\AppData\Local\Temp\b2_msvc_14.0_vcvarsall_x86.cmd" >nul
15>         cl /Zm800 -nologo @"bin.v2\libs\python\build\msvc-14.0\release\debug-store-database\debug-symbols-on\pch-off\threading-multi\numeric.obj.rsp"
15>
15>         ...failed compile-c-c++ bin.v2\libs\python\build\msvc-14.0\release\debug-store-database\debug-symbols-on\pch-off\threading-multi\numeric.obj...
15>         compile-c-c++ bin.v2\libs\python\build\msvc-14.0\release\debug-store-database\debug-symbols-on\pch-off\threading-multi\list.obj
15>         list.cpp
15>     1>

@geoffthemedio
Copy link
Member Author

9>         No update step for 'openal-soft'
9>         Performing patch step for 'openal-soft'
9>         patching file CMakeLists.txt
9>         patching file CMakeLists.txt
9>         Performing configure step for 'openal-soft'
9>         CMake Error at CMakeLists.txt:440 (MESSAGE):
9>           No snprintf function found, please report!
9>
9>
9>         -- Configuring incomplete, errors occurred!
9>         See also "C:/Users/Geoff/Desktop/freeorion-sdk/bin/openal-soft-prefix/src/openal-soft-build/CMakeFiles/CMakeOutput.log".
9>         See also "C:/Users/Geoff/Desktop/freeorion-sdk/bin/openal-soft-prefix/src/openal-soft-build/CMakeFiles/CMakeError.log".
9>     1>
9>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1.
9>
9>Build FAILED.
9>
9>Time Elapsed 00:00:01.28

@geoffthemedio
Copy link
Member Author

4>         No update step for 'python-cmake'
4>         Performing patch step for 'python-cmake'
4>         patching file cmake/libpython/CMakeLists.txt
4>         Hunk #1 FAILED at 311.
4>         1 out of 1 hunk FAILED -- saving rejects to file cmake/libpython/CMakeLists.txt.rej
4>     1>
4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1.
4>
4>Build FAILED.
4>
4>Time Elapsed 00:00:02.06

@geoffthemedio
Copy link
Member Author

Don't understand this one... I told it to use the MSVC 14 compiler...

11>     1>
11>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\Geoff\Desktop\freeorion-sdk\bin\libpng-prefix\src\libpng-build\ZERO_CHECK.vcxproj]
11>         Done Building Project "C:\Users\Geoff\Desktop\freeorion-sdk\bin\libpng-prefix\src\libpng-build\ZERO_CHECK.vcxproj" (default targets) -- FAILED.
11>         Done Building Project "C:\Users\Geoff\Desktop\freeorion-sdk\bin\libpng-prefix\src\libpng-build\ALL_BUILD.vcxproj" (default targets) -- FAILED.
11>
11>         Build FAILED.

@adrianbroher
Copy link
Contributor

I've cherry picked a commit from the mac-support branch. The python-cmake dependency on the master branch wasn't pinned to a specific version of that project but rather downloaded the latest version.

Rebuilding the solution should fix all issues mentioned.

@geoffthemedio
Copy link
Member Author

geoffthemedio commented Jun 2, 2016

Fixed all but the pyconfig.h errors.

Edit: Or not? Now when I build, I get what looks to be the same errors again... /Edit

I recall that being something I had to manually move around to get the Python dll to build.

@adrianbroher
Copy link
Contributor

I just rechecked with a clean build directory and the most recent master. Compiles successfully with some warnings with both nmake and a Visual Studio solution.

@geoffthemedio
Copy link
Member Author

geoffthemedio commented Sep 3, 2016

I followed the instructions in the readme and did it all with the command line, and got errors. The part of the build log that I can get isin the attached log file.

build_log.txt

@adrianbroher
Copy link
Contributor

I would guess that cmake matched several different toolchain installations and standard libraries. At least this message

The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.

Did you run the commands inside a regular command line or a 'developer command line' for the specific installation? Do you have Visual Studio 2010 still installed? If no maybe there are some remains inside the registry.

@geoffthemedio
Copy link
Member Author

geoffthemedio commented Sep 3, 2016

It was a 2010 command prompt. I got similar errors when trying to build in msvc 2015 itself though, after generating the solution in the cmake-gui.

MSVC 2010 is not installed.

@geoffthemedio
Copy link
Member Author

geoffthemedio commented Sep 3, 2016

I ran it in the 2015 dev command prompt. Similar results...

build_log.txt

@adrianbroher
Copy link
Contributor

Just to clarify:

  • You want create a SDK for VS 2015? Because my testing happened for VS 2013 and the thread I found so far look like the link issue unresolved external symbol __except1 referenced in function __ftol3_except is some SDL VS 2015 incompability.
  • You're using VS 2015? Because my testing happened with VS 2013.
  • You're configuring and building from the 'Developer Command Prompt for VS 2015'?

@geoffthemedio
Copy link
Member Author

geoffthemedio commented Sep 4, 2016

I currently build / test FO with MSVC 2013. I want to try switching to MSVC2015 for building / testing FO in future. In order to do that, I'll need an SDK with all the dependencies built with 2015. For the latest SDK build attempt, I ran all the suggested commands in the "Developer Command Prompt for VS2015".

I also searched through the registry for "2010", and found a few old references to 2010 SDK build directories / git checkout locations, but nothing otherwise obviously relevant.

Some comments in this thread suggest the issues should be fixed in SDL...

https://forums.libsdl.org/viewtopic.php?p=49026&sid=4ebc4f690b316f328f0bf3a1f9113d3b

@adrianbroher
Copy link
Contributor

I think I have an idea on what is happening.

When running the cmake configure step cmake .. cmake searches for all available VS installations and all available toolkits, starting with the lowest one available, selecting the project generator for that exact version. You can instead select the generator explicit by passing the -G parameter and the generator name like

cmake -G "Visual Studio 12 2013" ..

or

cmake -G "Visual Studio 14 2015" ..

However when running the build itself on the developer command line you determine what toolset (compiler, libraries, standard/win32 headers) to use. The libraries in different toolsets may expose different symbols and while the compiler v14 uses a standard library without the __except1 symbol implemented (because the vcruntime.lib dependency is added to every default VS2015 generated project file) this doesn't work for a combination like 'VS 2010' with toolset v14.

So try configuring a new cleanproject with -G "Visual Studio 12 2013" set on the "Developer Command Line for VS 2013" and after that you can try another clean project with -G "Visual Studio 14 2015" on the "Developer Command Line for VS 2015". The first variant must work out of the box (because it's the exact same setup I use). The second variant may have some general VS 2013 to VS 2015 migration problems (or, hopefully, works out of the box too).

@adrianbroher
Copy link
Contributor

adrianbroher commented Sep 4, 2016

Also the output of the cmake .. step with and without the -G parameter would be helpful, because it explicit shows what generator was chosen and what compiler/toolset will be used.

@geoffthemedio
Copy link
Member Author

Without -G:

C:\Users\Geoff\Desktop\freeorion-sdk\build>"c:\Program Files (x86)\CMake\bin\cmake.exe" ..
-- Building for: Visual Studio 14 2015
-- The C compiler identification is MSVC 19.0.23918.0
-- The CXX compiler identification is MSVC 19.0.23918.0
-- Check for working C compiler using: Visual Studio 14 2015
-- Check for working C compiler using: Visual Studio 14 2015 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 14 2015
-- Check for working CXX compiler using: Visual Studio 14 2015 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Geoff/Desktop/freeorion-sdk/build

C:\Users\Geoff\Desktop\freeorion-sdk\build>

With:

C:\Users\Geoff\Desktop\freeorion-sdk\build2>"c:\Program Files (x86)\CMake\bin\cmake.exe" -G "Visual Studio 12 2013" ..
-- The C compiler identification is MSVC 18.0.40629.0
-- The CXX compiler identification is MSVC 18.0.40629.0
-- Check for working C compiler using: Visual Studio 12 2013
-- Check for working C compiler using: Visual Studio 12 2013 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 12 2013
-- Check for working CXX compiler using: Visual Studio 12 2013 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Geoff/Desktop/freeorion-sdk/build2

@geoffthemedio
Copy link
Member Author

Running the build for the MSVC 2013 version, it ran for a lot longer, and had just two errors at the end:

"C:\Users\Geoff\Desktop\freeorion-sdk\build2\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\Geoff\Desktop\freeorion-sdk\build2\dist.vcxproj" (default target) (10) ->
"C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng.vcxproj" (default target) (14) ->
(CustomBuild target) ->
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(61,5): error MSB8013: This proj
ect doesn't contain the Configuration and Platform combination of RelWithDebInfo|Win32. [C:\Users\Geoff\Desktop\freeori
on-sdk\build2\libpng-prefix\src\libpng-build\ZERO_CHECK.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng.vc
xproj]
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(61,5): error MSB8013: This proj
ect doesn't contain the Configuration and Platform combination of RelWithDebInfo|Win32. [C:\Users\Geoff\Desktop\freeori
on-sdk\build2\libpng-prefix\src\libpng-build\ZERO_CHECK.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng.vc
xproj]

    649 Warning(s)
    2 Error(s)

@geoffthemedio
Copy link
Member Author

To be thorough:

C:\Users\Geoff\Desktop\freeorion-sdk\build>"c:\Program Files (x86)\CMake\bin\cmake.exe" -G "Visual Studio 14 2015" ..
-- The C compiler identification is MSVC 19.0.23918.0
-- The CXX compiler identification is MSVC 19.0.23918.0
-- Check for working C compiler using: Visual Studio 14 2015
-- Check for working C compiler using: Visual Studio 14 2015 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 14 2015
-- Check for working CXX compiler using: Visual Studio 14 2015 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Geoff/Desktop/freeorion-sdk/build

and the last bit of attempting to build:

"C:\Users\Geoff\Desktop\freeorion-sdk\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\Geoff\Desktop\freeorion-sdk\build\boost.vcxproj" (default target) (3) ->
"C:\Users\Geoff\Desktop\freeorion-sdk\build\python.vcxproj" (default target) (5) ->
(CustomBuild target) ->
  C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python\Modules\timemodule.c(713): error C2065: 'timezone
': undeclared identifier [C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python-build\CMakeBuild\libpytho
n\libpython-shared.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build\python.vcxproj]
  C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python\Modules\timemodule.c(721): error C2065: 'timezone
': undeclared identifier [C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python-build\CMakeBuild\libpytho
n\libpython-shared.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build\python.vcxproj]
  C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python\Modules\timemodule.c(724): error C2065: 'daylight
': undeclared identifier [C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python-build\CMakeBuild\libpytho
n\libpython-shared.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build\python.vcxproj]
  C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python\Modules\timemodule.c(726): error C2065: 'tzname':
 undeclared identifier [C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python-build\CMakeBuild\libpython\
libpython-shared.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build\python.vcxproj]
  C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python\Modules\timemodule.c(726): error C2109: subscript
 requires array or pointer type [C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python-build\CMakeBuild\l
ibpython\libpython-shared.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build\python.vcxproj]
  C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python\Modules\timemodule.c(713): error C2065: 'timezone
': undeclared identifier [C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python-build\CMakeBuild\libpytho
n\libpython-shared.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build\python.vcxproj]
  C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python\Modules\timemodule.c(721): error C2065: 'timezone
': undeclared identifier [C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python-build\CMakeBuild\libpytho
n\libpython-shared.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build\python.vcxproj]
  C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python\Modules\timemodule.c(724): error C2065: 'daylight
': undeclared identifier [C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python-build\CMakeBuild\libpytho
n\libpython-shared.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build\python.vcxproj]
  C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python\Modules\timemodule.c(726): error C2065: 'tzname':
 undeclared identifier [C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python-build\CMakeBuild\libpython\
libpython-shared.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build\python.vcxproj]
  C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python\Modules\timemodule.c(726): error C2109: subscript
 requires array or pointer type [C:\Users\Geoff\Desktop\freeorion-sdk\build\python-prefix\src\python-build\CMakeBuild\l
ibpython\libpython-shared.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build\python.vcxproj]


"C:\Users\Geoff\Desktop\freeorion-sdk\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\Geoff\Desktop\freeorion-sdk\build\dist.vcxproj" (default target) (10) ->
"C:\Users\Geoff\Desktop\freeorion-sdk\build\libpng.vcxproj" (default target) (14) ->
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build
 tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please
install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting
 the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\Geoff\Desktop\freeorio
n-sdk\build\libpng-prefix\src\libpng-build\ZERO_CHECK.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build\libpng.vcxpr
oj]
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build
 tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please
install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting
 the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\Geoff\Desktop\freeorio
n-sdk\build\libpng-prefix\src\libpng-build\ZERO_CHECK.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build\libpng.vcxpr
oj]


"C:\Users\Geoff\Desktop\freeorion-sdk\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\Geoff\Desktop\freeorion-sdk\build\dist.vcxproj" (default target) (10) ->
"C:\Users\Geoff\Desktop\freeorion-sdk\build\openal-soft.vcxproj" (default target) (16) ->
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" e
xited with code 1. [C:\Users\Geoff\Desktop\freeorion-sdk\build\openal-soft.vcxproj]


"C:\Users\Geoff\Desktop\freeorion-sdk\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\Geoff\Desktop\freeorion-sdk\build\dist.vcxproj" (default target) (10) ->
"C:\Users\Geoff\Desktop\freeorion-sdk\build\sdl.vcxproj" (default target) (17) ->
  MSVCRT.lib(_ftol3_.obj) : error LNK2019: unresolved external symbol __except1 referenced in function __ftol3_except [
C:\Users\Geoff\Desktop\freeorion-sdk\build\sdl-prefix\src\sdl-build\SDL2.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk
\build\sdl.vcxproj]
  C:\Users\Geoff\Desktop\freeorion-sdk\build\sdl-prefix\src\sdl-build\RelWithDebInfo\SDL2.dll : fatal error LNK1120: 1
unresolved externals [C:\Users\Geoff\Desktop\freeorion-sdk\build\sdl-prefix\src\sdl-build\SDL2.vcxproj] [C:\Users\Geoff
\Desktop\freeorion-sdk\build\sdl.vcxproj]
  MSVCRT.lib(_ftol3_.obj) : error LNK2019: unresolved external symbol __except1 referenced in function __ftol3_except [
C:\Users\Geoff\Desktop\freeorion-sdk\build\sdl-prefix\src\sdl-build\SDL2.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk
\build\sdl.vcxproj]
  C:\Users\Geoff\Desktop\freeorion-sdk\build\sdl-prefix\src\sdl-build\RelWithDebInfo\SDL2.dll : fatal error LNK1120: 1
unresolved externals [C:\Users\Geoff\Desktop\freeorion-sdk\build\sdl-prefix\src\sdl-build\SDL2.vcxproj] [C:\Users\Geoff
\Desktop\freeorion-sdk\build\sdl.vcxproj]

    469 Warning(s)
    17 Error(s)

@adrianbroher
Copy link
Contributor

Do you always delete the build directory or do you reuse it?

@geoffthemedio
Copy link
Member Author

new / separate build directory for each test. Note "build2" and "build" in paths in previous comments.

@adrianbroher
Copy link
Contributor

adrianbroher commented Sep 4, 2016

Okay. Is there anything obvious errornous when rerunning the build without clearing the build2 (VS 2013) directory?

Because the error you posted doesn't ring a bell and maybe the full error log gives more insight to the problem. I'm ignoring the VS 2015 problems for now.

Also it would probably nice to hide some of those noisy warnings so I continue there for now.

@geoffthemedio
Copy link
Member Author

After running the build command twice, I get the same number of errors. Log attached.
repeat_build_log.txt

@adrianbroher
Copy link
Contributor

Could you retry build for VS2015?

Most errors should be gone now and the build spews a lot less warnings and is less verbose in general.

@geoffthemedio
Copy link
Member Author

Seems like I'm getting inconsistent results from repeated attempts, but here's the latest...
second_build_attempt.txt
first_build_attempt.txt
commands.txt

@adrianbroher
Copy link
Contributor

Seems like I'm getting inconsistent results from repeated attempts, but here's the latest...

The 'second build' method was only a way to hide the warnings and other noise from output. Warnings from successfully compiled files isn't shown in a second pass, whereas compile errors are getting displayed in every build. There is no need to try two attempts now anymore with the majority of warnings hidden.

@geoffthemedio
Copy link
Member Author

I meant that completely separate attempts, starting from a fresh empty build directory, produced different results. The first attempt ended with:
previous_first_build_attempt_end.txt

@adrianbroher
Copy link
Contributor

Latest master contains python patches to build on Visual Studio 2015.

@geoffthemedio
Copy link
Member Author

After building in the MSVC 2015 command prompt, I get two errors of the sort

"C:\Users\Geoff\Desktop\freeorion-sdk\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\Geoff\Desktop\freeorion-sdk\build\dist.vcxproj" (default target) (10) ->
"C:\Users\Geoff\Desktop\freeorion-sdk\build\libpng.vcxproj" (default target) (14) ->
(CustomBuild target) -> 
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\Geoff\Desktop\freeorion-sdk\build\libpng-prefix\src\libpng-build\ZERO_CHECK.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build\libpng.vcxproj]
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\Geoff\Desktop\freeorion-sdk\build\libpng-prefix\src\libpng-build\ZERO_CHECK.vcxproj] [C:\Users\Geoff\Desktop\freeorion-sdk\build\libpng.vcxproj]

@adrianbroher
Copy link
Contributor

adrianbroher commented Sep 14, 2016

Updated the libpng dependency. Upstream rewrote their CMake build system and bumped the minimum requirements from 2.4.4 to 2.8.5. Maybe the old version is the cause for picking the wrong toolset but I'm guessing there.

@geoffthemedio
Copy link
Member Author

same 2 errors. libpng

@geoffthemedio
Copy link
Member Author

geoffthemedio commented Sep 15, 2016

echo %PATH%

gives, after replacing ; with newlines

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow
C:\Program Files (x86)\MSBuild\14.0\bin
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools
C:\Windows\Microsoft.NET\Framework\v4.0.30319
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCPackages
C:\Program Files (x86)\HTML Help Workshop
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools
C:\Program Files (x86)\Windows Kits\8.1\bin\x86
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
C:\Program Files (x86)\ActiveState Komodo Edit 8\
C:\Program Files (x86)\Intel\iCLS Client\
C:\Program Files\Intel\iCLS Client\
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Program Files (x86)\Windows Live\Shared
C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
C:\Program Files\Intel\WiFi\bin\
C:\Program Files\Common Files\Intel\WirelessCommon\
C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
C:\Program Files\MATLAB\R2014b\runtime\win64
C:\Program Files\MATLAB\R2014b\bin
C:\Program Files (x86)\Git\cmd
C:\Program Files\TortoiseGit\bin
C:\Program Files (x86)\Bitvise SSH Client
C:\Program Files (x86)\Skype\Phone\
C:\Program Files\Microsoft SQL Server\120\Tools\Binn\ 

I don't see how that matters though, if it's looking for the wrong MSVC toolset (10 instead of 14 / Visual Studio 2010 instead of Visual Studio 2015). The problem isn't that it can't find 14, which presumably could occur if the path wasn't set properly.

In case you're wondering about the SDKs directory,

 Directory of C:\Program Files (x86)\Microsoft SDKs\Windows

2016-06-01  07:32 AM    <DIR>          .
2016-06-01  07:32 AM    <DIR>          ..
2016-06-01  07:32 AM    <DIR>          v10.0A
2016-06-01  07:14 AM    <DIR>          v7.0A
2014-12-30  11:43 PM    <DIR>          v7.1A
2014-12-31  12:07 AM    <DIR>          v8.0
2014-12-31  12:06 AM    <DIR>          v8.0A
2014-12-30  11:43 PM    <DIR>          v8.1
2014-12-31  12:05 AM    <DIR>          v8.1A
               0 File(s)              0 bytes
               9 Dir(s)  26,569,900,032 bytes free

So v10.0A is the newest.

@adrianbroher
Copy link
Contributor

I don't see how that matters though, if it's looking for the wrong MSVC toolset (10 instead of 14). The problem isn't that it can't find 14, which presumably could occur if the path wasn't set properly.

Yeah, but the order in the path determines which msbuild is used and different msbuild versions use different default toolsets.

You can try to run cmake with the explicit toolset version like

cmake -G "Visual Studio 14" -T v140 <path to source here>

on a clean build directory and check if that works.

@geoffthemedio
Copy link
Member Author

Same result with -T v140

@adrianbroher
Copy link
Contributor

adrianbroher commented Sep 15, 2016

What's the current value of the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild VCTargetsPath registry value?

What's the current value of the VCTargetsPath environment variable?

Also which version of CMake do you use? 3.4.3 works for me.

@geoffthemedio
Copy link
Member Author

geoffthemedio commented Sep 15, 2016

Not sure what key you want in the registry...
registry

I don't see a VCTargetsPath variable, but here are a few similar ones:

VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\
VisualStudioVersion=14.0
VS110COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\
VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 14.0\
VSSDK140Install=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VSSDK\

Doing the build in the MSVC 2015 GUI, I got just one project failed, with very similar error messages:

11>         Build started 2016-09-15 8:03:39 PM.
11>         Project "C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng-prefix\src\libpng-build\ALL_BUILD.vcxproj" on node 1 (default targets).
11>         Project "C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng-prefix\src\libpng-build\ALL_BUILD.vcxproj" (1) is building "C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng-prefix\src\libpng-build\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
11>     1>
11>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng-prefix\src\libpng-build\ZERO_CHECK.vcxproj]
11>         Done Building Project "C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng-prefix\src\libpng-build\ZERO_CHECK.vcxproj" (default targets) -- FAILED.
11>         Done Building Project "C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng-prefix\src\libpng-build\ALL_BUILD.vcxproj" (default targets) -- FAILED.
11>
11>         Build FAILED.
11>
11>         "C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng-prefix\src\libpng-build\ALL_BUILD.vcxproj" (default target) (1) ->
11>         "C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng-prefix\src\libpng-build\ZERO_CHECK.vcxproj" (default target) (2) ->
11>         (PlatformPrepareForBuild target) ->
11>     1>
11>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng-prefix\src\libpng-build\ZERO_CHECK.vcxproj]
11>
11>             0 Warning(s)
11>             1 Error(s)
11>
11>         Time Elapsed 00:00:00.23
11>
11>Build FAILED.
11>
11>Time Elapsed 00:00:02.71

Looking into the libpng project files in the path it specifies, they're all set to platform toolset 2015, so I don't know why it's still looking for something from 2010. When I build using the actual libpng solution, it runs without error. Something in the custom build stop in the libpng project in the main generated project perhaps?

The command line reports Cmake version 3.2.2

@adrianbroher
Copy link
Contributor

Can you upload:

C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng.vcxproj
C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng-prefix\src\libpng-build\ZERO_CHECK.vcxproj
C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng-prefix\src\libpng-build\ALL_BUILD.vcxproj
C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng-prefix\src\libpng-build\CMakeFiles\CMakeError.log
C:\Users\Geoff\Desktop\freeorion-sdk\build2\libpng-prefix\src\libpng-build\CMakeFiles\CMakeOutput.log

@geoffthemedio
Copy link
Member Author

build_stuff.zip

@adrianbroher
Copy link
Contributor

You uploaded the filters, not the vcxproj.

@geoffthemedio
Copy link
Member Author

libpng-build.zip

@adrianbroher
Copy link
Contributor

adrianbroher commented Sep 16, 2016

When I build using the actual libpng solution, it runs without error.

Do you just run it or do you select the RelWithDebInfo configuration first? Because that seems to be missing in the project files you uploaded. Maybe CMake 3.2.2 has a subtle bug here. Try if 3.4.3 works.

@geoffthemedio
Copy link
Member Author

geoffthemedio commented Sep 16, 2016

Do I run what? The main SDK project that gives errors, or the projects in the libpng subdirectory that don't?

@adrianbroher
Copy link
Contributor

Do I run what?

Whatever you referenced to with 'the actual libpng solution'. I assume you meant libpng-prefix\src\libpng-build\libpng.sln.

@geoffthemedio
Copy link
Member Author

It just has release and debug configurations. Both build without errors, although it doesn't recompile when I switch between them which makes me thing there's something a bit odd about at least one of them.

@geoffthemedio
Copy link
Member Author

geoffthemedio commented Sep 16, 2016

After installing the newest version of CMake, it builds the SDK. I've unzipped it and run bootstrap.bat. Code downloaded. Opened the 2013 solution in 2015. Building the "Release" configuration. A "Release-XP" was also present unexpectedly.

@Vezzra
Copy link
Member

Vezzra commented Sep 16, 2016

A "Release-XP" was also present unexpectedly.

Maybe you never noticed it, but that has been around since we switched to MSVC 2013. I had to add this build configuration to make builds compatible with XP.

@geoffthemedio
Copy link
Member Author

3 of 7 projects built in MSVC 2015 with the SDK dependencies. One that might be relevant to the SDK is the custom build step in the Common project:

1>------ Build started: Project: Common, Configuration: Release Win32 ------
1>Build started 2016-09-16 4:10:14 PM.
1>     1>
1>InitializeBuildStatus:
1>         Touching "Release\Common.tlog\unsuccessfulbuild".
1>       CustomBuild:
1>         Configuring Version.cpp
1>         Traceback (most recent call last):
1>           File "C:\Users\Geoff\Desktop\FreeOrionSDK_MSVC_2016-09-16\FreeOrion\msvc2013\..\cmake\make_versioncpp.py", line 111, in <module>
1>             if system() == 'Windows':
1>           File "C:\Users\Geoff\Desktop\FreeOrionSDK_MSVC_2016-09-16\FreeOrion\python27.zip\platform.py", line 1263, in system
1>           File "C:\Users\Geoff\Desktop\FreeOrionSDK_MSVC_2016-09-16\FreeOrion\python27.zip\platform.py", line 1159, in uname
1>           File "C:\Users\Geoff\Desktop\FreeOrionSDK_MSVC_2016-09-16\FreeOrion\python27.zip\platform.py", line 635, in win32_ver
1>           File "C:\Users\Geoff\Desktop\FreeOrionSDK_MSVC_2016-09-16\FreeOrion\python27.zip\platform.py", line 569, in _get_real_winver
1>           File "C:\Users\Geoff\Desktop\FreeOrionSDK_MSVC_2016-09-16\FreeOrion\python27.zip\ctypes\__init__.py", line 7, in <module>
1>         ImportError: No module named _ctypes
1>     1>
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1.
1>
1>Build FAILED.

@adrianbroher
Copy link
Contributor

ImportError: No module named _ctypes

Fixed with b02fe47.

Closing this issue as the original intent is addressed. If other issues occur feel free to open another issue.

adrianbroher added a commit that referenced this issue Sep 17, 2016
CMake learned support for Windows 10 SDKs with 3.4 or later.  Earlier
versions generate broken project files as seen in #8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants