I try to compile gcc
and libstdc++
(as a part of gcc
) from the source code.
With:
$ git clone https://github.com/gcc-mirror/gcc.git # mirror repo$ cd gcc && md build && cd build$ ../configure --enable-languages=c,c++,lto \ --enable-lto --prefix=/usr/local \ --enable-shared --enable-host-shared \ --with-gnu-as --with-gnu-ld \ --enable-threads=posix \ --enable-__cxa_atexit \ --enable-gnu-indirect-function \ --disable-werror --enable-checking=release \ --disable-multilib --enable-linker-build-id \ --with-linker-hash-style=gnu \ --disable-bootstrap --disable-libssp \ --enable-default-ssp$ make all -j4 && make install
However, when I try to link libQt6Core.so
into my project with the above compiler and libstdc++, ld
complains like:
/usr/bin/ld: /lib/../lib64/libQt6Core.so: undefined reference to `operator new(unsigned long)@GLIBCXX_3.4'
Also, I find:
$ strings /usr/local/lib64 | grep GLIBCXX # get libcxx api version
only gives:
GLIBCXX_FORCE_NEWGLIBCXX_DEBUG_MESSAGE_LENGTH
But with system libstdc++ I can see string like GLIBCXX_3.4.20
and so on.
So why my libstdc++ lib seems get something wrong?