编译通过后,[linkker error]error:unresolved external'xxxxxx.OBJ
C++ builder 2006 编译通过后,进行linker时报出错,网上查了一下只有一个模糊的方法是增加.lib到工程,但我把所需要的lib已经加入。是漏掉了lib?
.h头文件源文件
//---------------------------------------#ifndef TJzDataPkgH#define TJzDataPkgH//---------------------------------------#include <oxmldom.hpp>#include <msxmldom.hpp>#include <XMLDoc.hpp>#include <xmldom.hpp>#include <XMLIntf.hpp>//---------------------------------------int __fastcall StringLastIndexOf(String Source, String SubString);//---------------------------------------class TJzSlave : public TObject {private: friend class TJzDataPkg; TJzDataPkg *FOwner; String FName; TStream *FContent; int FOffset; int FLength; TStream * const __fastcall GetContent();public: __fastcall TJzSlave(TJzDataPkg *AOwner, String AName, TStream *AContent); __fastcall ~TJzSlave(); __property String Name = { read=FName }; __property int Length = { read=FLength }; __property TStream *Content = { read=GetContent };};//---------------------------------------enum TDataPkgType { dptRequest, dptResponse };enum TDataPkgState { dpsEditing, dpsBuilded };//---------------------------------------class TJzDataPkg : public Classes::TPersistent {private: TDataPkgType FType; TDataPkgState FState; int __fastcall GetId(void); void __fastcall SetId(int AReqId); String __fastcall GetCmd(void); void __fastcall SetCmd(String ReqCmd); String __fastcall GetClientIp(void); // 1.2 void __fastcall SetClientIp(String AClientIp); // 1.2 int __fastcall GetSlaveCount(void); int __fastcall GetResultCode(void); String __fastcall GetResultMsg(void); _di_IXMLDocument FHeadXml; _di_IXMLNode FRootNode; _di_IXMLNode FCmdNode; _di_IXMLNode FResultNode; _di_IXMLNode FDataNode; _di_IXMLNode FSlavesNode; TList *FSlaveList;public: //__fastcall TJzDataPkg(const char *Buffer, const int Length); __fastcall TJzDataPkg(String AHead); __fastcall TJzDataPkg(); __fastcall ~TJzDataPkg(); //void __fastcall LoadFromBuffer(const char *Buffer, const int Length); void __fastcall CreateHead(String AHead); void __fastcall SetResult(int ACode, String AMsg); String __fastcall GetData(String ADataName); void __fastcall PutData(String ADataName, String AValue); void __fastcall PutSlave(String ASlaveName, TStream *AContent); bool __fastcall HasSlave(String ASlaveName); int __fastcall GetSlaveLength(int AIndex); int __fastcall GetSlaveLength(String ASlaveName); TJzSlave *__fastcall GetSlave(int AIndex); TJzSlave *__fastcall GetSlave(String ASlaveName); String __fastcall GetXml(void); void __fastcall SaveSlaveContent2Stream(int AIndex, TStream *AStream); void __fastcall SaveSlaveContent2Stream(String ASlaveName, TStream *AStream); void __fastcall SaveToStream(const TStream *AStream);__published: __property int Id = { read=GetId, write=SetId }; __property String Cmd = { read=GetCmd, write=SetCmd }; __property String ClientIp = { read=GetClientIp, write=SetClientIp }; // 1.2 __property _di_IXMLNode DataNode = { read=FDataNode }; __property int SlaveCount = { read=GetSlaveCount }; __property int ResultCode = { read=GetResultCode }; __property String ResultMsg = { read=GetResultMsg };};//---------------------------------------extern PACKAGE int BLOCK_BUFFER_LENGTH;#endif
所以,要看具体的提示。
[解决办法]
感觉问题应该出在你的工程放在了有中文的路径里:)
把工程换个路径试试?
[解决办法]
检查和xxxx.obj同名的.cpp文件。
[解决办法]