Question

I'm creating a simple program to familiarize myself with Atmel Studio 6 (running on Win 7 X64), using the ASF supplied libraries/drivers for a SAM4S microcontroller. In compiling, I get several (19) undefined reference errors on the startup_sam4s.c file. I have heard that this usually implies a file missing from project/missing linker files, but I'm (reasonably) confident that I have added all required files into my solution.

The errors are all of the "undefined reference to _szero" sort, and are precisely the same as mentioned in this bug report (albeit with a different microcontroller series). I've followed the fix instructions, but to no avail. I've also tried reinstalling, upgrading to v6.1 (which is supposed to fix the aformentioned bug), and changing permissions to the linker script folder (it appeared not to be able to find the linker script locations), and commenting everything out to make sure that it was not my program that caused the issue.

I would greatly appreciate it if someone could give a few suggestions as to what might be causing this issue. Thanks in advance.

EDIT: Hmm. Rebooted machine and started Atmel Studio again, then went through the bug fix process again, and now I only get three errors: Undefined Reference To _write in Writer.c, Undefined Reference To _read in Readr.c, and one that I had before, ld returned 1 exit status.

Was it helpful?

Solution

Oddly enough, after reinstalling 6.1 on a different computer and creating a new solution with my existing main.c file, it worked perfectly: then reinstalling on previous computer and transferring solution to it fixed it permanently.

OTHER TIPS

I was able to make the following error messages go away by not calling printf():

undefined reference to `_write`    writer.c
undefined reference to `_read`     readr.c
ld returned 1 exit status          collect2.exe
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top