utelle/wxchartdir

Installation \wxdemo\build\wxchartdir_vc16.sln

Opened this issue · 7 comments

I am having an issue installing the library.
I am running on VS2019 with Toolset v142 and wxWidgets 3.1.5 build using VS2019. I downloaded the repo using VS2019 Git->Clone option.
When I try Batch Build the whole solution (Select All -> Build) I get 168 failed Namely:

  1. ------ Build started: Project: wxchartviewer, Configuration: Debug x64 ------
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(439,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".
    Done building project "wxchartdir_vc16_chartviewer.vcxproj" -- FAILED.

  2. ------ Build started: Project: wxchartviewer, Configuration: Release Win32 ------
    wxchartviewer.cpp
    C:\Amir\Softwares\wxWidgets\include\msvc\wx\setup.h(140,10): fatal error C1083: Cannot open include file: '../../../lib/vc14x_lib/mswu/wx/setup.h': No such file or directory
    Done building project "wxchartdir_vc16_chartviewer.vcxproj" -- FAILED.

same of every project.

I tried configuring the wx_setup.props but no luck. So if possible someone give me an in detail step-by-step how to to configure this file correctly.

Also I am quite sure the wxWidgets is built _UNICODE,
This is the video I followed installing wxWidgets: https://www.youtube.com/watch?v=FOIbK4bJKS8&t=1135s

I am having an issue installing the library. I am running on VS2019 with Toolset v142 and wxWidgets 3.1.5 build using VS2019. I downloaded the repo using VS2019 Git->Clone option. When I try Batch Build the whole solution (Select All -> Build) I get 168 failed

You seldom will want to build the whole solution. The VC++ solutions coming with wxChartDir support several configurations:

  1. Release/Debug - static lib linking against static wx libraries
  2. Release/Debug wxDLL - static lib linking against dynamic wx DLLs
  3. DLL Release/Debug - dynamic DLL linking against dynamic wx DLLs

Additionally, each configuration can be built for 32-bit or 64-bit architecture.

Which configurations you actually want to build depends on which wxWidgets configurations you have built.

Namely:

1. > ------ Build started: Project: wxchartviewer, Configuration: Debug x64 ------
   > C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(439,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".
   > Done building project "wxchartdir_vc16_chartviewer.vcxproj" -- FAILED.

I have not the slightest idea, how this error message is triggered. The VC++ solutions coming with wxChartDir explicitly set the platform toolset. For Visual Studio 2019 this will be v142. The platform toolset v100 is nowhere referenced in wxChartDir (unless you use wxChartDir 1.0 which had solution files for Visual Studio 2010).

2. > ------ Build started: Project: wxchartviewer, Configuration: Release Win32 ------
   > wxchartviewer.cpp
   > C:\Amir\Softwares\wxWidgets\include\msvc\wx\setup.h(140,10): fatal error C1083: Cannot open include file: '../../../lib/vc14x_lib/mswu/wx/setup.h': No such file or directory
   > Done building project "wxchartdir_vc16_chartviewer.vcxproj" -- FAILED.

This usually indicates that the corresponding wxWidgets configuration was not built. In the above message the compiler is searching for static wxWidgets libraries with 32-bit architecture.

Please verify where your wxWidgets libraries are located. Does the directory C:\Amir\Softwares\wxWidgets\lib\vc14x_lib exist? I suspect that for your wxWidgets build the path looks like C:\Amir\Softwares\wxWidgets\lib\vc142_lib or similar.

I tried configuring the wx_setup.props but no luck. So if possible someone give me an in detail step-by-step how to to configure this file correctly.

Most likely, you will have to adjust the file wx_setup.props to match your wxWidgets build. I suspect that you will have to àdjust the values for wxCompilerPrefix and wxMsvcVersionAbiCompat:

<!-- Select the compiler prefix matching your wxWidgets build -->
<!-- Use following definition to exclude the toolset version in the compiler prefix
<wxCompilerPrefix>vc14x</wxCompilerPrefix>
-->
<!-- Use following definition to include the toolset version in the compiler prefix
-->
<wxCompilerPrefix>vc$(PlatformToolsetVersion)</wxCompilerPrefix>

<!-- Specify an empty value for this variable -->
<wxMsvcVersionAbiCompat></wxMsvcVersionAbiCompat>

Also I am quite sure the wxWidgets is built _UNICODE, This is the video I followed installing wxWidgets: https://www.youtube.com/watch?v=FOIbK4bJKS8&t=1135s

You don't expect me to watch a 44 minute video to find out how you built wxWidgets, do you?

wxWidgets uses Unicode by default. Typically, a release build and a debug build of dynamic wxWidgets libraries resp DLLs is done for the preferred architecture, 32-bit or 64-bit. However, this depends on your requirements.

Check which wxWidgets configurations were built, and build the corresponding configurations of wxChartDir.

You seldom will want to build the whole solution. The VC++ solutions coming with wxChartDir support several configurations:
Release/Debug - static lib linking against static wx libraries
Release/Debug wxDLL - static lib linking against dynamic wx DLLs
DLL Release/Debug - dynamic DLL linking against dynamic wx DLLs
Additionally, each configuration can be built for 32-bit or 64-bit architecture.

So I only what to build not all of them, ok basically I work with Release mode, static libraries and 32-bit architecture.

ease verify where your wxWidgets libraries are located. Does the directory C:\Amir\Softwares\wxWidgets\lib\vc14x_lib exist? I suspect that for your wxWidgets build the path looks like C:\Amir\Softwares\wxWidgets\lib\vc142_lib or similar.

wxWidgets address is C:\Amir\Softwares\wxWidgets\lib\vc_lib and inside it has static .lib files, and 2 folders namely: mswu and mswud

You don't expect me to watch a 44 minute video to find out how you built wxWidgets, do you?

No I don't I was referring how I installed wxWidgets so you can know my configuration and help me to get through. you can just watch from 12:40 to 17:19, you can also skip the part where he laps the VS build process

So I only what to build not all of them,

Right.

ok basically I work with Release mode, static libraries and 32-bit architecture.

In that case you would build the configuration "Release | Win32" and for development "Debug | Win32".

[...] I suspect that for your wxWidgets build the path looks like C:\Amir\Softwares\wxWidgets\lib\vc142_lib or similar.

wxWidgets address is C:\Amir\Softwares\wxWidgets\lib\vc_lib and inside it has static .lib files, and 2 folders namely: mswu and mswud

So, you have a release and a debug build.

To set the right library path, you will have to adjust the variable wxCompilerPrefix (use the value vc); additionally, you have to remove the values from the variables wxMsvcVersionAuto and wxMsvcVersionAbiCompat to select the wxWidgets default settings in wx_setup.props:

<!-- Use following definition to exclude the toolset version in the compiler prefix
-->
<!-- Set compiler prefix to the wxWidgets default -->
<wxCompilerPrefix>vc</wxCompilerPrefix>
<!-- Use following definition to include the toolset version in the compiler prefix
<wxCompilerPrefix>vc$(PlatformToolsetVersion)</wxCompilerPrefix>
-->

<!-- Specify an empty value for the following variables -->
<wxMsvcVersionAuto></wxMsvcVersionAuto>
<wxMsvcVersionAbiCompat></wxMsvcVersionAbiCompat>

Ok adjusting the wx_setup.props removed the failed issue

------ Build started: Project: wxchartviewer, Configuration: Release Win32 ------
wxchartviewer.cpp
C:\Amir\Softwares\wxWidgets\include\msvc\wx\setup.h(140,10): fatal error C1083: Cannot open include file: '../../../lib/vc14x_lib/mswu/wx/setup.h': No such file or directory
Done building project "wxchartdir_vc16_chartviewer.vcxproj" -- FAILED.

and left me with

  1. ------ Build started: Project: wxchartviewer, Configuration: Debug x64 ------
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(439,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".
    Done building project "wxchartdir_vc16_chartviewer.vcxproj" -- FAILED.

<wxRootDir>$(WXWIN)</wxRootDir>
<wxShortVersionString>31</wxShortVersionString>
<wxToolkitPrefix>msw</wxToolkitPrefix>
<!-- Use following definition to exclude the toolset version in the compiler prefix
-->
<wxCompilerPrefix>vc</wxCompilerPrefix>
<!-- Use following definition to include the toolset version in the compiler prefix
<wxCompilerPrefix>vc$(PlatformToolsetVersion)</wxCompilerPrefix>
-->
<wxFlavour></wxFlavour>
<!-- Use following definition to include wxWidgets platform information in library name
<wxFlavour>_$(wxToolkitPrefix)$(wxShortVersionString)u</wxFlavour>
-->
<wxCfg>
</wxCfg>
<wxVendor>custom</wxVendor>
<!-- Uncomment the definition of the user macro wxMsvcVersion, if a compiler-specific prefix should be used -->
<!-- Replace XX by the version symbol used for wxCompilerPrefix, i.e. 'vcXX' -->
<!--
<wxMsvcVersion>XX</wxMsvcVersion>
-->
<!-- Set wxMsvcVersionAuto to any non-empty value, if the compiler-specific prefix should be determined automatically -->
<wxMsvcVersionAuto></wxMsvcVersionAuto>
<wxMsvcVersionAbiCompat></wxMsvcVersionAbiCompat>

this is my wx_setup.props file, I it is correct

[...] and left me with

  1. ------ Build started: Project: wxchartviewer, Configuration: Debug x64 ------
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(439,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".
    Done building project "wxchartdir_vc16_chartviewer.vcxproj" -- FAILED.

Sorry, I have really no idea why you get this error. The project file wxchartdir_vc16_chartviewer.vcxproj explicitly selects the platform toolset as v142 for all configurations like this:

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Win64|x64'" Label="Configuration">
    <ConfigurationType>StaticLibrary</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <CharacterSet>Unicode</CharacterSet>
    <PlatformToolset>v142</PlatformToolset>
  </PropertyGroup>

Make sure that the project file was not accidentally modified.

Additionally, I would recommend that you delete all files generated by Visual Studio in the wxChartDir build directory tree and try a clean rebuild.

Does this error occur also, when you try to build the project by opening the solution file in Visual Studio instead of using MSBuild from the command line?

When invoking MSBuild from the command line you may try to add the command line parameter /p:PlatformToolset=v142.

IMHO your build error MSB8020 has nothing to do with the wxChartDir project. It is most likely a Visual Studio configuration issue on your computer. For example, if you invoke the MSBuild executable of the .Net framework instead of the MSBuild executable of Visual Studio. However, that's just wild guessing.

[...] this is my wx_setup.props file, I it is correct

Your wx_setup.props seems to be ok.

I Apologize, I still have this issue:

------ Build started: Project: wxchartviewer, Configuration: Release Win32 ------
wxchartviewer.cpp
C:\Amir\Softwares\wxWidgets\include\msvc\wx\setup.h(140,10): fatal error C1083: Cannot open include file: '../../../lib/vc14x_lib/mswu/wx/setup.h': No such file or directory
Done building project "wxchartdir_vc16_chartviewer.vcxproj" -- FAILED.

the other one is fixed, sorry just mistakenly copied the quote.

Does this error occur also, when you try to build the project by opening the solution file in Visual Studio instead of using MSBuild from the command line?

Yes I try building using VS Batch Build method not the command line.

Honestly, I just retried starting from scratch and build the library again from VS2019 Batch Build not command line, I somehow worked I got like 60 success and 108 failed (I did not deselect builds like Win64 wxDLL), I tested to run the helloworld project it worked and the wxdemo project is worked too, I will try in my own project tomorrow. Thanks