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

Weird errors in v1.4 #475

Open
patlecat opened this issue Jun 1, 2020 · 4 comments
Open

Weird errors in v1.4 #475

patlecat opened this issue Jun 1, 2020 · 4 comments
Assignees

Comments

@patlecat
Copy link

patlecat commented Jun 1, 2020

I installed the lib via vcpkg where it didn't throw any errors. But when I execute the example code from you I get 16 errors (s. below).

  • I use msvc2019 with Win10, x64, C++17
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(65,61): Error C2146: syntax error: missing ')' before identifier 'lval' (compiling source file manage_mailcow.cpp)
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(65,61): Error C2365: 'NumberL': redefinition; previous definition was 'template parameter' (compiling source file manage_mailcow.cpp)
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(65,61): Error C2061: syntax error: identifier 'lval' (compiling source file manage_mailcow.cpp)
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(65,61): Error C2059: syntax error: ')' (compiling source file manage_mailcow.cpp)
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(65,61): Error C2146: syntax error: missing ')' before identifier 'rval' (compiling source file manage_mailcow.cpp)
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(65,61): Error C2146: syntax error: missing ';' before identifier 'rval' (compiling source file manage_mailcow.cpp)
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(66,1): Error C2143: syntax error: missing ';' before '{' (compiling source file manage_mailcow.cpp)
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(66,1): Error C2447: '{': missing function header (old-style formal list?) (compiling source file manage_mailcow.cpp)
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(74,61): Error C2146: syntax error: missing ')' before identifier 'lval' (compiling source file manage_mailcow.cpp)
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(74,61): Error C2365: 'NumberL': redefinition; previous definition was 'template parameter' (compiling source file manage_mailcow.cpp)
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(74,61): Error C2061: syntax error: identifier 'lval' (compiling source file manage_mailcow.cpp)
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(74,61): Error C2059: syntax error: ')' (compiling source file manage_mailcow.cpp)
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(74,61): Error C2146: syntax error: missing ')' before identifier 'rval' (compiling source file manage_mailcow.cpp)
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(74,61): Error C2146: syntax error: missing ';' before identifier 'rval' (compiling source file manage_mailcow.cpp)
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(75,1): Error C2143: syntax error: missing ';' before '{' (compiling source file manage_mailcow.cpp)
0>D:\vcpkg\installed\x64-windows\include\xlnt\utils\numeric.hpp(75,1): Error C2447: '{': missing function header (old-style formal list?) (compiling source file manage_mailcow.cpp)
@mateusz-talma
Copy link

If you using WinAPI you can have problem with macros "min" and "max". Try use:

#undef min
#undef max

before include xlnt header

@patlecat
Copy link
Author

patlecat commented Jun 1, 2020

Yeah that did the trick, but it's not feeling secure since min or max macros could be defined in any library. Can't you prefix them with something and just detect if msvc is used?

@tfussell
Copy link
Owner

tfussell commented Jun 9, 2020

This has bitten several people already so I'll try to come up with a better solution such as adding a prefix.

@tfussell tfussell self-assigned this Jun 9, 2020
@eurake
Copy link

eurake commented Jan 31, 2021

If you using WinAPI you can have problem with macros "min" and "max". Try use:

#undef min
#undef max

before include xlnt header

good job

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

4 participants