Where are __X_IDIVU and __X_IMULU?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Where are __X_IDIVU and __X_IMULU?

Jump to solution
1,706 Views
MicroTang
Contributor III
Hi All,
 
When I build a project, I got two link errors, symbol __X_IDIVU and __X_IMULU are undefined in obj file. It seems a lib file is missed, but could you please tell me which lib file include the symbols? Thanks!
 
Labels (1)
0 Kudos
Reply
1 Solution
617 Views
CompilerGuru
NXP Employee
NXP Employee
First, please mention which CPU you are targeting. I make an educated guess and assume you are targeting a S12X and you are using the XGATE.
The XGATE compiler does prefix its functions with __X_.

In general I would recommend to create a project with the new project wizard and see how the newly generated project it setup, it does include the right libraries for example.

In your case, the XGATE runtime routines are defined in the XGATE libraries,
See
C:\Program Files\Freescale\CodeWarrior for HCS12 V4.7\lib\xgatec\readme.txt for a list,
you probably want to use the integer only lib:
C:\Program Files\Freescale\CodeWarrior for HCS12 V4.7\lib\xgatec\lib\ansi_xgi.lib

The actual IMULU/IDIVU runtime routines are implemented in
C:\Program Files\Freescale\CodeWarrior for HCS12 V4.7\lib\xgatec\src\rtsxgate.cxgate

You can alternatively to the library also add this source file to your project, but then only the runtime routines and not all the ANSI functions are available.

Daniel

View solution in original post

0 Kudos
Reply
2 Replies
618 Views
CompilerGuru
NXP Employee
NXP Employee
First, please mention which CPU you are targeting. I make an educated guess and assume you are targeting a S12X and you are using the XGATE.
The XGATE compiler does prefix its functions with __X_.

In general I would recommend to create a project with the new project wizard and see how the newly generated project it setup, it does include the right libraries for example.

In your case, the XGATE runtime routines are defined in the XGATE libraries,
See
C:\Program Files\Freescale\CodeWarrior for HCS12 V4.7\lib\xgatec\readme.txt for a list,
you probably want to use the integer only lib:
C:\Program Files\Freescale\CodeWarrior for HCS12 V4.7\lib\xgatec\lib\ansi_xgi.lib

The actual IMULU/IDIVU runtime routines are implemented in
C:\Program Files\Freescale\CodeWarrior for HCS12 V4.7\lib\xgatec\src\rtsxgate.cxgate

You can alternatively to the library also add this source file to your project, but then only the runtime routines and not all the ANSI functions are available.

Daniel

0 Kudos
Reply
617 Views
MicroTang
Contributor III
Thanks!
 
I am using S12XEP100. The link issues have been eliminated after the library file added into project.
 
Thanks!
 
Michael
0 Kudos
Reply