ERROR avr studio 6.2 cannot find -lobjc ,ld returned 1 exit

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

Hi I have been working on my PC with windows 7 32 bit using Atmel studio6.2 for a quite long a time . I have builded projects using atmega2560 in my PC. Now im trying to shift the project to laptop which have windows 10 64 bit so i copied the project folder to the laptop , and i installed the avr studio6.2 the same version on the laptop. Now i tried to open and build the project in my laptop after the build the following  ERROR pops up. 

 

cannot find -lobjc

ld returned 1 exit status               File - collect2.exe

 

 

I cannot proceed further kindly help me out.

 

Thankyou

Nagaraj JP

Last Edited: Fri. Jun 19, 2020 - 01:56 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well the command -lobjc actually means "look for and link to a file called libobjc.a". So presumably you had such a file on the previous machine and it has not been carried over the new installation. Could it have been located in the system link directories?

 

I just checked an AS7 installation:

C:\Program Files (x86)\Atmel\Studio\7.0>dir libobjc.a /s
 Volume in drive C is OSDISK
 Volume Serial Number is 7AF3-B2D0
File Not Found

C:\Program Files (x86)\Atmel\Studio\7.0>

so it seems this is NOT a standard file. Could this be something you have built previously as a static lib? The lib name sounds like it might have something to do with "Object C" perhaps?

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


Thankyou i found the libobjc.a in the linker option

 

 

I deleted the file libobjc.a file from the linker option in laptop and then i build it and the build was succeeded, will this removal of the file will make any impact of the project because in my previous versions in my PC there was no issues in building the project with the libobjc.a file linked.

 

thankyou.

Nagaraj JP

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

If you remove a lib from the list and it still builds without link errors then it does seem to suggest nothing in the lib was being linked against so it should be OK.

 

But I see other problems there too: 

 

1) You should not need to list libc.a as there is an implicit link against that anyway.

 

2) Also you have BOTH libscanf_min.a and libscanf_flt.a listed. You can't have both. It should be one or the other depending on whether you want minimal or full float support and, in fact there is a third choice which is to not list either in which case it uses a default implementation that is half way between those extremes.

 

I wonder if this all stems from you using the (Seriously buggy!) AS 6.2? You may find things configured better in AS 7.

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

thankyou

 

You should not need to list libc.a as there is an implicit link against that anyway.

ok i will check by removing libc.a also

 

Also you have BOTH libscanf_min.a and libscanf_flt.a listed. You can't have both. It should be one or the other depending on whether you want minimal or full float support and, in fact there is a third choice which is to not list either in which case it uses a default implementation that is half way between those extremes.

 ok I will fix this one also.

 

I wonder if this all stems from you using the (Seriously buggy!) AS 6.2? You may find things configured better in AS 7.

 

ok i will try AS 7 as well thankyou

Nagaraj JP