Author Topic: Trouble adding existing files to project in Atmel Studio 5.1 - FIXED  (Read 528 times)

0 Members and 1 Guest are viewing this topic.

Offline basinstreetdesign

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: ca
I have 4 C files that make a project for the ATMEGA16 and am using Studio5.1 to compile them but it will compile only 1 file and ignores the rest. Can anybody suggest what I can do to add the other 3 files to the program so that they are compiled and linked?
« Last Edit: May 01, 2021, 05:58:26 pm by basinstreetdesign »
STAND BACK!  I'm going to try SCIENCE!
 

Offline MIS42N

  • Frequent Contributor
  • **
  • Posts: 276
  • Country: au
Re: Trouble adding existing files to project in Atmel Studio 5.1
« Reply #1 on: April 30, 2021, 07:03:44 am »
Is that version 10 years old or more? Maybe a later version will work for you. https://www.avrfreaks.net/forum/if-you-have-problem-5661-upgrade-62?name=PNphpBB2&file=viewtopic&t=124239
 

Offline basinstreetdesign

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: ca
Re: Trouble adding existing files to project in Atmel Studio 5.1
« Reply #2 on: April 30, 2021, 01:34:28 pm »
I just finished a project using this compiler and it had 5 source files.  No problem compiling the lot and producing the *elf file to download to the target.  But now with a new project it can see only one file, the one with main{} in it.  I used the >FILE>NEW>FILE menu command to create files as I thought I had before, and it will do so but the compiler ignores them.  Its running on a Win XP machine I have just for programs like this.
STAND BACK!  I'm going to try SCIENCE!
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 8125
  • Country: nz
Re: Trouble adding existing files to project in Atmel Studio 5.1
« Reply #3 on: April 30, 2021, 01:39:56 pm »
Have you added all the extra files to the project?
The IDE needs to know to add them to the makefile.
« Last Edit: April 30, 2021, 01:41:46 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Syntax Error

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: gb
Re: Trouble adding existing files to project in Atmel Studio 5.1
« Reply #4 on: April 30, 2021, 01:47:13 pm »
Nothing wrong with XP :)

I suspect you may need to first convert the other files into shared libraries(?) A bit about this:
https://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html
And on importing precompiled libraries into AS
https://www.avrfreaks.net/forum/how-import-libraries-my-project-atmel-studio-7

To help, make sure the files are in the same directory as main.
 

Offline basinstreetdesign

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: ca
Re: Trouble adding existing files to project in Atmel Studio 5.1
« Reply #5 on: May 01, 2021, 05:56:33 pm »
Have you added all the extra files to the project?
The IDE needs to know to add them to the makefile.

That's the problem - there seems to be no faculty to add files to the project.
Anyway - Fixed. I patched the *cproj file to list all 4 source files. After another small fixup to one of the source files it compiled and linked them all to produce the *.elf file which I download to the target.  It seems to run since the processor is producing some signals that indicate its working.
STAND BACK!  I'm going to try SCIENCE!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf