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

unresolved symbols.

5 replies · 4,902 views · Started 22 November 2004

really bloody annoying.. keep getting the following error

searched for what libabaries should be included and found that 'efsrv.lib' should be so added that and included 'f32file.h' but still getting the errors....

the program is suppossed to search directories for '*.mp3' then display a list of the files, just used the heloworld as a template for it

HELLOWORLD_APPVIEW.obj : error LNK2001: unresolved external symbol "public: int __thiscall TFindFile::FindWild(class CDir * &😉" (?FindWild@TFindFile@@QAEHAAPAVCDir@@@Z)
HELLOWORLD_APPVIEW.obj : error LNK2001: unresolved external symbol "public: class TDesC16 const & __thiscall TParseBase::FullName(void)const " (?FullName@TParseBase@@QBEABVTDesC16@@XZ)
HELLOWORLD_APPVIEW.obj : error LNK2001: unresolved external symbol "public: int __thiscall TParse::Set(class TDesC16 const &,class TDesC16 const *,class TDesC16 const *)" (?Set@TParse@@QAEHABVTDesC16@@PBV2@1@Z)
HELLOWORLD_APPVIEW.obj : error LNK2001: unresolved external symbol "public: class TEntry const & __thiscall CDir:😮perator[](int)const " (??ACDir@@QBEABVTEntry@@H@Z)
HELLOWORLD_APPVIEW.obj : error LNK2001: unresolved external symbol "public: __thiscall TParse::TParse(void)" (??0TParse@@QAE@XZ)
HELLOWORLD_APPVIEW.obj : error LNK2001: unresolved external symbol "public: int __thiscall CDir::Count(void)const " (?Count@CDir@@QBEHXZ)
HELLOWORLD_APPVIEW.obj : error LNK2001: unresolved external symbol "public: int __thiscall TFindFile::FindWildByPath(class TDesC16 const &,class TDesC16 const *,class CDir * &😉" (?FindWildByPath@TFindFile@@QAEHABVTDesC16@@PBV2@AAPAVCDir@@@Z)
HELLOWORLD_APPVIEW.obj : error LNK2001: unresolved external symbol "public: __thiscall TFindFile::TFindFile(class RFs &😉" (??0TFindFile@@QAE@AAVRFs@@@Z)
HELLOWORLD_APPVIEW.obj : error LNK2001: unresolved external symbol "public: int __thiscall RFs::Connect(int)" (?Connect@RFs@@QAEHH@Z)
\Symbian\6.1\Series60\EPOC32\BUILD\SYMBIAN\6.1\SERIES60\EPOC32EX\HELLOWORLD\HELLOWORLD\WINS\UDEB\HELLOWORLD.APP : fatal error LNK1120: 9 unresolved externals
NMAKE : fatal error U1077: 'link.exe' : return code '0x460'
Stop.
if exist "\Symbian\6.1\Series60\EPOC32\BUILD\SYMBIAN\6.1\SERIES60\EPOC32EX\HELLOWORLD\HELLOWORLD\WINS\UDEB\HELLOWORLD.exp" del "\Symbian\6.1\Series60\EPOC32\BUILD\SYMBIAN\6.1\SERIES60\EPOC32EX\HELLOWORLD\HELLOWORLD\WINS\UDEB\HELLOWORLD.exp"
Stopped the build by removing the export object,
if present, because the pre-link stage failed
Linking...
LINK : fatal error LNK1104: cannot open file "\Symbian\6.1\Series60\EPOC32\BUILD\SYMBIAN\6.1\SERIES60\EPOC32EX\HELLOWORLD\HELLOWORLD\WINS\UDEB\HELLOWORLD.exp"
Error executing link.exe.

tried to add the library to the mmp but just got another error

doing first-stage link by name
NMAKE : fatal error U1073: don't know how to make '"\Symbian\6.1\Series60\EPOC32\RELEASE\WINS\UDEB\EFSRV.MMP"'
Stop.
if exist "\Symbian\6.1\Series60\EPOC32\BUILD\SYMBIAN\6.1\SERIES60\EPOC32EX\HELLOFILES\HELLOWORLD\WINS\UDEB\HELLOWORLD.exp" del "\Symbian\6.1\Series60\EPOC32\BUILD\SYMBIAN\6.1\SERIES60\EPOC32EX\HELLOFILES\HELLOWORLD\WINS\UDEB\HELLOWORLD.exp"
Stopped the build by removing the export object,
if present, because the pre-link stage failed
Linking...
LINK : fatal error LNK1104: cannot open file "\Symbian\6.1\Series60\EPOC32\RELEASE\WINS\UDEB\efsrv.mmp"
Error executing link.exe.

arrrgghhhhh...

dunno whats up with this now.. everywhere I checked and it says just add efsrv..???
but still the same errors.. anyone think of anything else stupid I might be doing?

You're still missing some library or another. Is the development environment othewise OK (can you, for example, compile SDK sample apps all right)?

Did you write the app yourself or are you trying to recompile somebody else's code? Was it created with/for the same SDK version?

I modified the helloworld example (which compiled grand before I started fiddling with it.. added in the following code , when I try to complie I get the above errors??

looked through the documentation but cant find which libaries I'm missing ?

CArrayPtrFlat<HBufC>* iFileNames;
//iFileNames = new(ELeave) CArrayPtrFlat<HBufC>(1);

void FetchFileNamesL(RFs& aSession, const TDesC& aWildname, const TDesC& aPathList)
{
TFindFile fileFinder(aSession); // Utility class for file manipulation
CDir* fileList; // return list of found files from fileFinder.FindWildByPath()
TBufC<256> buf; // temp descriptor for extracting individual filenames + paths
HBufC* fileName; // permanent (heap) descriptor for storing in iFileNames array

// will search entire path until exhausted, unless file found - then stops after
// full search of current directory

TInt err = fileFinder.FindWildByPath(aWildname, &aPathList, fileList);
while (err==KErrNone) // alternative is KErrFileNotFound thus last search was successful
{
for (TInt index = 0; index < fileList->Count(); index++)
{
TParse fullEntry;
fullEntry.Set((*fileList)[index].iName,& fileFinder.File(),NULL);
buf = fullEntry.FullName(); // extract individual path + name from list
fileName = buf.AllocL(); // performs memory allocation
CleanupStack::PushL(fileName);
iFileNames->InsertL(iFileNames->Count(), fileName);
CleanupStack::Pop(); // fileName
}

// fileList must be deleted after each loop prior to being passed back to
// fileFinder (unnecessary after KErrFileNotFound)

delete fileList;

// if previous success, continue search in further directories in path, if exist

err = fileFinder.FindWild(fileList);
}
}

void PopulateFileNamesL()
{
// graphic file extension (that can be serviced) to be searched for
_LIT(KWildName, "*.mp3"😉; // find mp3's


// directories to search through
_LIT(KPathList, "c:\\documents\\;c:\\system\\;c:\\temp\\"😉;
TBufC<256> pathList(KPathList);

// connect to the file server
RFs session;
session.Connect();
CleanupClosePushL(session);

// search path for occurrences of each graphic file type and store in iFileNames array
FetchFileNamesL(session, KWildName, pathList);

// performs duel purpose of closing file server session necessary to avoid panic
CleanupStack::PopAndDestroy(); // session

}

ah tis okay.. I found it ewventually... and I must say that its bloody stupid.. not in the documentation or help files..

from here

error LNK2001: unresolved external symbol

We all know this error and we know we need to add the library. Easy (if you use VC6), go to Project, Settings (Alt+F7) and add the library on the Link page. F7 to recompile. Same error. Check the library, spelling is correct? Yes, why do I get these errors. Check the help files. Stop, you will not find it that easy. I stumbled acros it a year ago and today when I started searching for the answer I decided to write this article to make it easy for you.

When we use MEAD (Minimal Eikon Application Developer) to create a start off project and the use ABLD MAKEFILE VC6 to use VC6 as our editor. We will have this linking problem when we add additional libraries.

When using VC6, the NMAKE doesn�t make use of the settings you made in VC6. You need to make these changes directly in the .SUP.MAKE file. Now for me and you to go fiddle in that file can cause extra problems. Thus what we need to do is go back do step 1 of creating a VC6 workspace.
- Edit the .MMP file created by MEAD.
- Add a line LIBRARY filename.lib
- Recreate VC6 workspace by running ABLD MAKEFILE VC6

Open your project again in VC6, add the Engine or Gui workspace and recompile. Your link error should be gone.