Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Error compiling first Arduino project... (Read 13418 times)
JL
Newbies
*
Offline


Posts: 8
Joined: Mar 19th, 2015
Error compiling first Arduino project...
Mar 19th, 2015 at 1:28pm
Print Post  
Hi Folks!
This is my first Visual Mictro 6.1 Project:
I do have a Visual Micro 6.1 and want to use it instead of the original Arduino IDE v1.61

When I open a Arduino *.ino file and compile it I get the following error:

Error      1      undefined reference to `main'      c:/program files (x86)/atmel/atmel toolchain/avr8 lib/avr6/crtm2560.o      1      1      Bewaesserungssteuerung
Error      2      ld returned 1 exit status      collect2.exe      0      0      Bewaesserungssteuerung

The original Arduino Project compiles and works fine!
I have not changed anything in the original *.ino file before compiling it in VM 6.1.

What is wrong?

JL
« Last Edit: Mar 19th, 2015 at 1:35pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error compiling first Arduino project...
Reply #1 - Mar 19th, 2015 at 1:37pm
Print Post  
Hi,

Few questions please.

Please show a screen shot with the project loaded.

What is in the "Micro Build" output window after compile?

Thanks

  
Back to top
IP Logged
 
JL
Newbies
*
Offline


Posts: 8
Joined: Mar 19th, 2015
Re: Error compiling first Arduino project...
Reply #2 - Mar 19th, 2015 at 1:51pm
Print Post  
Hi!
The screenshot is attached as compressed file as thee original BMP file was too large.

It includes the Output window.

JL
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error compiling first Arduino project...
Reply #3 - Mar 19th, 2015 at 1:57pm
Print Post  
Hi,

Okay I see you are using atmel studio. please close the project properties we do not use them for arduino compile.

To avoid confusion please also close the intellisense/error/warning list because it hides the Visual Micro build output which is what we need to see.

Please click "Build>Build Solution" then post the "Micro Build" output that should automatically appear. 

Thanks
  
Back to top
IP Logged
 
JL
Newbies
*
Offline


Posts: 8
Joined: Mar 19th, 2015
Re: Error compiling first Arduino project...
Reply #4 - Mar 19th, 2015 at 2:09pm
Print Post  
I guess this is the Output you are looking for:

------ Erstellen gestartet: Projekt: Bewaesserungssteuerung, Konfiguration: Debug AVR ------
Der Buildvorgang wurde gestartet.
Projekt "Bewaesserungssteuerung.cppproj" (Standardziele):
Erstellung mit der Toolsversion 2.0.
Das Ziel "PreBuildEvent" wurde übersprungen, da die Bedingung "false" war . ('$(PreBuildEvent)'!='') wurde als (''!='') ausgewertet.
Ziel "CoreBuild" in Datei "C:\Program Files (x86)\Atmel\Atmel Studio 6.1\Vs\Compiler.targets" aus Projekt sserungssteuerung.cppproj" (Ziel "Build" ist davon abhängig):
     RunCompilerTask-Aufgabe
           C:\Program Files (x86)\Atmel\Atmel Studio 6.1\shellUtils\make.exe all 
           Building target: Bewaesserungssteuerung.elf
           Invoking: AVR8/GNU Linker : 3.4.4
           "C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.1056\avr8-gnu-toolchain\bin\avr-g++.exe" -o Bewaesserungssteuerung.elf     -Wl,-Map="Bewaesserungssteuerung.map" -Wl,--start-group  -Wl,--end-group -Wl,--gc-sections -mrelax -mmcu=atmega2560 
c:/program files (x86)/atmel/atmel toolchain/avr8 lib/avr6/crtm2560.o(1,1): undefined reference to `main'
collect2.exe(0,0): ld returned 1 exit status
           make: *** [Bewaesserungssteuerung.elf] Error 1
           Der Befehl wurde mit dem Code 2 beendet.
     Die Ausführung der RunCompilerTask-Aufgabe ist abgeschlossen -- FEHLER.
Die Erstellung des Ziels "CoreBuild" im Projekt "Bewaesserungssteuerung.cppproj" ist abgeschlossen -- FEHLER.
Die Erstellung des Projekts "Bewaesserungssteuerung.cppproj" ist abgeschlossen -- FEHLER.

Fehler beim Erstellen
========== Build: 0 erfolgreich oder aktuell, Fehler bei 1, 0 übersprungen ==========

It is in German.
Essentially it says:
PreBuildEvent is skipped...

The errorlist window says:
1) undefined reference to main file: crtm2560.o
2) Id returned 1 Exit Status file: collect2.exe


The Project was initially named Ethernet1 in Arduino IDE (it still has the name ethernet1.ino)
The Projectname given in VM 6.1. is Bewaesserungssteuerung"
Does this make a Problem?

JL
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error compiling first Arduino project...
Reply #5 - Mar 19th, 2015 at 2:13pm
Print Post  
Hi,

Thanks for the info.

Yes the project name is very important. It must be the same as the [master].ino which will also be the same name as the folder.

I think the output you are seeing is because Visual Micro is no longer managing the project. So atmel studio is attempting a standard compile.

If you rename the project to be Ethernet1.ino it should start to work and you should see a different build output.

If you are unsure then please follow the first steps to create a new project as a test example

http://www.visualmicro.com/page/User-Guide.aspx?doc=index

Thanks
  
Back to top
IP Logged
 
JL
Newbies
*
Offline


Posts: 8
Joined: Mar 19th, 2015
Re: Error compiling first Arduino project...
Reply #6 - Mar 19th, 2015 at 2:50pm
Print Post  
Hi!
Thanks so far!

The err is gone after I created a new VM Project with the Bewaesserungssteuerung Name.
(I copied and renamed then the old Ethernet1 file, replacing the inital ino file just created from VM).

I got now a msg in the Output window after compiling:
--------------
System.IO.FileLoadException: Die Datei oder Assembly "Atmel.Studio.Services.Interfaces, Version=6.2.0.0, Culture=neutral, PublicKeyToken=d264112969646cc9" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)
Dateiname: 'Atmel.Studio.Services.Interfaces, Version=6.2.0.0, Culture=neutral, PublicKeyToken=d264112969646cc9'
   bei Visual.Micro.Visual.Studio.Arduino.AddInApp.CompileDo(Project oProject, Boolean IsDebugStartCommand)
   bei Visual.Micro.Visual.Studio.Arduino.AddInApp.Compile(Project oProject, Boolean IsDebugStartCommand)

WRN: Protokollierung der Assemblybindung ist AUS.
Sie können die Protokollierung der Assemblybindungsfehler aktivieren, indem Sie den Registrierungswert [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) auf 1 festlegen.
Hinweis: Die Protokollierung der Assemblybindungsfehler führt zu einer gewissen Leistungseinbuße.
Sie können diese Funktion deaktivieren, indem Sie den Registrierungswert [HKLM\Software\Microsoft\Fusion!EnableLog] entfernen.
--------------

Essentially it raises an exception:
System.IO.FileLoadException: File or Assembly "Atmel.Studio.Services.Interfaces .. or a dependancy not found

Could this be raised because I have no arduino board actualy connected or does it mean other Problems?

JL

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error compiling first Arduino project...
Reply #7 - Mar 19th, 2015 at 3:11pm
Print Post  
What version of Atmel studio are you using?
  
Back to top
IP Logged
 
JL
Newbies
*
Offline


Posts: 8
Joined: Mar 19th, 2015
Re: Error compiling first Arduino project...
Reply #8 - Mar 19th, 2015 at 3:14pm
Print Post  
version of Atmel Studio is:
6.1.2730 SP2
on W7 x64

VSIX manifest (6.1)

JL
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error compiling first Arduino project...
Reply #9 - Mar 19th, 2015 at 3:26pm
Print Post  
Hi, Atmel changed some things last year when they released 6.2 so we had to stop supporting 6.1. Sorry this wasn't clear bit 6.2 is free and supported

Thanks for your patience
  
Back to top
IP Logged
 
JL
Newbies
*
Offline


Posts: 8
Joined: Mar 19th, 2015
Re: Error compiling first Arduino project...
Reply #10 - Mar 19th, 2015 at 3:33pm
Print Post  
OK!

I will move to 6.2 ...

Thanks a lot!

JL
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error compiling first Arduino project...
Reply #11 - Mar 19th, 2015 at 3:33pm
Print Post  
If you install 6.2 then you must run the vm installer after. Click uninstall then run again and click install
  
Back to top
IP Logged
 
JL
Newbies
*
Offline


Posts: 8
Joined: Mar 19th, 2015
Re: Error compiling first Arduino project...
Reply #12 - Mar 19th, 2015 at 3:35pm
Print Post  
What is "vm installer"??

VM= virtual machine?

I never used it. I do not know it.

Can you please say a few words more...?

JL
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error compiling first Arduino project...
Reply #13 - Mar 19th, 2015 at 3:36pm
Print Post  
Visual micro  Smiley
  
Back to top
IP Logged
 
JL
Newbies
*
Offline


Posts: 8
Joined: Mar 19th, 2015
Re: Error compiling first Arduino project...
Reply #14 - Mar 19th, 2015 at 3:51pm
Print Post  
OK Tim!

I am just downloading v6.2sp2

Do I Need to uninstall my old Version before or does the installer handle it by itself?

JL
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error compiling first Arduino project...
Reply #15 - Mar 19th, 2015 at 4:44pm
Print Post  
Uninstall and reinstall after you have installed and run Atmel studio once
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint