cancel
Showing results for 
Search instead for 
Did you mean: 

long long int division

jaroslaw2
Associate II
Posted on September 02, 2008 at 05:37

long long int division

4 REPLIES 4
jaroslaw2
Associate II
Posted on May 17, 2011 at 12:43

Hi,

I have a problem in compiling in gcc long long int data type.

I have linker error when I declare long long int as global variable and want to divide by another long long int variable.

example that generate error:

long long int a=1;

long long int b=1;

long long int c=1;

void Fun1(void){ //Fun1 is called form another file

a=1;

}

void Fun2(void){

a=b/c;

}

example that not generate error:

long long int a=1;

long long int b=1;

long long int c=1;

void Fun1(void){

a=1;

}

void Fun2(void){

Fun1();

a=b/c;

}

Can somebodey explain this?

Error:

Running : LD

\''C:\Program Files\Raisonance\Ride\arm-gcc\bin\arm-none-eabi-gcc.exe'' -mcpu=cortex-m3 -mthumb -Wl,-T -Xlinker ''C:\Documents and Settings\jarek\Pulpit\Projekty\STM\GLCD\KS0108\4\FWLib\project\RIDE\STM3210B-EVAL\Project.elf.ld'' -u _start -Wl,-static -Wl,--gc-sections -nostartfiles -Wl,-Map -Xlinker ''C:\Documents and Settings\jarek\Pulpit\Projekty\STM\GLCD\KS0108\4\FWLib\project\RIDE\lst\Project.map''

c:/program files/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-abort.o): In function `abort':

abort.c.text+0x8): undefined reference to `_exit'

c:/program files/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-signalr.o): In function `_getpid_r':

signalr.c.text+0x2): undefined reference to `_getpid'

c:/program files/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-signalr.o): In function `_kill_r':

signalr.c.text+0x16): undefined reference to `_kill'

c:/program files/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.2.1/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':

sbrkr.c.text+0xc): undefined reference to `_sbrk'

collect2: ld returned 1 exit status

Build failed

tibo
Associate II
Posted on May 17, 2011 at 12:43

try to link with libgcc (-lgcc).

st3
Associate II
Posted on May 17, 2011 at 12:43

Hasn't this been answered on the Raisonance forum?

http://www.raisonance.com/Forum/punbb/viewtopic.php?pid=8718#p8718

If you're going to post the same question on different forums, you need to make sure that you keep every one updated.

At least provide a link between the two!

jaroslaw2
Associate II
Posted on May 17, 2011 at 12:43

Quote:

On 02-09-2008 at 07:32, Anonymous wrote:

Hasn't this been answered on the Raisonance forum?

http://www.raisonance.com/Forum/punbb/viewtopic.php?pid=8718#p8718

If you're going to post the same question on different forums, you need to make sure that you keep every one updated.

At least provide a link between the two!

Hi,

Thanks for the answer.

Indeed the problem was solved on RIDE forum. They fix this problem in the Ride7 version 7.10.0000 and RKitARM version 1.10.0000.

I am sorry for not update this forum :(