Linker problem LPCxpresso

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linker problem LPCxpresso

1,944 Views
martinbal
Contributor I

I have two similar projects. One is targeted for an LPC11U37 consisting of a main program and 5 libraries, the other is aimed aut LPC11U67 with the software but two extra libs.

The first one compiles and links, the second one give an link error.

The difference is in the objects.mk file.

The first one is like:

USER_OBJS := 

LIBS := -lDSSS_ARM0_lib -lGeneral_ARM0_lib -lI2C_ARM0_lib -lVORN_lib -lCMSIS_CORE_LPC11Exx

the second one is like:

USER_OBJS := 

LIBS := -l"" -l"" -l"" -l"" -l"" -l"" -l""

resulting in this error:

Invoking: MCU Linker arm-none-eabi-gcc -nostdlib -static -L"W:\PROJECTEN\LPC11XX\Zorghorloge\USB11U6x_lib\Release" -L"W:\PROJECTEN\LPC11XX\Zorghorloge\CMSISv2p00_LPC11Uxx\Release" -L"W:\PROJECTEN\LPC11XX\Zorghorloge\VORN_lib\Release" -L"W:\PROJECTEN\LPC11XX\Zorghorloge\I2C_ARM0_lib\Release" -L"W:\PROJECTEN\LPC11XX\Zorghorloge\General_ARM0_lib\Release" -L"W:\PROJECTEN\LPC11XX\Zorghorloge\FAT_fs\Release" -L"W:\PROJECTEN\LPC11XX\Zorghorloge\DSSS_ARM0_lib\Release" -Xlinker -Map="Zorghorloge.map" -Xlinker --gc-sections -mcpu=cortex-m0 -mthumb -T "Zorghorloge_Release.ld" -o "Zorghorloge.axf"  ./src/NTM_kernel/Associatie.o ./src/NTM_kernel/Functie.o ./src/NTM_kernel/Init_I2C.o ./src/NTM_kernel/NTM_OS.o ./src/NTM_kernel/NTM_init.o ./src/NTM_kernel/NTM_main.o ./src/NTM_kernel/Parsing.o ./src/NTM_kernel/Slapen.o ./src/NTM_kernel/TR_service.o ./src/NTM_kernel/Timing68.o ./src/NTM_kernel/Transceive.o ./src/NTM_kernel/Uitvoer.o ./src/NTM_kernel/aeabi_romdiv_patch.o ./src/NTM_kernel/cr_startup_lpc11u6x.o ./src/NTM_kernel/crp.o  ./src/API_support/Buzzer.o ./src/API_support/DMA.o ./src/API_support/Events.o ./src/API_support/Hartrate.o ./src/API_support/LCD_routines.o ./src/API_support/RTC68.o ./src/API_support/Temperature.o ./src/API_support/Upload.o ./src/API_support/shock.o  ./src/API/API_service.o ./src/API/Boggle_init0.o ./src/API/SAPI_service.o ./src/API/VORN_service2.o   -l"" -l"" -l"" -l"" -l"" -l"" -l""

arm-none-eabi-gcc.exe: error: missing argument to '-l' make: *** [Zorghorloge.axf] Error 1.

I cannot find the reason why, so we are stuck right before production.

Please help. Martin Bal, Ninthway CV

Labels (1)
0 Kudos
6 Replies

1,142 Views
lpcxpresso_supp
NXP Employee
NXP Employee

So what is shown in the pages of the Linker settings in Project Properties? Are all your libraries listed correctly?

In particular check that both "Library search path (-L)" and "Libraries (-l)" are specified appropriately.

There is also some background information that may be of use at:

Creating and Linking to Library Projects 

Regards,

LPCXpresso Support

0 Kudos

1,142 Views
martinbal
Contributor I

After changing the notation of the libraries in the style of the smart update

The objects.mk looks like:

################################################################################

  1. Automatically-generated file. Do not edit!

################################################################################

USER_OBJS :=

LIBS := -lCMSISv2p00_LPC11Uxx -lI2C_ARM0_lib -lDSSS_ARM0_lib -lFAT_fs -lGeneral_ARM0_lib -lUSB11U6x_lib -lVORN_lib

And that is the way it should look like I guess.

It does not yet lead to a object file, because of a missing object.

As a matter of fact the other project has the same notation, so it is clear in the libraries field one should strictly use the name of the lib directory and no reference to workspace.

I suppose this solves the problem.

Kind regards

Martin Bal

0 Kudos

1,142 Views
martinbal
Contributor I

Thank you for your response.

This is what is stated in the Linker properties tab.

Kind regards

Martin Bal

0 Kudos

1,142 Views
tomaskrysl
Contributor I

I am not sure if the -l section is correct. For all of my projects there is only library name without path. So instead of "${workspace_loc:/Lib_CMSISv1p30_LPC17xx}" just Lib_CMSISv1p30_LPC17xx. And so on. Search paths are specified in -L.

But we are still using LPCXpresso 7.5.0 so I don't know for newer versions.

If the full paths are necessary for some reason then I suppose they are not correct because your workspace_loc already includes the Zorhorloge subfolder.

0 Kudos

1,142 Views
martinbal
Contributor I

Thank you for your answer,

Indeed Compiler include (-l) accepts “workspace_loc…”

Linker settings include (-l) only accept library name; library search path requires “workspace_loc…” A bit confusing.

Smart update installs the library names in the proper way.

In that case the makefile contains the names of the libraries instead of empty parameters.

The mistake was created by LPCxpresso during an editing of the library name. It suggested the prefix with workspace etc.. It should not have done that.

Kind regards

Martin Bal

Why do you still use version 7.5?

You can simply download the last version. It will not override the old one and at start of the new one you simply fill in the location of your workspace and you have a version with less bugs.

KR

MB

Van: tomaskrysl

Verzonden: dinsdag 30 augustus 2016 21:40

Aan: Martin Bal

Onderwerp: Re: - Linker problem LPCxpresso

NXP Community <https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg>

Linker problem LPCxpresso

reply from Tomas Krysl<https://community.nxp.com/people/tomaskrysl?et=watches.email.thread> in LPCXpresso IDE - View the full discussion<https://community.nxp.com/message/827206?commentID=827206&et=watches.email.thread#comment-827206>

0 Kudos

1,142 Views
tomaskrysl
Contributor I

"Why do you still use version 7.5?"

Never touch a running business:)

0 Kudos