openFrameworks
openFrameworks copied to clipboard
[MSVC][std:c++latest] openFrameworks failed to build on MSVC
Hi All,
The MSVC team recently added openFrameworks as part of RWC testing to detect compiler regressions. And we found some errors when building openFrameworks with '/std:c++latest'. Could you please help look at this issue or provide some workarounds? Thanks in advance.
Repro steps:
1. git clone https://github.com/openframeworks/openFrameworks F:\gitP\openframeworks\openFrameworks
2. mkdir F:\gitP\openframeworks\openFrameworks\build_amd64
3. cd F:\gitP\openframeworks\openFrameworks\build_amd64
4. set _CL_= /std:c++latest
5. msbuild /m /p:Platform=x64 /p:Configuration=Release ../libs/openFrameworksCompiled/project/vs/openframeworksLib.vcxproj /t:Rebuild /p:OutDir=F:\gitP\openframeworks\openFrameworks\build_amd64 /p:PlatformToolset=v142
Build log: build.log
Error info:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3313,22): error C2757: 'filesystem': a symbol with this name already exists and therefore this name cannot be used as a namespace name (compiling source file ..\..\..\openFrameworks\3d\ofCamera.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3318,36): error C2039: '_File_time_clock': is not a member of 'boost::filesystem' (compiling source file ..\..\..\openFrameworks\3d\ofCamera.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3318,52): error C2061: syntax error: identifier '_File_time_clock' (compiling source file ..\..\..\openFrameworks\3d\ofCamera.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3313,22): error C2757: 'filesystem': a symbol with this name already exists and therefore this name cannot be used as a namespace name (compiling source file ..\..\..\openFrameworks\app\ofMainLoop.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,34): error C2065: 'file_clock': undeclared identifier (compiling source file ..\..\..\openFrameworks\3d\ofCamera.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3318,36): error C2039: '_File_time_clock': is not a member of 'boost::filesystem' (compiling source file ..\..\..\openFrameworks\app\ofMainLoop.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,23): error C2923: 'std::chrono::time_point': 'file_clock' is not a valid template type argument for parameter '_Clock' (compiling source file ..\..\..\openFrameworks\3d\ofCamera.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3318,52): error C2061: syntax error: identifier '_File_time_clock' (compiling source file ..\..\..\openFrameworks\app\ofMainLoop.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,34): error C2065: 'file_clock': undeclared identifier (compiling source file ..\..\..\openFrameworks\app\ofMainLoop.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,11): error C2955: 'std::chrono::time_point': use of class template requires template argument list (compiling source file ..\..\..\openFrameworks\3d\ofCamera.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,23): error C2923: 'std::chrono::time_point': 'file_clock' is not a valid template type argument for parameter '_Clock' (compiling source file ..\..\..\openFrameworks\app\ofMainLoop.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,34): error C3861: 'file_clock': identifier not found (compiling source file ..\..\..\openFrameworks\3d\ofCamera.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3326,22): error C2757: 'filesystem': a symbol with this name already exists and therefore this name cannot be used as a namespace name (compiling source file ..\..\..\openFrameworks\3d\ofCamera.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,11): error C2955: 'std::chrono::time_point': use of class template requires template argument list (compiling source file ..\..\..\openFrameworks\app\ofMainLoop.cpp)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,34): error C3861: 'file_clock': identifier not found (compiling source file ..\..\..\openFrameworks\app\ofMainLoop.cpp)
Yeah C++17 or C++latest needs some code that handles file system changed and removal of Boost Dependency for VS There is a define however it needed a revision
You will find these code changes in the Android Update PR https://github.com/openframeworks/openFrameworks/pull/6767/files#diff-553ddc8ef14f451e89ac9abca3bdedbf3c615739b119491d992b41cbed6e357d
On Mon, 17 Jan 2022 at 17:52, xiaoxiao-Xu @.***> wrote:
Hi All,
The MSVC team recently added openFrameworks as part of RWC testing to detect compiler regressions. And we found some errors when building openFrameworks with '/std:c++latest'. Could you please help look at this issue or provide some workarounds? Thanks in advance.
Repro steps:
- git clone https://github.com/openframeworks/openFrameworks F:\gitP\openframeworks\openFrameworks
- mkdir F:\gitP\openframeworks\openFrameworks\build_amd64
- cd F:\gitP\openframeworks\openFrameworks\build_amd64
- set CL= /std:c++latest
- msbuild /m /p:Platform=x64 /p:Configuration=Release ../libs/openFrameworksCompiled/project/vs/openframeworksLib.vcxproj /t:Rebuild /p:OutDir=F:\gitP\openframeworks\openFrameworks\build_amd64 /p:PlatformToolset=v142
Build log: build.log https://github.com/openframeworks/openFrameworks/files/7879609/build.log
Error info:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3313,22): error C2757: 'filesystem': a symbol with this name already exists and therefore this name cannot be used as a namespace name (compiling source file ......\openFrameworks\3d\ofCamera.cpp) C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3318,36): error C2039: '_File_time_clock': is not a member of 'boost::filesystem' (compiling source file ......\openFrameworks\3d\ofCamera.cpp) C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3318,52): error C2061: syntax error: identifier '_File_time_clock' (compiling source file ......\openFrameworks\3d\ofCamera.cpp) C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3313,22): error C2757: 'filesystem': a symbol with this name already exists and therefore this name cannot be used as a namespace name (compiling source file ......\openFrameworks\app\ofMainLoop.cpp) C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,34): error C2065: 'file_clock': undeclared identifier (compiling source file ......\openFrameworks\3d\ofCamera.cpp) C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3318,36): error C2039: '_File_time_clock': is not a member of 'boost::filesystem' (compiling source file ......\openFrameworks\app\ofMainLoop.cpp) C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,23): error C2923: 'std::chrono::time_point': 'file_clock' is not a valid template type argument for parameter '_Clock' (compiling source file ......\openFrameworks\3d\ofCamera.cpp) C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3318,52): error C2061: syntax error: identifier '_File_time_clock' (compiling source file ......\openFrameworks\app\ofMainLoop.cpp) C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,34): error C2065: 'file_clock': undeclared identifier (compiling source file ......\openFrameworks\app\ofMainLoop.cpp) C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,11): error C2955: 'std::chrono::time_point': use of class template requires template argument list (compiling source file ......\openFrameworks\3d\ofCamera.cpp) C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,23): error C2923: 'std::chrono::time_point': 'file_clock' is not a valid template type argument for parameter '_Clock' (compiling source file ......\openFrameworks\app\ofMainLoop.cpp) C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,34): error C3861: 'file_clock': identifier not found (compiling source file ......\openFrameworks\3d\ofCamera.cpp) C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3326,22): error C2757: 'filesystem': a symbol with this name already exists and therefore this name cannot be used as a namespace name (compiling source file ......\openFrameworks\3d\ofCamera.cpp) C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,11): error C2955: 'std::chrono::time_point': use of class template requires template argument list (compiling source file ......\openFrameworks\app\ofMainLoop.cpp) C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\chrono(3321,34): error C3861: 'file_clock': identifier not found (compiling source file ......\openFrameworks\app\ofMainLoop.cpp)
— Reply to this email directly, view it on GitHub https://github.com/openframeworks/openFrameworks/issues/6832, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGK2HBBM5AVQB6T24XEKVTUWO4ELANCNFSM5MD4CP4A . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Thanks for your response! BTW, when will this PR be merged to master branch?
related #6585
also see #6844 which should be merged soon. c++17 and filesystem should all be good in that branch.
Will see if I can reproduce with the steps you listed or see if it is fixed. Thanks!