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
Normal Topic Visual Studio 2022 upgrade - issues with compiling simple sketch (Read 1179 times)
Arnd
Newbies
*
Offline


Posts: 5
Location: Europe & Caribbean
Joined: Jan 12th, 2019
Visual Studio 2022 upgrade - issues with compiling simple sketch
Dec 27th, 2021 at 2:50pm
Print Post  
I recently upgraded from Visual Studio 2021 to Visual Studio 2022 and have some strange new issues. The following Sketch compiles using the Arduino IDE but not in VS2022 with Visual Micro when set to "Arduino UNO", but has no problems when set to "Arduino micro". The error occurs both when doing a "debug" or a "release" build.

Code (C++)
Select All
void setup() {
  Serial.begin(115200);
} // of method setup()

void loop() {
  Serial.println("\nHello World\n");
} // of method loop() 



The error from the "Micro Build" is:
Quote:
Compiling 'Sketch2' for 'Arduino Uno'
Build Folder: "file:///C:/Users/Arnd/AppData/Local/Temp/VMBuilds/Sketch2/uno/Release"
cc25bOqI.ltrans0.ltrans.o*: (.rodata+0x6): undefined reference to Print::write(unsigned char const*, unsigned int)
crtatmega328p.o: (.init9+0x0): undefined reference to main

Error linking for board Arduino Uno
Build failed for project 'Sketch2'
 
collect2.exe*: error: ld returned 1 exit status


What could be happening here?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio 2022 upgrade - issues with compiling simple sketch
Reply #1 - Dec 27th, 2021 at 3:51pm
Print Post  
It's possible you have a partial or old board manager avr core installed. However it is always difficult to answer build questions without the information requested in the yellow box above.

  
Back to top
WWW  
IP Logged
 
Arnd
Newbies
*
Offline


Posts: 5
Location: Europe & Caribbean
Joined: Jan 12th, 2019
Re: Visual Studio 2022 upgrade - issues with compiling simple sketch
Reply #2 - Dec 28th, 2021 at 7:03am
Print Post  
Hello Tim,

I forgot to paste that output to the end of my post yesterday. I just went back to copy that and decided, based on your comment, to do a "Build->Build full program database file for solution" and "Build->clean solution" to see if that cleared out any pre-existing issues.

It did. The error is now gone and this sketch compiles with nary an issue.

Thanks.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint