Topic : STM32 Library - linker error when compiling in DEBUG mode

Forum : ARM

Original Post
Post Information Post
July 31, 2008 - 1:17pm
Guest

Hi,

I'm relatively new to Raisonance tools and STM32 library. I'm working on the STM32F10X-128K-EVAL board. I was searching the forum but have not found anybody was describing similar problem.

When I try to compile the Lib_DEBUG example, i get the following linker error:
Z:\Lib_DEBUG\main.o: In function `main':
Z:\Lib_DEBUG/main.c:54: undefined reference to `debug'
collect2: ld returned 1 exit status

When I turn off the debug mode (comment out the DEBUG definition in stm32f10x_conf.h), it compiles properly.
//#define DEBUG 1

What am I doing wrong? I have found the debug() function defined in stm32f10x_lib.c. It seems ok and should be visible to linker without any problems. The same problem occurs when compiling any of STM32 library examples in DEBUG mode.

I would be grateful for any help.

Replies
Post Information Post
+1
0
-1
August 1, 2008 - 10:06am
Guest

Hey, has everyone used the STM32Lib in DEBUG mode under Ride 7? Does it compile on your machines?

+1
0
-1
August 1, 2008 - 2:58pm
Guest

Hello

Make sure that stm32f10x_lib.c is included in your project. Or if you use .lib files - make sure that in "Project->Properties->Application Options->Directories->Library Directories" there is a path to appropriate .lib file included.

Good Luck !

+1
0
-1
August 4, 2008 - 9:56am
Guest

Thank you. Finally I resolved it!

Probably it was caused by some conflicts between the old and the new version of ST library, that I recently installed. I unchecked "ST Library" in linker options and manually added all the necessary .c files. Next I removed the default include path, that was pointing to the old ST Library files and replaced it with my own. Now it compiles well, either in debug or normal (release) mode.

Best regards,
peu