EEVblog Electronics Community Forum
Products => Computers => Programming => Topic started by: basinstreetdesign on April 30, 2021, 03:47:52 am
-
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?
-
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 (https://www.avrfreaks.net/forum/if-you-have-problem-5661-upgrade-62?name=PNphpBB2&file=viewtopic&t=124239)
-
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.
-
Have you added all the extra files to the project?
The IDE needs to know to add them to the makefile.
-
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 (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 (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.
-
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.