且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

什么可能导致clang找不到unordered_map头?

更新时间:2023-11-20 12:04:34

我在编译glogg时遇到同样的问题。

I had the same issue when compiling glogg.

正如评论所指出的。它是stdlib。

As the comments have pointed out. it was stdlib.

在运行qmake后的makefile中。从

In the makefile after running qmake. Change this line from

CXXFLAGS      = -g -Wextra -std=c++11 -DGLOGG_VERSION=\"`cat .tarball-version`\" -O2 -arch x86_64 -Wall -W $(DEFINES)

CXXFLAGS      = -g -Wextra -std=c++11 -stdlib=libc++ -DGLOGG_VERSION=\"`cat .tarball-version`\" -O2 -arch x86_64 -Wall -W $(DEFINES)

通知-stdlib = libc ++在cxxflags中指定。它是在链接器标志中自动指定的,我想它也需要为C ++标志指定。

notice "-stdlib=libc++" was specified in the cxxflags. It's autospecified in the linker flags, I guess it also needs to be specified in for the C++ flags.