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) Compile error when using visual micro in VS2013 - MultiWii - SOLVED (Read 10786 times)
flankss
Newbies
*
Offline


Posts: 1
Joined: Oct 31st, 2015
Compile error when using visual micro in VS2013 - MultiWii - SOLVED
Oct 31st, 2015 at 2:51am
Print Post  
I failed to use the visual micro to compile multiwii 2.4 original code. The compiling output information shows:
MultiWii.cpp.o:In function `go_disarm()'
MultiWii.cpp.o:In function `go_disarm()'
MultiWii.cpp.o:In function `go_disarm()'

MultiWii.cpp.o:In function `go_disarm()'
MultiWii.cpp.o:(.data.vbatMin+0x0): multiple definition of `vbatMin'
MultiWii.cpp.o:(.data.vbatMin+0x0): first defined here
MultiWii.cpp.o:In function `go_disarm()'
MultiWii.cpp.o:(.progmem.data.boxids+0x0): multiple definition of `boxids'
MultiWii.cpp.o:(.progmem.data.boxids+0x0): first defined here
MultiWii.cpp.o:(.progmem.data.boxnames+0x0): multiple definition of `boxnames'
MultiWii.cpp.o:(.progmem.data.boxnames+0x0): first defined here
MultiWii.cpp.o:(.progmem.data.pidnames+0x0): multiple definition of `pidnames'
MultiWii.cpp.o:(.progmem.data.pidnames+0x0): first defined here
collect2.exe*:error: ld returned 1 exit status
Error creating .elf

The same code is now problem when using Arduino IDE. And the library modified has been set false.
« Last Edit: Apr 9th, 2016 at 5:15pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compile error when using visual micro in VS2013
Reply #1 - Oct 31st, 2015 at 3:10pm
Print Post  
Please change the toolbar from "Debug/windows debug" to "Release" and try again

Please tell me which arduino ide version?

Which Visual Studio version?

Where the "original" multiwii source code is?

  
Back to top
IP Logged
 
Entropia
Newbies
*
Offline


Posts: 6
Joined: Apr 9th, 2016
Re: Compile error when using visual micro in VS2013
Reply #2 - Apr 9th, 2016 at 2:20pm
Print Post  
Hi,
I have the same problem, I get tons of this error:

MultiWii.cpp.o:In function `annexCode()
MultiWii.cpp:multiple definition of `annexCode()
ga328\MultiWii.cpp:370: first defined here

The software compiles correctly in the Arduino IDE.

The MultiWii source files are located here:

https://code.google.com/archive/p/multiwii/

Nevertheless the visual micro compiler works with an empty test sketch, so the installation should be fine...
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compile error when using visual micro in VS2013
Reply #3 - Apr 9th, 2016 at 2:29pm
Print Post  
Thanks for the link to the MultiWii source.

I got the same problem. I will look into it thanks.
« Last Edit: Apr 9th, 2016 at 3:21pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Entropia
Newbies
*
Offline


Posts: 6
Joined: Apr 9th, 2016
Re: Compile error when using visual micro in VS2013
Reply #4 - Apr 9th, 2016 at 2:30pm
Print Post  
Hi, here they are (I don't really know how they have been created and which one is the one you want...).

Thanks a lot for your support, it is very kind from you!
  

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


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compile error when using visual micro in VS2013
Reply #5 - Apr 9th, 2016 at 2:38pm
Print Post  
Found the problem. 

Notice the project has a dummy MultiWii.ino and the actual code is in MultiWii.cpp.

Normally for Arduino the .ino files are joined together into MultiWii.cpp in the temp folder.

I will prevent the creation of the temp version of MultiWii.cpp if one already exists in a project.

Hopefully that isn't such a difficult job and won't take more than a day or so.


  
Back to top
IP Logged
 
Entropia
Newbies
*
Offline


Posts: 6
Joined: Apr 9th, 2016
Re: Compile error when using visual micro in VS2013
Reply #6 - Apr 9th, 2016 at 2:47pm
Print Post  
Ohhh great!
Then as a temporary fix can I just delete the .ino file? I tried but it complains that no sketch is found named "MultiWii" when attempting to create the solution...
  
Back to top
 
IP Logged
 
Entropia
Newbies
*
Offline


Posts: 6
Joined: Apr 9th, 2016
Re: Compile error when using visual micro in VS2013
Reply #7 - Apr 9th, 2016 at 2:54pm
Print Post  
I forgot, to compile the downloaded code you need to uncomment lines 50 and 135 (for example) on the config.h header!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compile error when using visual micro in VS2013
Reply #8 - Apr 9th, 2016 at 3:19pm
Print Post  
Yes I found I has to set copter type and imu type.

You can't remove the .ino because that is how Visual micro and Arduino Ide knows it has a valid sketch project. Visual micro won't handle the compile without one.

I am just trying to change the order of things so that the .cpp in the porject overwrites the temp copy of the .cpp generated by Visual micro. Debug won't work initially but at least the standard project will build.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compile error when using visual micro in VS2013
Reply #9 - Apr 9th, 2016 at 4:01pm
Print Post  
I found when things went wrong. 

Last quarter of last year Visual Visual micro supported adding code to folders within a project. This involves reading the "included project/solution explorer" files as opposed to simply looking in the current sketch/project folder for the source codes.

You can prove this temporarily by setting "tools>options>visual micro>compatibility>compile files in project"=False

Then the project should build properly again. It's annoying that it broke last year must have been annoying for any MultiWii users!!
« Last Edit: Apr 9th, 2016 at 4:42pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Entropia
Newbies
*
Offline


Posts: 6
Joined: Apr 9th, 2016
Re: Compile error when using visual micro in VS2013
Reply #10 - Apr 9th, 2016 at 4:12pm
Print Post  
Thanks a lot for the support you're giving. I have the pro version, so I also disable the "Allow local libraries" but it still doesn't work, even if I get different errors:

Compiling debug version of 'MultiWii' for 'Arduino Mini w/ ATmega328'
core.a(HardwareSerial0.cpp.o)*:In function `__vector_18
HardwareSerial0.cpp:multiple definition of `__vector_18
328\Serial.cpp:178: first defined here
core.a(HardwareSerial0.cpp.o)*:In function `__vector_18
HardwareSerial0.cpp:multiple definition of `__vector_19
328\Serial.cpp:32: first defined here
collect2.exe*:error: ld returned 1 exit status
Error creating .elf
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compile error when using visual micro in VS2013
Reply #11 - Apr 9th, 2016 at 4:34pm
Print Post  
I think that's just the debugger interfering.

Switch the toolbar from "Debug/Local window debugger" to Release


+

I just published an update (1604.9.1) which allows you to leave the settings as they were. The project should compile.

I also just published a fix so it will work with those settings at their default = True.
« Last Edit: Apr 9th, 2016 at 4:43pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Entropia
Newbies
*
Offline


Posts: 6
Joined: Apr 9th, 2016
Re: Compile error when using visual micro in VS2013
Reply #12 - Apr 9th, 2016 at 4:37pm
Print Post  
Great it works! And thanks for the update.
How do I buy you a pizza?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compile error when using visual micro in VS2013
Reply #13 - Apr 9th, 2016 at 4:42pm
Print Post  
Great. Thanks for the update.

Reviews in the Visual Studio gallery are always appreciated thanks

https://visualstudiogallery.msdn.microsoft.com/069a905d-387d-4415-bc37-665a5ac9c...

edit:

Thanks for the review and to @flankss I am sorry I didn't spot this when you reported last year
« Last Edit: Apr 9th, 2016 at 5:17pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint