Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
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....
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
Odd Complie Error on blink sketch. (Read 4489 times)
Brandon L
Newbies
*
Offline



Posts: 8
Texas
Odd Complie Error on blink sketch.
Nov 23rd, 2015 at 6:30pm
 
I am have just installed the latest Arduino IDE (1.6.6) and the VM update (Arduino for Visual Studio 1.0).  I was having trouble loading anything to any board.  So I am no simply trying to load the blink sketch to a OSEPP Uno U3.  It works using the Arduino IDE, but using VS, I get the following compile error:
Compiling 'Test' for 'Arduino/Genuino Uno'
Build folder: file:///C:/Users/p0028207/AppData/Local/V.Micro/Arduino/Builds/Test/uno
Summary: Header=1 Prototypes=5 Imports=0
Additional Defines:
Architecture Tools: C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/
Sketchbook: file:///C:/Users/p0028207/Documents/Arduino
Core Include Paths
Include Path 'C:\Users\p0028207\Documents\Arduino\Test'
Include Path 'C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino'
Include Path 'C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard'
Build Core Paths: C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=166 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I"C:\Users\p0028207\Documents\Arduino\Test" -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\p0028207\AppData\Local\V.Micro\Arduino\Builds\Test\uno\Test.cpp" -o "C:\Users\p0028207\AppData\Local\V.Micro\Arduino\Builds\Test\uno\Test.cpp.o"
Test.ino:In function 'void setup()
Blink.ino:18:6: error: redefinition of 'void setup()
:void setup() {
Test.ino:18:6: error: 'void setup()' previously defined here
:void setup() {
Test.ino:In function 'void loop()
Blink.ino:24:6: error: redefinition of 'void loop()
:void loop() {
Test.ino:24:6: error: 'void loop()' previously defined here
:void loop() {
Error compiling project sources


Any suggestions here would be helpful.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Online



Posts: 10388
United Kingdom
Re: Odd Complie Error on blink sketch.
Reply #1 - Nov 23rd, 2015 at 6:34pm
 
Does your test in the arduino ide include both the test.ino and the blink.ino?

It looks like you have setup() and loop() methods in both .ino files?
Back to top
 
WWW  
IP Logged
 
Brandon L
Newbies
*
Offline



Posts: 8
Texas
Re: Odd Complie Error on blink sketch.
Reply #2 - Nov 23rd, 2015 at 6:37pm
 
Yep,
same copy and paste.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Online



Posts: 10388
United Kingdom
Re: Odd Complie Error on blink sketch.
Reply #3 - Nov 23rd, 2015 at 6:41pm
 
Thanks for the info.

Please zip and email the two sketch/projects to info[at]visualmicro.com

Back to top
 
WWW  
IP Logged
 
Brandon L
Newbies
*
Offline



Posts: 8
Texas
Re: Odd Complie Error on blink sketch.
Reply #4 - Nov 23rd, 2015 at 6:42pm
 
Oh, I just caught your meaning.  In VS I had open the test.ino to which I copied the code from blink.ino. From your question, I gather it is trying to run both.  Isn't this new?  I don't remember the old version of VM compiling anything but the top sketch.

When I close everything, and reopen just blink it uploads just fine.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Online



Posts: 10388
United Kingdom
Re: Odd Complie Error on blink sketch.
Reply #5 - Nov 23rd, 2015 at 6:52pm
 
Ah I see thanks.

Yes the new system allows you to use the visual studio project as it was designed to be used. Items in the project will be compiled except for know items such as when you click "project>show all core and lib sources"

So that explains why it is also compiling the blink.ino

You can switch off the new functionality in "tools>options>visual micro>compatibility" but hopefully you find it more powerful and easier to organize being able to use sub folders.

Don;t forget that you can add files and folders directly to the solution (not project) to create collections of "reference/example code". Solution items are ignored by all compilers.

You can also right click source code and then click "Exclude from project".

Hope this help
Back to top
« Last Edit: Nov 23rd, 2015 at 6:53pm by Visual Micro »  
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print