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

[Bug]: Cant compile app on windows with MinGW that use Absl::Flags target. #1657

Open
Fireshtorm1k opened this issue Apr 18, 2024 · 0 comments

Comments

@Fireshtorm1k
Copy link

Fireshtorm1k commented Apr 18, 2024

Describe the issue

Absl::Flags and other targets contains flag -ignore:4221 that MinGW compiler dont recognize

Steps to reproduce the problem

Build Abseil, install it.
Create any app:
in example create file main.cpp containing this

#include <iostream>

int main()
{
    return 0;
}

and CMakeLists.txt

cmake_minimum_required(VERSION 3.13)

project("AbseilTest")

find_package(absl CONFIG REQUIRED)

add_executable(TestMinGW main.cpp)

target_link_libraries(TestMinGW absl::flags)

Try compiling with

cmake -G "Ninja" -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc .

And we getting result

G:\AbseilTest>cmake --build .
CMake is re-running because G:/AbseilTest/CMakeFiles/generate.stamp is out-of-date.
  the file 'G:/AbseilTest/CMakeFiles/3.29.0/CMakeCCompiler.cmake'
  is newer than 'G:/AbseilTest/CMakeFiles/generate.stamp.depend'
  result='-1'
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: G:/AbseilTest
[2/2] Linking CXX executable TestMinGW.exe
FAILED: TestMinGW.exe
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\mingw64\bin\g++.exe   CMakeFiles/TestMinGW.dir/main.cpp.obj -o TestMinGW.exe -Wl,--out-implib,libTestMinGW.dll.a -Wl,--major-image-version,0,--minor-image-version,0  "C:/Program Files (x86)/absl/lib/absl_flags_internal.lib"  "C:/Program Files (x86)/absl/lib/absl_flags_marshalling.lib"  "C:/Program Files (x86)/absl/lib/absl_flags_reflection.lib"  "C:/Program Files (x86)/absl/lib/absl_flags_config.lib"  "C:/Program Files (x86)/absl/lib/absl_flags_program_name.lib"  "C:/Program Files (x86)/absl/lib/absl_flags_private_handle_accessor.lib"  "C:/Program Files (x86)/absl/lib/absl_flags_commandlineflag.lib"  "C:/Program Files (x86)/absl/lib/absl_flags_commandlineflag_internal.lib"  "C:/Program Files (x86)/absl/lib/absl_cord.lib"  "C:/Program Files (x86)/absl/lib/absl_cordz_info.lib"  "C:/Program Files (x86)/absl/lib/absl_cord_internal.lib"  "C:/Program Files (x86)/absl/lib/absl_cordz_functions.lib"  "C:/Program Files (x86)/absl/lib/absl_cordz_handle.lib"  "C:/Program Files (x86)/absl/lib/absl_crc_cord_state.lib"  "C:/Program Files (x86)/absl/lib/absl_crc32c.lib"  "C:/Program Files (x86)/absl/lib/absl_str_format_internal.lib"  "C:/Program Files (x86)/absl/lib/absl_crc_internal.lib"  "C:/Program Files (x86)/absl/lib/absl_crc_cpu_detect.lib"  "C:/Program Files (x86)/absl/lib/absl_raw_hash_set.lib"  "C:/Program Files (x86)/absl/lib/absl_hash.lib"  "C:/Program Files (x86)/absl/lib/absl_bad_optional_access.lib"  "C:/Program Files (x86)/absl/lib/absl_city.lib"  "C:/Program Files (x86)/absl/lib/absl_bad_variant_access.lib"  "C:/Program Files (x86)/absl/lib/absl_low_level_hash.lib"  "C:/Program Files (x86)/absl/lib/absl_hashtablez_sampler.lib"  "C:/Program Files (x86)/absl/lib/absl_exponential_biased.lib"  "C:/Program Files (x86)/absl/lib/absl_synchronization.lib"  "C:/Program Files (x86)/absl/lib/absl_graphcycles_internal.lib"  "C:/Program Files (x86)/absl/lib/absl_kernel_timeout_internal.lib"  "C:/Program Files (x86)/absl/lib/absl_stacktrace.lib"  "C:/Program Files (x86)/absl/lib/absl_symbolize.lib"  "C:/Program Files (x86)/absl/lib/absl_malloc_internal.lib"  "C:/Program Files (x86)/absl/lib/absl_debugging_internal.lib"  "C:/Program Files (x86)/absl/lib/absl_demangle_internal.lib"  "C:/Program Files (x86)/absl/lib/absl_time.lib"  "C:/Program Files (x86)/absl/lib/absl_civil_time.lib"  "C:/Program Files (x86)/absl/lib/absl_time_zone.lib"  "C:/Program Files (x86)/absl/lib/absl_strings.lib"  "C:/Program Files (x86)/absl/lib/absl_strings_internal.lib"  "C:/Program Files (x86)/absl/lib/absl_string_view.lib"  "C:/Program Files (x86)/absl/lib/absl_base.lib"  -lpthread  "C:/Program Files (x86)/absl/lib/absl_spinlock_wait.lib"  "C:/Program Files (x86)/absl/lib/absl_int128.lib"  "C:/Program Files (x86)/absl/lib/absl_throw_delegate.lib"  "C:/Program Files (x86)/absl/lib/absl_raw_logging_internal.lib"  "C:/Program Files (x86)/absl/lib/absl_log_severity.lib"  -ignore:4221  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
g++.exe: error: unrecognized command-line option '-ignore:4221'
ninja: build stopped: subcommand failed.

What version of Abseil are you using?

0908376

What operating system and version are you using?

Windows 11 Pro 23H2

What compiler and version are you using?

gcc version 13.2.0

What build system are you using?

ninja 1.12.0

Additional context

No response

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