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) Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta) (Read 17477 times)
Julian Sanin
Junior Member
**
Offline


Posts: 10
Joined: Dec 2nd, 2018
Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Dec 2nd, 2018 at 7:05pm
Print Post  
Hello,

I'm working on a project with a recent version of the Marlin firmware (https://github.com/MarlinFirmware/Marlin/tree/261c6f4b96541435de786ddbafd491bc2a...) and it compiles fine in Arduino 1.8.7 (and 1.9.0 Beta Build 88) but I get errors with the Visual Micro plugin. I think the changed folder structure of the Marlin project screws up the compiling process.

With all default VM options I get:
Code
Select All
error*: n.cpp: No such file or directory
warning*: -x c++ after last input file has no effect
fatal error*: no input files
   compilation terminated
 


And with 'Deep Search' for libraries disabled I get at one point:
Code
Select All
error*: n.cpp: No such file or directory
fatal error*: no input files
   compilation terminated
 



I was using the current release of VM 1811.24.0 in Visual Studio 2017 Community 15.9.3.
See also attached logs of the compile process with and without deep search enabled.

Cheers Julian
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #1 - Dec 2nd, 2018 at 7:38pm
Print Post  
I think you need to rename the file called Marlin.cpp to MarlinCore.cpp

There is also a thread here about Marlin here 

https://www.visualmicro.com/forums/YaBB.pl?num=1512248183/21#21

Let me know if I need to test it again Thanks
  
Back to top
WWW  
IP Logged
 
Julian Sanin
Junior Member
**
Offline


Posts: 10
Joined: Dec 2nd, 2018
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #2 - Dec 2nd, 2018 at 8:46pm
Print Post  
Tim@Visual Micro wrote on Dec 2nd, 2018 at 7:38pm:
I think you need to rename the file called Marlin.cpp to MarlinCore.cpp

There is also a thread here about Marlin here 

https://www.visualmicro.com/forums/YaBB.pl?num=1512248183/21#21

Let me know if I need to test it again Thanks


OK with that trick the compiling step can advance but now I am getting an error at the linker (see file). The path is to long (German: Der Dateiname oder die Erweiterung ist zu lang).

I tried to find the same option as mentioned in the other post but I can not find it. Has the option maybe been renamed in the latest release of VM?

Cheers Julian
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #3 - Dec 2nd, 2018 at 8:54pm
Print Post  
Hi

Both options are there in Tools>Options>Visual Micro. I have made some corrections and expanded their names ....

Quote:
"Compiler > Build uses configuration=False" and it works

or

"Compiler > Build In Project Intermediate=True" (works too and we get much more distance to the limit)
« Last Edit: Dec 2nd, 2018 at 9:17pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Julian Sanin
Junior Member
**
Offline


Posts: 10
Joined: Dec 2nd, 2018
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #4 - Dec 2nd, 2018 at 9:07pm
Print Post  
Tim@Visual Micro wrote on Dec 2nd, 2018 at 8:54pm:
Hi

Both options are there in Tools>Options>Visual Micro. I have made some corrections and expanded their names ....

Quote:
"Compiler > Build uses configuration=False" and it works

"Compiler > Build In Project Intermediate=True" (works too and we get much more distance to the limit)


Thanks, but with both option set as suggested I get now a different error. Something like:

Code
Select All
serial.cpp:23: In file included from

serial.h: 24:36: fatal error: ..\inc\MarlinConfigPre.h: No such file or directory
   compilation terminated 


and it continues... looks like we found a new edge case.
« Last Edit: Dec 2nd, 2018 at 9:08pm by Julian Sanin »  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #5 - Dec 2nd, 2018 at 9:18pm
Print Post  
Switch off "Build uses configuration" if you are using Build In Project Intermediate=

see if that helps
« Last Edit: Dec 3rd, 2018 at 9:21pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Julian Sanin
Junior Member
**
Offline


Posts: 10
Joined: Dec 2nd, 2018
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #6 - Dec 3rd, 2018 at 7:47am
Print Post  
Tim@Visual Micro wrote on Dec 2nd, 2018 at 9:18pm:
Switch off "Build uses configuration" if you are using Build In Project Intermediate=

see if that helps


I tried now all four combinations. With Build in Project Intermediate disabled I get till to the linking step regardless which flag is set for Build uses configuration.

As soon I enable Build in Project Intermediate I get errors already at the compile step. Again regardless which flag is set for Build uses configuration.
« Last Edit: Dec 3rd, 2018 at 9:21pm by Tim@Visual Micro »  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #7 - Dec 3rd, 2018 at 11:42am
Print Post  
let's just stick with intermediate

What is your intermediate folder set to in project properties?
  
Back to top
WWW  
IP Logged
 
Julian Sanin
Junior Member
**
Offline


Posts: 10
Joined: Dec 2nd, 2018
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #8 - Dec 3rd, 2018 at 6:31pm
Print Post  
Tim@Visual Micro wrote on Dec 3rd, 2018 at 11:42am:
let's just stick with intermediate

What is your intermediate folder set to in project properties?


I have got this setting $(Configuration)\ for Intermediate Directory. See also attached image.
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #9 - Dec 3rd, 2018 at 6:36pm
Print Post  
try taking the \ off the end of the intermediate to see if that helps

Can you also find where the .h is located that the compiler can't find?
  
Back to top
WWW  
IP Logged
 
Julian Sanin
Junior Member
**
Offline


Posts: 10
Joined: Dec 2nd, 2018
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #10 - Dec 3rd, 2018 at 8:20pm
Print Post  
Tim@Visual Micro wrote on Dec 3rd, 2018 at 6:36pm:
try taking the \ off the end of the intermediate to see if that helps

Can you also find where the .h is located that the compiler can't find?


There is no change without the \ and I get the same errors.

The first .h file where the compilation terminates is:
Code
Select All
serial.cpp:23: In file included from

serial.h: 24:36: fatal error: ..\inc\MarlinConfigPre.h: No such file or directory
   compilation terminated 


and can be found in following locations:
  1. C:\Files\Work\arduino\Marlin\Marlin\src\inc\MarlinConfigPre.h from the source code itself
  2. C:\Files\Work\arduino\Marlin\Marlin\Release\src\inc\MarlinConfigPre.h from the intermediate build folder I suppose (actually from the first time when I try to build it)
  3. C:\Files\Work\arduino\Marlin\Marlin\Release\Release\src\inc\MarlinConfigPre.h same as above but from the second attempt to build it
  4. Pre.h third build ect. I do not think that should be like this ...

Basically every time I execute a build I get an extra Release folder.
« Last Edit: Dec 3rd, 2018 at 8:23pm by Julian Sanin »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #11 - Dec 3rd, 2018 at 9:23pm
Print Post  
I think I confused things with my response about the two tools>Options. you can only use one of them and for now use the "Build uses configuration"

After that make sure the \inc folder and containing files is included in your project. above the solution explorer is "show all files" which shows actual folder. make sure the src folder and all children are included in the project. if not right click and exclude then re-include the src folder which should go though and include all files or highlight CTRL+Select what you want to  include.
  
Back to top
WWW  
IP Logged
 
Julian Sanin
Junior Member
**
Offline


Posts: 10
Joined: Dec 2nd, 2018
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #12 - Dec 9th, 2018 at 10:06am
Print Post  
Tim@Visual Micro wrote on Dec 3rd, 2018 at 9:23pm:
I think I confused things with my response about the two tools>Options. you can only use one of them and for now use the "Build uses configuration"

After that make sure the \inc folder and containing files is included in your project. above the solution explorer is "show all files" which shows actual folder. make sure the src folder and all children are included in the project. if not right click and exclude then re-include the src folder which should go though and include all files or highlight CTRL+Select what you want to  include.


I am sorry for the late reply. I had a busy week ... anyhow I tried now your suggestion.

In Tools > Options > Visual Micro I have now:
Build In Project Intermediate: False
Build Uses Configuration: True

In vMicro > Compiler
Deep Search for Libraries: Unselected
Verbose: Selected

I have noted that Excluding and Inlcuding folders takes quite some time and also produces high CPU load. After the exclude/inlcude cycle I checked if all the relevant files where without the red sign.
For safety measure I excluded the config folder containing example configuration files for each 3D printer vendor.

Never the less with this setup I get a path to long error at the linking step:

