Did anybody successfully use C++ import std; on a mac with G++-15 and cmake 4.2.3 ?
I got as far as a linker error missing std module init and am too much of a cmake newbie to figure out anything working.
Did anybody successfully use C++ import std; on a mac with G++-15 and cmake 4.2.3 ?
I got as far as a linker error missing std module init and am too much of a cmake newbie to figure out anything working.
Maybe just libstdc++ dev not yet installed?
@hiddenalpha with brew it seems to come already with gcc. however, the bmi for the standard library is generated. I am as far as i got the last time when trying this. Import std worked then, when std.cc compiled together with my main.cpp but I couldn't figure out how to link the libstc++ then successfully.
Hmm. I think as soon its installed it should be included in the linker flags by default?
Usually I only use C99 (no C++). And I'm on devuan with apt. For this, among `gcc`, I have to also install `libc6-dev` (i guess `libc++-dev` for C++?)
Maybe somewhere is `--nostdlib`, `--nolibc` `--nostdlibc++` or similar, which would explicitly exclude stdlib while linking?
Overall my experience with C++ and also cmake is limitted 🙃 Guess have to wait for someone else to help.
Had another thought:
As you mentioned cmake: What about invoking gcc directly? Can it find the lib this way?
g++ -o main.out -Wall -Werror -pedantic main.cc
if so, then likely the issue is with cmake.
@hiddenalpha i tried that some time ago
it worked when also passing std.cc directly to the compiler with the main.cpp but failed linking otherwise when compiling just main.cpp.
then the recommendation was to use cmake instead. do i tried it now and which seems to fail for the same reason.