Unit tests fail to compile under VS 2015

Issue #16 resolved
Josh Hayashida
created an issue

OOLua version 2.0.0

vc++ 14

I came across when trying to convert a vs 2013 project to a vs 2015 project. My OOLua code wasn't working, so I checked the unit tests. I'm not sure what the problem is, but all of the unit tests fail compiling with visual studio 2015. After converting the 2010 sln (which did compile fine) to the newest type, I got a ton of errors mostly coming from OOLUA_PROXY and the macros inside of it. There are too many errors to list here, but here are some example errors from the project test.coverage.shared_by_default:

1>------ Build started: Project: test.coverage.shared_by_default, Configuration: Debug x64 ------ 1> shared_by_default.cpp 1>D:\lib\ccpp\oolua-2.0.0\unit_tests\test_classes\common_cppunit_headers.h(14): fatal error C1083: Cannot open include file: 'cppunit/TestCase.h': No such file or directory 1> main.cpp 1>main.cpp(4): fatal error C1083: Cannot open include file: 'cppunit/CompilerOutputter.h': No such file or directory 1> expose_class_ops.cpp 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(8): warning C4003: not enough actual parameters for macro 'OOLUA_ARG_N' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2065: 'Equal_op': undeclared identifier 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2065: 'Less_op': undeclared identifier 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2065: 'Less_equal_op': undeclared identifier 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2065: 'Add_op': undeclared identifier 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2065: 'Sub_op': undeclared identifier 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2065: 'Mul_op': undeclared identifier 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2065: 'Div_op': undeclared identifier 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2923: 'Type_list': 'Equal_op' is not a valid template type argument for parameter 'T01' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2923: 'Type_list': 'Less_op' is not a valid template type argument for parameter 'T02' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2923: 'Type_list': 'Less_equal_op' is not a valid template type argument for parameter 'T03' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2923: 'Type_list': 'Add_op' is not a valid template type argument for parameter 'T04' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2923: 'Type_list': 'Sub_op' is not a valid template type argument for parameter 'T05' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2923: 'Type_list': 'Mul_op' is not a valid template type argument for parameter 'T06' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2923: 'Type_list': 'Div_op' is not a valid template type argument for parameter 'T07' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2955: 'Type_list': use of class template requires template argument list 1> d:\lib\ccpp\oolua-2.0.0\include\typelist_structs.h(67): note: see declaration of 'Type_list' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2144: syntax error: 'Type_list<T01,T02,T03,T04,T05,T06,T07,T08,T09,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45,T46,T47,T48,T49,T50>::type' should be preceded by ';' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(17): error C2146: syntax error: missing ';' before identifier 'tag_block_check' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(18): warning C4003: not enough actual parameters for macro 'OOLUA_ARG_N' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(18): error C2065: 'geti': undeclared identifier 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(18): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(19): error C2059: syntax error: '}' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_ops.h(19): error C2143: syntax error: missing ';' before '}' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\assert.h(14): error C2143: syntax error: missing ';' before '{' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\assert.h(14): error C2447: '{': missing function header (old-style formal list?) 1>bind_classes\expose_class_ops.cpp(5): warning C4003: not enough actual parameters for macro 'OOLUA_ARG_N' 1>bind_classes\expose_class_ops.cpp(5): error C2065: 'OOLUA_NON_CONST': undeclared identifier 1>bind_classes\expose_class_ops.cpp(5): error C2275: 'Class_ops': illegal use of this type as an expression 1> D:\lib\ccpp\oolua-2.0.0\unit_tests\cpp_classes\cpp_class_ops.h(7): note: see declaration of 'Class_ops' 1>bind_classes\expose_class_ops.cpp(5): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>bind_classes\expose_class_ops.cpp(6): warning C4003: not enough actual parameters for macro 'OOLUA_ARG_N' 1>bind_classes\expose_class_ops.cpp(6): error C2440: 'initializing': cannot convert from 'initializer list' to 'int' 1> bind_classes\expose_class_ops.cpp(6): note: The initializer contains too many elements 1>bind_classes\expose_class_ops.cpp(6): error C2146: syntax error: missing ';' before identifier 'EXPORT_OOLUA_FUNCTIONS_' 1> expose_class_constructors.cpp 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(8): warning C4003: not enough actual parameters for macro 'OOLUA_ARG_N' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(9): error C2143: syntax error: missing ';' before '}' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(9): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(9): error C2059: syntax error: '}' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(13): warning C4003: not enough actual parameters for macro 'OOLUA_ARG_N' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(14): error C2143: syntax error: missing ';' before '}' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(14): error C2059: syntax error: '}' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(16): warning C4003: not enough actual parameters for macro 'OOLUA_ARG_N' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(17): error C2143: syntax error: missing ';' before '}' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(17): error C2059: syntax error: '}' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(20): warning C4003: not enough actual parameters for macro 'OOLUA_ARG_N' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(21): error C2143: syntax error: missing ';' before '}' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(21): error C2059: syntax error: '}' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(24): warning C4003: not enough actual parameters for macro 'OOLUA_ARG_N' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(25): error C2143: syntax error: missing ';' before '}' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_stub_classes.h(25): error C2059: syntax error: '}' 1>d:\lib\ccpp\oolua-2.0.0\include\oolua_version.h(65): error C2143: syntax error: missing ';' before '{' 1>d:\lib\ccpp\oolua-2.0.0\include\oolua_version.h(65): error C2447: '{': missing function header (old-style formal list?) 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(9): warning C4003: not enough actual parameters for macro 'OOLUA_ARG_N' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(12): error C2065: 'No_default_constructor': undeclared identifier 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(12): error C2923: 'Type_list': 'No_default_constructor' is not a valid template type argument for parameter 'T01' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(12): error C2955: 'Type_list': use of class template requires template argument list 1> d:\lib\ccpp\oolua-2.0.0\include\typelist_structs.h(67): note: see declaration of 'Type_list' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(12): error C2144: syntax error: 'Type_list<T01,T02,T03,T04,T05,T06,T07,T08,T09,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45,T46,T47,T48,T49,T50>::type' should be preceded by ';' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(12): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(12): error C2146: syntax error: missing ';' before identifier 'tag_block_check' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): warning C4003: not enough actual parameters for macro 'OOLUA_ARG_N' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): error C2059: syntax error: '&&' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): error C2065: 'calling_lua_state': undeclared identifier 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): error C2923: 'TYPELIST::IndexOf': 'calling_lua_state' is not a valid template type argument for parameter 'Type' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): error C2955: 'TYPELIST::IndexOf': use of class template requires template argument list 1> d:\lib\ccpp\oolua-2.0.0\include\type_list.h(101): note: see declaration of 'TYPELIST::IndexOf' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): error C2027: use of undefined type 'TYPELIST::IndexOf' 1> d:\lib\ccpp\oolua-2.0.0\include\type_list.h(101): note: see declaration of 'TYPELIST::IndexOf' 1> d:\lib\ccpp\oolua-2.0.0\include\type_list.h(101): note: see declaration of 'TYPELIST::IndexOf' 1> d:\lib\ccpp\oolua-2.0.0\include\type_list.h(101): note: see declaration of 'TYPELIST::IndexOf' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): error C2143: syntax error: missing ';' before '{' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): error C2653: 'INTERNAL': is not a class or namespace name 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): error C2065: 'Constructor': undeclared identifier 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): error C2275: 'class_': illegal use of this type as an expression 1> d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(12): note: see declaration of 'class_' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): error C2146: syntax error: missing ')' before identifier 'VA_' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): error C2062: type 'bool' unexpected 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): error C2039: 'construct': is not a member of '`global namespace'' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): error C2059: syntax error: ')' 1> d:\lib\ccpp\oolua-2.0.0\include\type_list.h(101): note: see declaration of 'TYPELIST::IndexOf' 1> d:\lib\ccpp\oolua-2.0.0\include\type_list.h(101): note: see declaration of 'TYPELIST::IndexOf' 1> d:\lib\ccpp\oolua-2.0.0\include\type_list.h(101): note: see declaration of 'TYPELIST::IndexOf' 1> d:\lib\ccpp\oolua-2.0.0\include\type_list.h(101): note: see declaration of 'TYPELIST::IndexOf' 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): warning C4390: ';': empty controlled statement found; is this the intent? 1>d:\lib\ccpp\oolua-2.0.0\unit_tests\bind_classes\expose_class_constructors.h(25): fatal error C1903: unable to recover from previous error(s); stopping compilation 1> INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe'

Comments (5)

  1. Liam Devine repo owner

    Josh thanks for reporting this. I will be honest and say I have installed vs2015 yet have not compiled CppUnit or GMock with the compiler, therefore have not tested the code with it. However, there is one addition that would probably be required, due to the MS' CPP being broken [1].

    I will personally have a look at this when I have had a chance to compile the test dependencies and will also check to ensure their are no new warnings with the compiler.

    [1] https://bitbucket.org/liamdevine/oolua/src/f213c2c294488221ca5a42a46ef4ca10a593acc2/include/dsl_va_args.h?at=default#dsl_va_args.h-140

  2. Log in to comment