Closed rgrymin closed 5 years ago
What is the windows version? Is it 64 bits?
yes, I already created a patch. I will provide pull request
suggested change is in Pull Request:
FIX: Hippomock does not work properly with g++ (MinGW) on Windows #103 https://github.com/dascandy/hippomocks/pull/103
Pull request merged, closing. Thanks!
During compilation on Windows (CLion+MinGW(g++)) we can see problem:
In file included from C:\Users\msmigielski\CLion workspace\testing_catch2\tests.cpp:14:0: C:\Users\msmigielski\CLion workspace\testing_catch2\hippomocks.h:204:46: error: expected initializer before 'VirtualProtect' extern "C" __declspec(dllimport) int WINCALL VirtualProtect(void func, unsigned long byteCount, unsigned long flags, unsigned long oldFlags); ^
~~~~~ C:\Users\msmigielski\CLion workspace\testing_catch2\hippomocks.h: In constructor 'HippoMocks::Unprotect::Unprotect(void*, size_t)': C:\Users\msmigielski\CLion workspace\testing_catch2\hippomocks.h:222:73: error: 'VirtualProtect' was not declared in this scope VirtualProtect(origFunc, byteCount, PAGE_EXECUTE_READWRITE, &oldprotect); ^ C:\Users\msmigielski\CLion workspace\testing_catch2\hippomocks.h: In destructor 'HippoMocks::Unprotect::~Unprotect()': C:\Users\msmigielski\CLion workspace\testing_catch2\hippomocks.h:227:59: error: 'VirtualProtect' was not declared in this scope VirtualProtect(origFunc, byteCount, oldprotect, &dontcare); ^ mingw32-make.exe[3]: [CMakeFiles/testing_catch2.dir/tests.cpp.obj] Error 1 CMakeFiles\testing_catch2.dir\build.make:87: recipe for target 'CMakeFiles/testing_catch2.dir/tests.cpp.obj' failed CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/testing_catch2.dir/all' failed CMakeFiles\Makefile2:78: recipe for target 'CMakeFiles/testing_catch2.dir/rule' failed Makefile:117: recipe for target 'testing_catch2' failed mingw32-make.exe[2]: [CMakeFiles/testing_catch2.dir/all] Error 2 mingw32-make.exe[1]: [CMakeFiles/testing_catch2.dir/rule] Error 2 mingw32-make.exe: [testing_catch2] Error 2