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

Windows Build Error #37

Closed
Antosik opened this issue May 6, 2017 · 6 comments
Closed

Windows Build Error #37

Antosik opened this issue May 6, 2017 · 6 comments

Comments

@Antosik
Copy link

Antosik commented May 6, 2017

Hello!

Can't build oppai for Windows.
Got this ↓

7ef3a8795a 1

P.S. Sorry for Russian VS D:

@omkelderman
Copy link
Contributor

I get

C:\Users\Olle\git\oppai\win>build.bat
A subdirectory or file ..\build already exists.
Could Not Find C:\Users\Olle\git\oppai\build\oppai.exe
Could Not Find C:\Users\Olle\git\oppai\build\oppai.obj
main.cc
c:\users\olle\git\oppai\diff_calc.cc(56): error C2220: warning treated as error
- no 'object' file generated
c:\users\olle\git\oppai\diff_calc.cc(56): warning C4458: declaration of 'ctx' hi
des class member
c:\users\olle\git\oppai\diff_calc.cc(56): note: to simplify migration, consider
the temporary use of /Wv:18 flag with the version of the compiler with which you
 used to build without warnings
c:\users\olle\git\oppai\diff_calc.cc(37): note: see declaration of 'd_obj::ctx'

to have an english version 😛 (altho I dont have the long error messages for some reason.. 🤷‍♂️)

@Francesco149
Copy link
Owner

interesting how newer versions of msvc warn about this while older ones don't.

can you edit build.bat and add -wd4458 to the compiler flags and see if it works?

using -Wv:18 is not an option unless there's no other way because it doesn't work on older msvc versions that didn't have it

@Antosik
Copy link
Author

Antosik commented May 6, 2017

after added -wd4458 VS2015 builds fine, VS2017 doesn't work (same error)

@Francesco149
Copy link
Owner

pushed an update that fixes the std::algorithm type warning... freakin templates.

see if it works now

@Francesco149
Copy link
Owner

Francesco149 commented May 6, 2017

btw, the reason for that template warning is that stdlib's tolower/toupper return int and std::transform wants a function that returns char

and apparently, those return int because:

tolower is an ancient function inherited from 1970's-era C, before function signatures reliably existed
and before people really cared about different integer types for expressions.

I was aware of the implicit int return type, but I didn't know these funcs were that old

current solution is wrapping them in a fucntion that returns char, I'm not sure why I didn't use std::toupper, but uh, for now I'll use the wrapper functions as there might be a reason I didn't use the std variant that I can't remember

@Francesco149
Copy link
Owner

closing this since there has been no answer, reponen if you still have issues with vs2017+

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

3 participants