Forum : ARM
Original Post
Post Information | Post |
---|---|
May 24, 2010 - 10:38pm
|
Hello all, after numerous attempts I'm still not able to compile a C++ project under Ride7 (I'm using Windows XP). I know that C++ isn't officialy supported by the IDE, but in this post: http://www.stm32circle.com/forum/viewtopic.php?id=433 VincentC gave some indications in order to compile a C++ project under Ride (above all, using libstdc++). Code: Building C:\Documents and Settings\.... Running: LD "C:\Programmi\Raisonance\Ride\arm-gcc\bin\arm-none-eabi-gcc.exe" -mcpu=cortex-m3 - mthumb -Wl,-T -Xlinker "out\FW FAS.elf.ld" -u _start -Wl,-static -Wl,--gc-sections - nostartfiles -Wl,-Map -Xlinker "lst\FW FAS.map" -Wl,--warn-once -Wl,-lstdc++ c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm- none-eabi/lib/thumb2\libc.a(lib_a-abort.o): In function `abort': abort.c:(.text+0x8): undefined reference to `_exit' c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm- none-eabi/lib/thumb2\libc.a(lib_a-signalr.o): In function `_getpid_r': signalr.c:(.text+0x2): undefined reference to `_getpid' c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm- none-eabi/lib/thumb2\libc.a(lib_a-signalr.o): In function `_kill_r': signalr.c:(.text+0x1c): undefined reference to `_kill' c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm- none-eabi/lib/thumb2\libc.a(lib_a-writer.o): In function `_write_r': writer.c:(.text+0x16): undefined reference to `_write' c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm- none-eabi/lib/thumb2\libc.a(lib_a-closer.o): In function `_close_r': closer.c:(.text+0x12): undefined reference to `_close' c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm- none-eabi/lib/thumb2\libc.a(lib_a-fstatr.o): In function `_fstat_r': fstatr.c:(.text+0x14): undefined reference to `_fstat' c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm- none-eabi/lib/thumb2\libc.a(lib_a-isattyr.o): In function `_isatty_r': isattyr.c:(.text+0x12): undefined reference to `_isatty' c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm- none-eabi/lib/thumb2\libc.a(lib_a-lseekr.o): In function `_lseek_r': lseekr.c:(.text+0x16): undefined reference to `_lseek' c:/programmi/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.3.2/../../../../arm- none-eabi/lib/thumb2\libc.a(lib_a-readr.o): In function `_read_r': readr.c:(.text+0x16): undefined reference to `_read' collect2: ld returned 1 exit status Build failed Note the numerous "undefined reference ...". |
Hi
The error message listed above might not come from the fact that you are compiling a c++ project.
I suggest you make a trial with a basic project simply defining a class, initializing it and change its value.
This should shows that you did everything to make the use of c++ projects possible.
The error messages in your post are more related to symbols definition mismatch due to te use of a kind of printf or malloc function.
I think adding into your project the sources from C:\Program Files\Raisonance\ride\lib\ARM\std_sbrk
might resolve the problem.
Regards
Matloub
Hi Matloub, thanks for your answer!
Well, I've tried your suggestion to make a very simple cpp project, but the problem seems to be residing in the use of C++.
Suppose we have the following simple class, "Prova", which has a field and a constructor:
Prova.h
Prova.cpp
The main is this:
When compiling the above code, the linker gives me this output:
An interesting thing is that, if I comment the line contaning the instantiation of the "Prova" object, then everything goes fine!
About your other suggestion regarding std_sbrk:
This seemed to help a bit. In fact, if I copy the sources of that directory in the directory of my sources, then I have only this error message:
Do you have other suggestions?
Thanks :)