Linking Error on FP2

Login to reply to this topic.
Wed, 2006-02-22 02:22
Joined: 2006-02-21
Forum posts: 14
Now I got 2 programs. And I decided to create a library for the first program and then call the library subroutine on the application. Every thing works as expected on the EPOC program.

But when I try to compile for the real device (abld build armi urel). Millions of linkgin errors come out as follows.
1. undefined reference to 'sprintf'
2. relocation truncated to fit: ARM_26 sprintf
The error comes out not only from sprintf. Also comes from memset, free... which I used those commands on the library.

The machine I used is a Nokia 6630 (Symbian S60 OS version is 8.0). And the developer platform used is S60 2nd Edition, Feature Pack 2.

Thanks for the help.

Wed, 2006-02-22 09:25
Joined: 2004-06-08
Forum posts: 148
Re: Linking Error on FP2
Did you include estlib.lib in your project for device target?
Wed, 2006-02-22 10:40
Joined: 2006-02-21
Forum posts: 14
Re: Linking Error on FP2
Yes I did
Wed, 2006-02-22 11:51
Joined: 2004-10-12
Forum posts: 44
Re: Linking Error on FP2
Many standard C stuffs need also ecrt0.lib. In addition to estlib.lib
Thu, 2006-02-23 07:17
Joined: 2006-02-21
Forum posts: 14
Re: Linking Error on FP2
Yes I added both files on my mmp file
Thu, 2006-02-23 09:08
Joined: 2004-06-08
Forum posts: 148
Re: Linking Error on FP2
The mmp file is used only when you create your project. I guess you added the libraries on a later state. You have to add the libraries in the project. Use Project->add files from the menu, or simply drag and drop the desired libs in your workspace.
Fri, 2006-02-24 04:17
Joined: 2006-02-21
Forum posts: 14
Re: Linking Error on FP2
Thanks for all replies but until this moment the problem is not solved yet.

Let me say some more details on my mmp file.

On the mmp file for the library
TARGET        abc.lib
TARGETTYPE    lib
UID           0
LIBRARY estlib.lib euser.lib ecrt0.lib

On the application my mmp looks like this
TARGETTYPE                              app
UID                                     0x100039CE 0x0DCAEAB9
LIBRARY                                 fbscli.lib
LIBRARY                                 esock.lib
LIBRARY                                 insock.lib
LIBRARY                                 estlib.lib
LIBRARY                                 bitgdi.lib
LIBRARY                                 avkon.lib
LIBRARY                                 eikcoctl.lib
LIBRARY                                 eikcore.lib
LIBRARY                                 cone.lib
LIBRARY                                 apparc.lib
LIBRARY                                 euser.lib
LIBRARY                                 efsrv.lib
LIBRARY                                 estor.lib
LIBRARY                                 ws32.lib
LIBRARY                                 abc.LIB

of coz I included all the source path as well as the source file
Wed, 2007-05-09 10:18
Joined: 2004-06-29
Forum posts: 109
Re: Linking Error on FP2
winstonma,

eqiaotea suggests a rearrangement in the mmp file:
http://forum.newlc.com/index.php/topic,3901.0.html

would this help i your case?

br, Marcel
Fri, 2007-05-11 08:02
Joined: 2004-11-29
Forum posts: 1233
Re: Linking Error on FP2
Do you also have the "LIBRARY" includes also in the mmp for your app?

When you build a static lib, any references to other libs is not linked into it, but you have to add those libraries too when you want to use your static lib.

That you didn't get this problem in wins, I think is because the wins compiler handles that differently, since you then in practice are building win32 exes and not symbian exes.

  • Login to reply to this topic.