string编译通不过

踏实每一步 2011-06-01 04:47:08
HCRecordset.cpp:27: error: aggregate `std::string sT' has incomplete type and cannot be defined
HCRecordset.cpp:31: error: no matching function for call to `std::vector<std::string, std::allocator<std::string> >::push_back(<type error>)'
/usr/local/gcc-3.4.0/lib/gcc/i386-redhat-linux/3.4.0/../../../../include/c++/3.4.0/bits/stl_vector.h:557: note: candidates are: void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = std::string, _Alloc = std::allocator<std::string>]
HCRecordset.cpp:32: warning: unused variable 'i'
HCRecordset.cpp: In member function `char* HCRecordset::GetData(unsigned int, unsigned int)':
HCRecordset.cpp:44: error: invalid use of undefined type `struct std::basic_string<char, std::char_traits<char>, std::allocator<char> >'
...全文
168 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
江东橘子 2011-06-02
  • 打赏
  • 举报
回复
#include <string>
using namespace std;
yong_f 2011-06-02
  • 打赏
  • 举报
回复
有没有包含头文件:
#include <string>
using namespace std;
也许吧
wowRicky 2011-06-01
  • 打赏
  • 举报
回复
有没有包含头文件:
#include <string>
using namespace std;
踏实每一步 2011-06-01
  • 打赏
  • 举报
回复
Make file里面
TARGET=HCGPSServer
OBJS= HCGPSServer.o XMLDeal.o bbs_oci.o binreloc.o ObjData.o LogModule.o ConfigModule.o User.o CellularLocationDeal.o \
PolicyInfoManagerServer.o Utility.o DataDealModule.o SendDealModule.o ConnDealModule.o VersionUpdateManager.o \
HCGPSSmsDeal.o Base64Coder.o ISAGPolicyDeal.o ImpreciseLocationPolicyInfo.o hcmd5.o HCRecordset.o HCDataBase.o HCDB.o

CC=g++
$(TARGET): $(OBJS) $(LIBOBJS)
# $(CC) -o $@ $(LDFLAGS) $^
$(CC) -o $(TARGET) $(LDFLAGS) $(OBJS)
# cp -rf $(TARGET) $(HOME)/bin/


应该是g++编译的
justkk 2011-06-01
  • 打赏
  • 举报
回复
g++ 编译的?

23,121

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