我已经在Centos上安装了eclipse,并安装了boost c++库。
当我运行代码时,它给出了如下错误
Description Resource Path Location Type
Function 'buffer_cast' could not be resolved TCP_client.cpp /TCP_client line 112 Semantic Error
Function 'buffer' could not be resolved TCP_client.cpp /TCP_client line 106 Semantic Error
Function 'connect' could not be resolved TCP_client.cpp /TCP_client line 46 Semantic Error
Function 'make_pair' could not be resolved TCP_client.cpp /TCP_client line 92 Semantic Error
Function 'make_pair' could not be resolved TCP_client.cpp /TCP_client line 93 Semantic Error
Function 'now' could not be resolved TCP_client.cpp /TCP_client line 70 Semantic Error
Function 'read_until' could not be resolved TCP_client.cpp /TCP_client line 111 Semantic Error
Function 'strcmp' could not be resolved TCP_client.cpp /TCP_client line 74 Semantic Error
Function 'strcmp' could not be resolved TCP_client.cpp /TCP_client line 74 Semantic Error
Function 'strcmp' could not be resolved TCP_client.cpp /TCP_client line 79 Semantic Error
Function 'strlen' could not be resolved TCP_client.cpp /TCP_client line 105 Semantic Error
Function 'write' could not be resolved TCP_client.cpp /TCP_client line 106 Semantic Error
Invalid arguments '
Candidates are:
' TCP_client.cpp /TCP_client line 99 Semantic Error
make: *** [TCP_client.o] Error 1 TCP_client C/C++ Problem
Method 'add_child' could not be resolved TCP_client.cpp /TCP_client line 95 Semantic Error
Method 'add_child' could not be resolved TCP_client.cpp /TCP_client line 96 Semantic Error
Method 'c_str' could not be resolved TCP_client.cpp /TCP_client line 102 Semantic Error
Method 'data' could not be resolved TCP_client.cpp /TCP_client line 112 Semantic Error
Method 'getline' could not be resolved TCP_client.cpp /TCP_client line 52 Semantic Error
Method 'push_back' could not be resolved TCP_client.cpp /TCP_client line 92 Semantic Error
Method 'push_back' could not be resolved TCP_client.cpp /TCP_client line 93 Semantic Error
Method 'put' could not be resolved TCP_client.cpp /TCP_client line 68 Semantic Error
Method 'put' could not be resolved TCP_client.cpp /TCP_client line 70 Semantic Error
Method 'put' could not be resolved TCP_client.cpp /TCP_client line 76 Semantic Error
Method 'put' could not be resolved TCP_client.cpp /TCP_client line 77 Semantic Error
Method 'put' could not be resolved TCP_client.cpp /TCP_client line 81 Semantic Error
Method 'put' could not be resolved TCP_client.cpp /TCP_client line 82 Semantic Error
Method 'put' could not be resolved TCP_client.cpp /TCP_client line 83 Semantic Error
Method 'put' could not be resolved TCP_client.cpp /TCP_client line 87 Semantic Error
Method 'put' could not be resolved TCP_client.cpp /TCP_client line 88 Semantic Error
Method 'resolve' could not be resolved TCP_client.cpp /TCP_client line 43 Semantic Error
Method 'str' could not be resolved TCP_client.cpp /TCP_client line 100 Semantic Error
Method 'what' could not be resolved TCP_client.cpp /TCP_client line 120 Semantic Error
Symbol 'buffer_cast' could not be resolved TCP_client.cpp /TCP_client line 112 Semantic Error
Symbol 'cerr' could not be resolved TCP_client.cpp /TCP_client line 120 Semantic Error
Symbol 'chrono' could not be resolved TCP_client.cpp /TCP_client line 23 Semantic Error
Symbol 'cin' could not be resolved TCP_client.cpp /TCP_client line 52 Semantic Error
Symbol 'cout' could not be resolved TCP_client.cpp /TCP_client line 50 Semantic Error
Symbol 'cout' could not be resolved TCP_client.cpp /TCP_client line 104 Semantic Error
Symbol 'cout' could not be resolved TCP_client.cpp /TCP_client line 113 Semantic Error
Symbol 'cout' could not be resolved TCP_client.cpp /TCP_client line 115 Semantic Error
Symbol 'endl' could not be resolved TCP_client.cpp /TCP_client line 104 Semantic Error
Symbol 'ptree' could not be resolved TCP_client.cpp /TCP_client line 18 Semantic Error
Symbol 'read_json' could not be resolved TCP_client.cpp /TCP_client line 19 Semantic Error
Symbol 'std' could not be resolved TCP_client.cpp /TCP_client line 49 Semantic Error
Symbol 'tcp' could not be resolved TCP_client.cpp /TCP_client line 25 Semantic Error
Symbol 'write_json' could not be resolved TCP_client.cpp /TCP_client line 20 Semantic Error
Type 'boost::asio::io_service' could not be resolved TCP_client.cpp /TCP_client line 39 Semantic Error
Type 'boost::asio::streambuf' could not be resolved TCP_client.cpp /TCP_client line 110 Semantic Error
Type 'ptree' could not be resolved TCP_client.cpp /TCP_client line 61 Semantic Error
Type 'ptree' could not be resolved TCP_client.cpp /TCP_client line 62 Semantic Error
Type 'ptree' could not be resolved TCP_client.cpp /TCP_client line 64 Semantic Error
Type 'ptree' could not be resolved TCP_client.cpp /TCP_client line 65 Semantic Error
Type 'size_t' could not be resolved TCP_client.cpp /TCP_client line 105 Semantic Error
Type 'size_t' could not be resolved TCP_client.cpp /TCP_client line 106 Semantic Error
Type 'std::exception' could not be resolved TCP_client.cpp /TCP_client line 118 Semantic Error
Type 'std::ostringstream' could not be resolved TCP_client.cpp /TCP_client line 97 Semantic Error
Type 'std::string' could not be resolved TCP_client.cpp /TCP_client line 100 Semantic Error
Type 'tcp::resolver::iterator' could not be resolved TCP_client.cpp /TCP_client line 43 Semantic Error
Type 'tcp::resolver::query' could not be resolved TCP_client.cpp /TCP_client line 42 Semantic Error
Type 'tcp::resolver' could not be resolved TCP_client.cpp /TCP_client line 41 Semantic Error
Type 'tcp::socket' could not be resolved TCP_client.cpp /TCP_client line 45 Semantic Error请帮助解决这些问题。我是Linux的新手。
我已经在VS2008上用BOOST构建了相同的代码,因为它工作起来没有任何问题。
谢谢
发布于 2016-03-05 18:18:50
"Window -> Preferences -> C/C++ -> Build -> Environment",添加名称"LANG“和"LC_ALL”,所有值均为"en_US“。
https://stackoverflow.com/questions/35474066
复制相似问题