Topic : long long int division in STM32

Forum : ARM

Original Post
Post Information Post
September 1, 2008 - 1:15pm
Guest

Hi,

I have a problem in compiling 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

Replies
Post Information Post
+1
0
-1
September 1, 2008 - 4:02pm
Guest

Hi,
I still can not compile this code.

RIDE7 can not divide long long int data types?
Anglia IDEAliST can do this operation and it has gcc as well.

Please help.

int main(void)
{
long long int a=1;
long long int b=1;
a=a/b;
while(1) ;
return 0;
}

+1
0
-1
September 1, 2008 - 4:05pm
Guest

Hi

May I ask you if you have this problem with Ride7 version 7.10.0000 and RKitARM version 1.10.0000?

Matloub

+1
0
-1
September 1, 2008 - 6:24pm
Guest

I have,
Ride7 version 7.02.0001 and RKitARM version 1.05.0001?
Ride can not compile code:


long long int a=1;
long long int b=1;
long long int c=1;

void fun1(void){
b=2;
}

int main(void)
{
#ifdef DEBUG
debug();
#endif

c=a/b;
while(1) {
}

return 0;
}

I share project,
http://osia.w.interia.pl/FWLib.rar

I will install new ride and write if this help.

+1
0
-1
September 1, 2008 - 6:50pm
Guest

Ok,

I am sorry, everything works on Ride7 version 7.10.0000 and RKitARM version 1.10.0000?

Thanks a lot,
J.O.

+1
0
-1
September 2, 2008 - 7:29am
Guest

jaroslaw.oska wrote:
everything works on Ride7 version 7.10.0000 and RKitARM version 1.10.0000 ?

Is that a question?

Or are you confirming that the problem is solved with Ride7 version 7.10.0000 and RKitARM version 1.10.0000?

+1
0
-1
September 2, 2008 - 9:04am
Guest

I confirm that the problem is solved with Ride7 version 7.10.0000 and RKitARM version 1.10.0000