Building Using Visual Studio 2015

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
rsb
I live to help wx-kind
I live to help wx-kind
Posts: 170
Joined: Fri May 29, 2015 7:26 pm

Building Using Visual Studio 2015

Post by rsb »

Hello,

I'm getting compile errors building version 3.0.2 with Visual Studio 2015 on Windows 7.

C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration

Anyway to get around this error?

Thanks.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: Building Using Visual Studio 2015

Post by PB »

This has been long fixed in the master as well as in the 3.0 branch so you either need to update your wxWidgets or apply the fixes manually:
https://github.com/wxWidgets/wxWidgets/ ... 6aaf3063fc
https://github.com/wxWidgets/wxWidgets/ ... 83d2e1eb69
rsb
I live to help wx-kind
I live to help wx-kind
Posts: 170
Joined: Fri May 29, 2015 7:26 pm

Re: Building Using Visual Studio 2015

Post by rsb »

Thank you, that worked.

Do you have any documentation for building using CMake.

I had no problems building our application using CMake with Visual Studio 2010 but
now with Visual Studio 2015, it tells me it could not create named generator Visual
Studio 2015 Win64.

Thanks.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: Building Using Visual Studio 2015

Post by PB »

Disclaimer: I have only started playing with CMake just this week.

I have compiled wxWidgets master branch head with MSVC 2015 (Express for Desktop) in 64-bit mode with
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat"
set VisualStudioVersion=14.0

cd %WXWIN%\build\MSW

nmake -f makefile.vc BUILD=debug COMPILER_PREFIX=vc14_x64
Please notice that I am using a custom COMPILER_PREFIX as have MSVC 2008 libs in my vc_* folders and MSVC 2015 x86 libs in vc14_* folders.

When I tried to create a project for my library with CMake-GUI 3.7.2 for "Visual Studio 14 2015 Win64" I also ended up with an error:
The C compiler identification is MSVC 19.0.24210.0
The CXX compiler identification is MSVC 19.0.24210.0
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES
wxWidgets_INCLUDE_DIRS)
Call Stack (most recent call first):
C:/Program Files (x86)/CMake/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files (x86)/CMake/share/cmake-3.7/Modules/FindwxWidgets.cmake:929 (find_package_handle_standard_args)
CMakeLists.txt:10 (find_package)


Configuring incomplete, errors occurred!
See also "C:/Dev/Desktop/wxAutoExcel-build-vc14x64/CMakeFiles/CMakeOutput.log".
From the error message it seemed obvious that CMake could not find wxWidgets which is understandable as I used a custom folder name for the libraries. So what I needed to make it work was to change the wxWidgets_LIBRARY_FOLDER variable in the CMake-GUI to my actual wxWidgets library folder.

Perhaps you need to do something similar, the error message (and log) provided by CMake should give you a hint.
Post Reply