This example fails to compile on Sequoia 15.4 with Xcode 16.3 and the command line tools installed;
jacquesmenu@macstudio:C++Tests > cat pcount_test.cpp // clang++ -std=c++17 -o IntWrapperTest IntWrapperTest.cpp
#include <string> // std::string #include <iostream> // std::cout #include <sstream> // std::ostringstream
int main1 (int argc, char* argv[]) { std::string theString = "Prière d'éviter";
std::cout << theString << ", size(): " << theString.size () << std::endl;
std::stringstream oss;
oss << theString << std::endl;
std::cout << oss.str () << ", pcount(): " << oss.pcount () << std::endl;
}
//_______________________________________________________________________________ // position in output stream #include <fstream> // std::ofstream
int main () {
std::ofstream outfile; outfile.open ("test.txt");
outfile.write ("This is an apple",16); long pos = outfile.tellp(); outfile.seekp (pos-7); outfile.write (" sam",4);
outfile.close();
return 0; }
jacquesmenu@macstudio:C++Tests > clang++ pcount_test.cpp pcount_test.cpp:3:10: fatal error: 'string' file not found 3 | #include <string> // std::string | ^~~~~~~~ 1 error generated.
The same occurs with iostrem if it is the first include mentioned. Compiling in Xcode itself does not this problem, though.
This include is to be found here:
jacquesmenu@macstudio:C++Tests > xcode-select -p
/Applications/Xcode.app/Contents/Developer
jacquesmenu@macstudio:C++Tests > ls -sal /Applications/Xcode.app/Contents/Developer/**/string | grep MacOSX 72 -rw-r--r-- 10 root wheel 203802 Mar 8 06:17 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/string
Maybe try to repost your code
Agreed.
Also, in Investigating Third-Party IDE Integration Problems you’ll find two things:
-
Some trivial test programs to verify your Apple tools setup. I recommend that you try compiling those.
-
Some general hints about debugging problems like this.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"