Read-only archive of the All About Symbian forum (2001–2013) · About this archive

unresolved external symbol

1 replies · 3,994 views · Started 01 October 2003

hi,

I face some unresolved external symbol error when I add the code below into my program(under the container class constructor).....

const TPtrC KTestFile =_L("T_FSTRM.DAT"😉;
const TUint8* KTestData =_S8("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"😉;
const TInt KTestLength = 36;
const TPtrC8 KTestDes(KTestData,KTestLength);
TBuf8<KTestLength +1> buf;
RFs TheFs;
RFile file;

User::LeaveIfError(file.Replace(TheFs,KTestFile,EFileWrite)); //Create the file for writing
RFile f = file; //create a new handle
RFileWriteStream out(f); //open the file as a stream
out.WriteL(KTestDes); //write some test data(to a buffer)
out.CommitL(); //commit the data(to file)

TInt iFileSize;
file.Size(iFileSize); // get the size of the file
out.Attach(file, iFileSize); // prepare to append data to the end of the new file
out.WriteL(KTestDes); // append the test data
out.Close(); // close the file with test data written twice

I add all the libraries into my mmp file already but I still got the error below.

Creating library \Symbian\6.1\Series60\EPOC32\BUILD\SYMBIAN\6.1\SERIES60\SERIES60EX\BOX\GROUP\BOX\WINS\UDEB\BOX.lib and object \Symbian\6.1\Series60\EPOC32\BUILD\SYMBIAN\6.1\SERIES60\SERIES60EX\BOX\GROUP\BOX\WINS\UDEB\BOX.exp
LINK : warning LNK4005: no objects used from library \Symbian\6.1\Series60\EPOC32\RELEASE\WINS\UDEB\EIKCOCTL.LIB
BOXCONTAINER.obj : error LNK2001: unresolved external symbol "public: void __thiscall RWriteStream::Close(void)" (?Close@RWriteStream@@QAEXXZ)
BOXCONTAINER.obj : error LNK2001: unresolved external symbol "public: void __thiscall RFileWriteStream::Attach(class RFile &,int)" (?Attach@RFileWriteStream@@QAEXAAVRFile@@H@Z)
BOXCONTAINER.obj : error LNK2001: unresolved external symbol "public: int __thiscall RFile::Size(int &😉const " (?Size@RFile@@QBEHAAH@Z)
BOXCONTAINER.obj : error LNK2001: unresolved external symbol "public: void __thiscall RWriteStream::CommitL(void)" (?CommitL@RWriteStream@@QAEXXZ)
BOXCONTAINER.obj : error LNK2001: unresolved external symbol "public: void __thiscall RWriteStream::WriteL(class TDesC8 const &😉" (?WriteL@RWriteStream@@QAEXABVTDesC8@@@Z)
BOXCONTAINER.obj : error LNK2001: unresolved external symbol "public: __thiscall RFileWriteStream::RFileWriteStream(class RFile &,int)" (??0RFileWriteStream@@QAE@AAVRFile@@H@Z)
BOXCONTAINER.obj : error LNK2001: unresolved external symbol "public: int __thiscall RFile::Replace(class RFs &,class TDesC16 const &,unsigned int)" (?Replace@RFile@@QAEHAAVRFs@@ABVTDesC16@@I@Z)
\Symbian\6.1\Series60\EPOC32\BUILD\SYMBIAN\6.1\SERIES60\SERIES60EX\BOX\GROUP\BOX\WINS\UDEB\BOX.APP : fatal error LNK1120: 7 unresolved externals
NMAKE : fatal error U1077: 'link.exe' : return code '0x460'

Anyone know how to solve it?

Thanks in advance.

When you add new link to a .dll on the .mmp, you must create the makefile again, not only rebuild the project.