Jump to content

uGFX(RAW32) + STM32F429-Discovery linking error


Recommended Posts

Posted

Hello everyone, I am attempting to use uGFX in my STM32 Project, but I have some problem now.

I  followed the instructions of uGFX Wiki Getting Started.

First, I added "include $(GFXLIB)/gfx.mk" in my makefile and defined "GFX_USE_OS_RAW32" in gfxconf.h as "TRUE". Everything was fine.

Then I added "include $(GFXLIB)/src/gos/gos.mk" and "OPT_OS = raw32" in makefile, and something went wrong.

The following picture is the output of terminal.

I failed to link all objective files, and it tells me "xxx.c:#: multiple definition of `functioin()', xxx.c:#:  first defined here". "xxx.c" means the same source file.

And this is my arm-none-eabi-ld option : "LDFLAGS = -lnosys -fno-exceptions -fdata-sections"

I hope the community could solve my problem.  I will be very appreciate for any help.
 

Selection_001.jpg

Posted

Hello @poting and welcome to the µGFX community!

 

35 minutes ago, poting said:

First, I added "include $(GFXLIB)/gfx.mk" in my makefile and defined "GFX_USE_OS_RAW32" in gfxconf.h as "TRUE". Everything was fine.

That's not only fine but also correct.

 

35 minutes ago, poting said:

Then I added "include $(GFXLIB)/src/gos/gos.mk" and "OPT_OS = raw32" in makefile, and something went wrong.

That's wrong - don't do that. You already included everything in the first step. Now you're including some stuff that is included in $(GFXLIB)/gfx.mk again manually. So you have some stuff twice. That's why you get the double definition errors.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...