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

Slic3r failed to build with "error C2146: syntax error: missing ')' before identifier 'and'" with MSVC on Windows amd64 #5171

Open
Luan-Novaes opened this issue Sep 18, 2023 · 1 comment

Comments

@Luan-Novaes
Copy link

Describe the bug
Slic3r failed to build with "error C2146: syntax error: missing ')' before identifier 'and'" with MSVC on Windows amd64. It can reproduce on latest version 026c138 on master branch.

Versions and configuration:
OS: Windows 10
VS: Visual Studio 2022(17.7.2)

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/slic3r/Slic3r.git
  2. Open "x64 Native Tools Command Prompt for VS 2022"
  3. mkdir build_x64
  4. cd build_x64
  5. cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.22621.0 -DBOOST_ROOT=F:\tools\boost_1_67_0\x64 -DBOOST_LIBRARYDIR=F:\tools\boost_1_67_0\x64\lib64-msvc-14.1 -DSLIC3R_BUILD_TESTS=ON ../src
  6. msbuild /m /p:Platform=x64 /p:Configuration=Release slic3r.sln /t:Rebuild

Error info:
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(227,23): error C2146: syntax error: missing ')' before identifier 'and' [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(227,23): error C2065: 'and': undeclared identifier [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(227,27): error C2146: syntax error: missing ';' before identifier 'preserve_ordering' [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(227,44): error C2059: syntax error: ')' [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(229,36): error C2065: 'unsortable': undeclared identifier [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(229,9): error C2275: 'Slic3r::ExtrusionEntityCollection': expected an expression instead of a type [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(229,85): error C2059: syntax error: ';' [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(230,25): error C2065: 'unsortable': undeclared identifier [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(231,9): error C2065: 'unsortable': undeclared identifier [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(235,37): error C2065: 'unsortable': undeclared identifier [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(238,17): error C2065: 'unsortable': undeclared identifier [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(241,7): error C2059: syntax error: 'else' [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(241,12): error C2143: syntax error: missing ';' before '{' [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(241,12): error C2447: '{': missing function header (old-style formal list?) [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(276,1): error C2059: syntax error: '}' [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\ExtrusionEntityCollection.cpp(276,1): error C2143: syntax error: missing ';' before '}' [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\GCodeSender.cpp(532,11): error C2039: 'serial_port_service': is not a member of 'boost::asio' [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\GCodeSender.cpp(532,11): error C3083: 'serial_port_service': the symbol to the left of a '::' must be a type [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\GCodeSender.cpp(532,32): error C2039: 'native_handle_type': is not a member of 'boost::asio' [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\GCodeSender.cpp(532,32): error C2065: 'native_handle_type': undeclared identifier [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\GCodeSender.cpp(532,51): error C2146: syntax error: missing ';' before identifier 'handle' [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\GCodeSender.cpp(532,51): error C2065: 'handle': undeclared identifier [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\GCodeSender.cpp(534,28): error C2065: 'handle': undeclared identifier [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]
F:\gitP\Slic3r\xs\src\libslic3r\GCodeSender.cpp(536,28): error C2065: 'handle': undeclared identifier [F:\gitP\Slic3r\build_x64\libslic3r.vcxproj]

112 Warning(s)
24 Error(s)

Error log:
build.log

@trivalik
Copy link

trivalik commented Dec 21, 2023

It is required to use at least the C++11 standard, because of the line if (this->no_sort and preserve_ordering) {

I got it only to run with adding this line in src/CMakeLists.txt:

add_compile_options(-std=c++11)

Use of boost 1.67 does not work anyway. Version 1.63 would work, but fails with this:

C:\local\boost_1_63_0\boost\asio\detail\socket_types.hpp(24,1): error C1189: #error:  WinSock.h has already been included [Slic3r\build_x64\slic3r.vcxproj]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants