| Author | beginning argument ( Replies received: 3 ) |
| jaroslaw.oska |
Posted 01-09-2008 at 14:08   |

Registered on : 11-21-2008
Messages : 35
OFF-Line
|
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
|
|
|
Profile
Quote
|
| tibo |
Posted 01-09-2008 at 18:23   |

Registered on : 06-09-2008
Messages : 39
OFF-Line
|
try to link with libgcc (-lgcc).
|
|
|
Profile
Quote
|
| st7 |
Posted 02-09-2008 at 07:32   |

Registered on : 06-02-2008
Messages : 116
OFF-Line
|
|
Profile
Quote
|
| jaroslaw.oska |
Posted 02-09-2008 at 09:07   |

Registered on : 11-21-2008
Messages : 35
OFF-Line
|
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 
|
|
|
Profile
Quote
|