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

[dis]engage_platform declarations mismatch with mingw crosscompiler #2212

Closed
mbeniamino opened this issue Apr 13, 2021 · 1 comment
Closed

Comments

@mbeniamino
Copy link
Contributor

Describe the bug
Using catch.hpp with mingw crosscompiler leads to compilation errors:

In file included from main.cpp:4:
single_include/catch2/catch.hpp:10755:5: error: no declaration matches ‘int Catch::FatalConditionHandler::engage_platform()’
10755 |     FatalConditionHandler::engage_platform() {}
      |     ^~~~~~~~~~~~~~~~~~~~~
In file included from main.cpp:4:
single_include/catch2/catch.hpp:8007:14: note: candidate is: ‘void Catch::FatalConditionHandler::engage_platform()’
 8007 |         void engage_platform();
      |              ^~~~~~~~~~~~~~~
single_include/catch2/catch.hpp:8001:11: note: ‘class Catch::FatalConditionHandler’ defined here
 8001 |     class FatalConditionHandler {
      |           ^~~~~~~~~~~~~~~~~~~~~
In file included from main.cpp:4:
single_include/catch2/catch.hpp:10756:5: error: no declaration matches ‘int Catch::FatalConditionHandler::disengage_platform()’
10756 |     FatalConditionHandler::disengage_platform() {}
      |     ^~~~~~~~~~~~~~~~~~~~~
In file included from main.cpp:4:
single_include/catch2/catch.hpp:8008:14: note: candidate is: ‘void Catch::FatalConditionHandler::disengage_platform()’
 8008 |         void disengage_platform();
      |              ^~~~~~~~~~~~~~~~~~
single_include/catch2/catch.hpp:8001:11: note: ‘class Catch::FatalConditionHandler’ defined here
 8001 |     class FatalConditionHandler {
      |           ^~~~~~~~~~~~~~~~~~~~~
main.cpp:6:5: error: redefinition of ‘int main(int, char**)’
    6 | int main(int argc, char* argv[]) {
      |     ^~~~
In file included from main.cpp:4:
single_include/catch2/catch.hpp:17502:5: note: ‘int main(int, char**)’ previously defined here
17502 | int main (int argc, char * argv[]) {
      |     ^~~~

Expected behavior
The program compiles without errors.

Reproduction steps
Basically it happens when neither windows exceptions nor posix signals are handled. Program to reproduce the bug even with standard g++:

#define CATCH_CONFIG_MAIN
#define CATCH_CONFIG_NO_WINDOWS_SEH
#define CATCH_CONFIG_NO_POSIX_SIGNALS
#include <catch2/catch.hpp>

int main(int argc, char* argv[]) {
    return 0;
}

Platform information:

  • OS: Arch Linux
  • Compiler+version: x86_64-w64-mingw32-g++ (GCC) 10.1.0
  • Catch version: v2.13.5

Additional context
A PR will follow in few minutes.

@horenmar
Copy link
Member

🤦 Thanks.

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

No branches or pull requests

2 participants