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

Compilation error on Windows with MinGW #933

Open
mustafa-gokce opened this issue Apr 24, 2024 · 0 comments
Open

Compilation error on Windows with MinGW #933

mustafa-gokce opened this issue Apr 24, 2024 · 0 comments

Comments

@mustafa-gokce
Copy link

mustafa-gokce commented Apr 24, 2024

I am trying to build the project (1.3.0-latest) under the Windows with MinGW (C++ 17).
It throws error such as CMake not found an option "-z" and also compilation error as "undefined reference to `__stack_chk_fail'" on many source files.
For a workaround I am patching

add_compiler_flags(4.6 "-Wl,-z,defs")
through
add_compiler_flags(4.6 "-Wl,-z,relro")
by commenting those lines out and also commenting the line
add_compiler_flags(4.6 "-fstack-protector-strong")
to get rid of undefined reference errors.
The project compiles fine with this but I am not sure it is a good idea to remove those lines.
Just for the heads up...

EDIT-1,
It may be relevant that I'm including the oatpp to my project like:

# add dependency library to project library
add_subdirectory(dep/oatpp)
target_link_libraries(${project_name}-lib oatpp)

EDIT-2,
I am experiencing some issues with build types too.
It seems like building in debug mode and release mode outputs similar binary size on executable around 30-40MB (on 1.3.0-latest) which I was building the project in release mode around 1-2MB (on 1.3.0).
Root cause is lines:

add_compiler_flags(4.6 "-g3")
and
add_compiler_flags(10 "-g3")

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

1 participant