How to repair in the build error.

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I got a sample program project folder made in Atmel Studio 6 from my friend.

 

But,a build error happens in my Atmel Studio 6.

 

Error    4    cannot find -lCC1101        1    1    unlock
Error    1    cannot find -lCC1101_128        1    1    MainUnit
Error    3    expected ';' before '}' token    C:\mywork\source\CarWatch\branches\firmware_20141114\RemoteControl\port.c    26    1    RemoteControl
Error    2    ld returned 1 exit status    collect2.exe    0    0    MainUnit
Error    5    ld returned 1 exit status    collect2.exe    0    0    unlock

 

About error 3,I understood that there was not a comma in the code was able to revise it.

But, about other errors,I am not found even if I search the cord of the description error.

 

Would you tell me something work that I should do elsewhere?

 

 

(Folder constitution)

 

CarWatch.atsln     ATMEL Studio 6.2 Solution File

+CC1101

|       +CC1101.cproj

|       +some files

|

+CC1101_128

|         +CC1101_128.cproj

|         +some files

|

+include

|     +some files

|

+MainUnit

|      +MainUnit.cproj

|      +some files

|

+RemoteControl

|      +RemoteControl.cproj

|      +some files

|

+unlock

      +unlock.cproj

      +some files

 

There are five projects in this solution.

 

・It succeeds without .hex file when I build only with CC1101.cproj,CC1101_128.cproj.

・It succeeds with .hex file when I build only with MainUnit.cproj.

・It have error when I build only with RemoteControl.cproj,unlock.cproj.

 

Thanks.

 

 

 

 

 

This topic has a solution.

kenji maehara

Last Edited: Sat. Nov 15, 2014 - 09:20 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well your first action should be to edit port.c and see what's actually on line 26.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi clawson,

Thank you for your advice.

 

I repaired a cord and built.

 

Error    1    cannot find -lCC1101        1    1    RemoteControl
Error    2    ld returned 1 exit status    collect2.exe    0    0    RemoteControl

 

 

Would you tell me what you should do elsewhere?

 

 

 

 

 

 

 

kenji maehara

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Personally I prefer the raw build output rather than this way that Atmel choose to present it. With the raw output you can usually google for the exact wording of an error and find lots of advice about what it means (usually on stackoverflow.com).

 

Anyway your remaining error is a linker error. There's supposed to be a pre-build library file called libCC1101.a and the -lCC1101 command tells the linker to link against this. The problem is the linker cannot find that library. The usual solution is to use the -L option to specify a (usually relative) path to tell the linker where the libCC1101.a file is located.

 

So I'd start by making sure you DO have that file. If you do then you need to add a -L to the linker to tell it where to look for it.

 

I think Studio "linker" options has a "directories" or similar entry in the configuration in which you tell it where to look for libraries. All this does is add -L's to the build commands.