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 Linker error (Read 3542 times)
AndyInSurrey
Newbies
*
Offline


Posts: 2
Joined: Sep 4th, 2017
Linker error
Sep 4th, 2017 at 8:55am
Print Post  
I've created a sketch in VS2015 with Visual Micro.  It compiles ok and then I get this error when linking:

Code (C++)
Select All
Compiling 'keypad' for 'Arduino/Genuino Uno'


Error linking for board Arduino/Genuino Uno
Build failed for project 'keypad'
ccX9FMtf.ltrans0.ltrans.o*: In function main
main.cpp:43: undefined reference to setup
main.cpp:46: undefined reference to loop

collect2.exe*: error: ld returned 1 exit status
Toolchain reload complete
 



The sketch compiles and links ok with the Arduino IDE.  Any suggestions on what to do to resolve this please?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error
Reply #1 - Sep 4th, 2017 at 1:43pm
Print Post  
Hi,

Please zip and email the project code to info[at]visualmicro.com

Probably just the .ino will do but useful to have all just in case

Thanks



  
Back to top
WWW  
IP Logged
 
AndyInSurrey
Newbies
*
Offline


Posts: 2
Joined: Sep 4th, 2017
Re: Linker error
Reply #2 - Sep 4th, 2017 at 1:59pm
Print Post  
I've created a fresh project and added my existing files into it.  It now compiles and links.  Thanks for the offer to check it.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error
Reply #3 - Sep 4th, 2017 at 2:14pm
Print Post  
Thanks for the update. Maybe the problem was one of these two things

1) The project_name.ino was not "included" in the solution tree (it has two views physical files on disk and included code)

2) The project contained a project_name.cpp which would be used as an override and all .ino source will be ignored. Therefore the project_name.cpp would require a void setup() and void loop()

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