Code
Select All
Linking it all together ...
# Coping cached core 26e3f2\core.a to a

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560 -o in.ino.elf" in.cpp.o" core\serial.cpp.o"
... snip: bunch of *.cpp.o files see attached log ...
sd\usb_flashdrive\usb_host.cpp.o" .a" "-LC:\Users\Julian\AppData\Local\Temp\VMBuilds\Marlin\mega_atmega2560\Release" -lm
Der Dateiname oder die Erweiterung ist zu lang

Error linking for board Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)
Build failed for project 'Marlin'
 



So I think there is no change so far. I got this result also before without including/ecluding folders.

Do you have any other suggestions?
« Last Edit: Dec 9th, 2018 at 10:17am by Julian Sanin »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Julian Sanin
Junior Member
**
Offline


Posts: 10
Joined: Dec 2nd, 2018
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #13 - Dec 9th, 2018 at 10:22am
Print Post  
Julian Sanin wrote on Dec 9th, 2018 at 10:06am:
Code:

Linking it all together ...
# Coping cached core 26e3f2\core.a to a

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560 -o in.ino.elf" in.cpp.o" core\serial.cpp.o"
... snip: bunch of *.cpp.o files see attached log ...
sd\usb_flashdrive\usb_host.cpp.o" .a" "-LC:\Users\Julian\AppData\Local\Temp\VMBuilds\Marlin\mega_atmega2560\Release" -lm
Der Dateiname oder die Erweiterung ist zu lang

Error linking for board Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)
Build failed for project 'Marlin'
 



Intresting enough Arduino IDE 1.8.7 uses shorther paths:
Code
Select All
Linking everything together...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-gcc" -Wall -Wextra -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560 -o "C:\\Users\\Julian\\AppData\\Local\\Temp\\arduino_build_944023/Marlin.ino.elf" "sketch\\Marlin.ino.cpp.o" "sketch\\src\\HAL\\HAL_AVR\\HAL.cpp.o"
... snip: bunch of *.cpp.o files see attached log ...
"sketch\\src\\sd\\usb_flashdrive\\usb_host.cpp.o" "core\\core.a" "-LC:\\Users\\Julian\\AppData\\Local\\Temp\\arduino_build_944023" -lm 

  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #14 - Dec 9th, 2018 at 12:44pm
Print Post  
Good idea, I will strip the build folder from the object paths during link.

ps: You can set your build folder to be a shorter path via "tools>options>visual micro>compiler>temp build folder"
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #15 - Dec 9th, 2018 at 1:46pm
Print Post  
There is an interim update (1812.9) in the release section of this forum that should resolve the linker path length issue.

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Thanks for the report.
  
Back to top
WWW  
IP Logged
 
Julian Sanin
Junior Member
**
Offline


Posts: 10
Joined: Dec 2nd, 2018
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #16 - Dec 9th, 2018 at 2:14pm
Print Post  
Tim@Visual Micro wrote on Dec 9th, 2018 at 1:46pm:
There is an interim update (1812.9) in the release section of this forum that should resolve the linker path length issue.

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Thanks for the report.


OK thanks with that version it is now linking without problems:
Code
Select All
Linking it all together ...
# Coping cached core 26e3f2\core.a to a

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560 -o in.ino.elf" "Marlin.cpp.o" "src\core\serial.cpp.o"
... bunch of *.cpp.o files ...
"src\sd\usb_flashdrive\usb_host.cpp.o" .a" "-LC:\Users\Julian\AppData\Local\Temp\VMBuilds\Marlin\mega_atmega2560\Release" -lm
## recipe.objcopy.eep.pattern
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 in.ino.elf" in.ino.eep"
## recipe.objcopy.hex.pattern
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-objcopy" -O ihex -R .eeprom in.ino.elf" in.ino.hex"

Program Marlin size: 52.164 bytes (used 21% of a 253.952 byte maximum) (72,66 secs)
Minimum Memory Usage: 2494 bytes (30% of a 8192 byte maximum) 

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Marlin v2.0.x does not compile with VM with Arduino 1.8.7 (and 1.9.0 beta)
Reply #17 - Dec 9th, 2018 at 2:19pm
Print Post  
Great thanks again for the info
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint