The solution to “undefined reference”and “relocation truncated” (mostly concern cell-id stuffs)
While covering a program concerning RBasicGsmPhone or so stuffs,i got into the problem that my program can compile in the emulator but cannot work in the ARMI release mode (or maybe THUMB which I have not tried). The Problem is mainly
undefined reference to `RBasicGsmPhone::RBasicGsmPhone(void)' relocation truncated to fit: ARM_26...
Having checked up the program i could get it through on the emulator but not ARMI.I searched through the nokia forum and got nothing.Lots of people ever got the same problem as " undefined reference " and "relocation truncated",especially about the "cell-id" stuff,but without any solution. I saw one thread that is similar to my problem:
GeoLog.in(GeoLogContainer.o)(.text+0x494):GeoLogContaine: relocationtruncated to fit: ARM_26 RFs::Connect(int)
GeoLog.in(GeoLogContainer.o)(.text+0x4b4):GeoLogContaine: undefined reference to `RFile::Open(RFs &, TDesC16 const &, unsigned
here the problem is that it used RFile and RFs,and using the two you have to include : Location: f32file.h (include it in your .cpp file) Link against: efsrv.lib (include in your .mmp file)
Back to my problem,i have
and in my mmp
LIBRARY etel.lib // Telephony server LIBRARY
gsmbas.lib // Get cell id
Just as above,i also include a gsmbas.lib in the :Symbian\7.0s\Series60_v21_C\Epoc32\release\armi\urel,which i got from (SYSINFO60\data). i have got all needed then it may because of the wrong version of some *.h or *.lib.
Why not have a try? I download the Series60_v20 one and copy the wanted lib to my Series60_v21_C\...\urel and compile again .
Compile and BANG! IT WORKS.
So,i think that almost all similar problems are caused by short of *.lib(s) or *.h(s) for the needed ,or by short of PROPER ones. Or caused by broken ones.
Due to my little experience ,I do not know it to the deep , I hope someone can explain it more clearly or at least point out my misunderstand. easy way to solve the problem, you can just replace it with a proper one.
Then that is all. also i got a question for your experts: is there anything with the order in which the libraries were set in the mmp file? What does this thread mean? http://discussion.forum.nokia.com/fo...794#post290794