https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230184
Bug ID: 230184 Summary: clang++ failed to include standard header files if '-stdlib=libstdc++' option is specified Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: b...@freebsd.org Reporter: y...@utahime.org In the OPTIONS section of clang(1) man page '-stdlib' option is explained as following: ---------------------------------------------------------------------- -stdlib=<library> Specify the C++ standard library to use; supported options are libstdc++ and libc++. If not specified, platform default will be used. ---------------------------------------------------------------------- But if '-stdlib=libstdc++' is specified clang++ fails to include standard header files such as 'iostream' or 'cstdio'. yasu@rolling-vm-freebsd1[1724]% uname -a FreeBSD rolling-vm-freebsd1.home.utahime.org 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r336739: Sun Jul 29 07:46:09 JST 2018 ro...@rolling-vm-freebsd1.home.utahime.org:/usr0/freebsd/base/obj/usr0/freebsd/base/head/amd64.amd64/sys/GENERIC_UTAHIME amd64 yasu@rolling-vm-freebsd1[1725]% cat Makefile CXX= clang++ RM= rm -f CXXFLAGS+= -stdlib=libstdc++ TARGETS = cpptest01 \ cpptest02 OBJECTS = cpptest01.o \ cpptest02.o all: ${TARGETS} cpptest01: cpptest01.o $(CXX) $(CXXFLAGS) -o $@ $> cpptest02: cpptest02.o $(CXX) $(CXXFLAGS) -o $@ $> clean: ${RM} ${TARGETS} ${OBJECTS} yasu@rolling-vm-freebsd1[1726]% cat cpptest01.cpp #include <iostream> int main(int argc, char **argv) { std::cout << "Hello, World" << std::endl; return 0; } yasu@rolling-vm-freebsd1[1727]% cat cpptest02.cpp #include <cstdio> int main(int argc, char **argv) { std::printf("Hello, World\n"); return 0; } yasu@rolling-vm-freebsd1[1728]% make -k clang++ -O2 -pipe -stdlib=libstdc++ -c cpptest01.cpp -o cpptest01.o cpptest01.cpp:1:10: fatal error: 'iostream' file not found #include <iostream> ^~~~~~~~~~ 1 error generated. *** Error code 1 (continuing) clang++ -O2 -pipe -stdlib=libstdc++ -c cpptest02.cpp -o cpptest02.o cpptest02.cpp:1:10: fatal error: 'cstdio' file not found #include <cstdio> ^~~~~~~~ 1 error generated. *** Error code 1 (continuing) `all' not remade because of errors. yasu@rolling-vm-freebsd1[1728]% -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ freebsd-bugs@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"