You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to compile a simple C++ project using GCC installed via Homebrew on macOS. My goal was to use the latest GCC for my development work, but I encountered an issue with duplicate library flags during the linking phase, which I believe might be a configuration error or a bug.
What happened (include all command output)?
I am experiencing an issue where the ld linker command automatically includes the -lgcc library twice when compiling a C++ project using GCC 13.2.0 installed via Homebrew on macOS. This results in a warning about ignoring duplicate libraries, which I'd like to resolve or understand.
Command Used:
g++ project3.cpp -o project3
The linker command includes -lgcc twice, resulting in a warning: ld: warning: ignoring duplicate libraries: '-lgcc'
Verbose output indicated that -lgcc is being linked twice in the linker command automatically generated by GCC.
Verbose Output
(Including a brief snippet of the verbose output where the duplicate -lgcc is evident) .o -lstdc++ -lemutls_w -lgcc -lSystem -lgcc -no_compact_unwind -rpath
What did you expect to happen?
I expected the linker command not to include duplicate library flags, which should avoid the warning about ignoring duplicate libraries. Ideally, the build process should be clean without such warnings, ensuring that the linker configuration is optimal and error-free.
**Steps to Reproduce**
1. Install GCC via Homebrew using `brew install gcc`.
2. Compile any simple C++ program with `g++ [file].cpp -o [file]`.
3. Observe the linker warning about duplicate `-lgcc` flags.
Other:
**System Information**
- **macOS Version**: Sonoma (Version 14)
- **Homebrew Version**: Homebrew 4.2.19
- **GCC Version**: 13.2.0: g++-13 (Homebrew GCC 13.2.0) 13.2.0
**Additional Information**
- I have checked my environment settings and there are no configurations explicitly adding `-lgcc` multiple times.
- The issue seems to be internal to the way GCC is configured or how it interacts with the system linker.
Thank you for any help or insight you can provide!
The text was updated successfully, but these errors were encountered:
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
I was trying to compile a simple C++ project using GCC installed via Homebrew on macOS. My goal was to use the latest GCC for my development work, but I encountered an issue with duplicate library flags during the linking phase, which I believe might be a configuration error or a bug.
What happened (include all command output)?
I am experiencing an issue where the
ld
linker command automatically includes the-lgcc
library twice when compiling a C++ project using GCC 13.2.0 installed via Homebrew on macOS. This results in a warning about ignoring duplicate libraries, which I'd like to resolve or understand.Command Used:
g++ project3.cpp -o project3
The linker command includes
-lgcc
twice, resulting in a warning:ld: warning: ignoring duplicate libraries: '-lgcc'
Verbose output indicated that -lgcc is being linked twice in the linker command automatically generated by GCC.
Verbose Output
(Including a brief snippet of the verbose output where the duplicate
-lgcc
is evident).o -lstdc++ -lemutls_w -lgcc -lSystem -lgcc -no_compact_unwind -rpath
What did you expect to happen?
I expected the linker command not to include duplicate library flags, which should avoid the warning about ignoring duplicate libraries. Ideally, the build process should be clean without such warnings, ensuring that the linker configuration is optimal and error-free.
Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: