Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 

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 and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Visual Studio 2022 upgrade - issues with compiling simple sketch (Read 653 times)
Arnd
Newbies
*
Offline



Posts: 5
Europe & Caribbean
Visual Studio 2022 upgrade - issues with compiling simple sketch
Dec 27th, 2021 at 2:50pm
 
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++):
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
 
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline



Posts: 11536
United Kingdom
Re: Visual Studio 2022 upgrade - issues with compiling simple sketch
Reply #1 - Dec 27th, 2021 at 3:51pm
 
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
 

Tim Leek
home
WWW  
IP Logged
 
Arnd
Newbies
*
Offline



Posts: 5
Europe & Caribbean
Re: Visual Studio 2022 upgrade - issues with compiling simple sketch
Reply #2 - Dec 28th, 2021 at 7:03am
 
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
 
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print