VS Arduino
Visual Micro >> Installation & Troubleshooting >> Cant Build. OK with Arduino 1.8
https://www.visualmicro.com/forums/YaBB.pl?num=1660073907

Message started by bonky on Aug 9th, 2022 at 7:38pm

Title: Cant Build. OK with Arduino 1.8
Post by bonky on Aug 9th, 2022 at 7:38pm
As the title says.  This project builds OK on Arduino 1.8.   I do have 1.6/1.8 selected as "IDE" in
the visual micro  popup. 

  To set it up, I had to edit the .vcxproj file by hand - it was missing 16 .cpp files.

Concentrating on the very first error - I find no occurence of '__cplusplus' in the code.

[code]
1>------ Build started: Project: ~AutoRecover.T41v15, Configuration: Release|Win32 ------
1>  Band.cpp
1>Y:\Projects\Arduino\T41v15\Band.cpp : warning C4117: macro name '__cplusplus' is reserved, '#define' ignored
1>Y:\Projects\Arduino\T41v15\__vm\.T41v15.vsarduino.h(25,1): warning C4117: macro name '__cplusplus' is reserved, '#define' ignored
1>Y:\Projects\Arduino\T41v15\__vm\.T41v15.vsarduino.h(26,1): warning C4117: macro name '__cplusplus' is reserved, '#undef' ignored
1>Y:\Projects\Arduino\T41v15\__vm\.T41v15.vsarduino.h(27,1): warning C4117: macro name '__cplusplus' is reserved, '#define' ignored
1>C:\Program Files (x86)\Arduino\hardware\tools\arm\lib\gcc\arm-none-eabi\5.4.1\include\stddef.h(216,23): error C2371: 'size_t': redefinition; different basic types
1>Y:\Projects\Arduino\T41v15\predefined C++ types (compiler internal)(16): message : see declaration of 'size_t'
1>C:\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include\machine\_default_types.h(35,21): error C2371: '__int8_t': redefinition; different basic types
1>Y:\Projects\Arduino\T41v15\__vm\.T41v15.vsarduino.h(68): message : see declaration of '__int8_t'
1>C:\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include\machine\_default_types.h(36,23): error C2371: '__uint8_t': redefinition; different basic types
1>Y:\Projects\Arduino\T41v15\__vm\.T41v15.vsarduino.h(67): message : see declaration of '__uint8_t'
1>C:\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include\machine\_default_types.h(63,9): error C2059: syntax error: 'constant'
1>C:\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include\machine\_default_types.h(67,18): error C2059: syntax error: 'constant'
1>C:\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include\machine\_default_types.h(89,9): error C2059: syntax error: 'constant'
1>C:\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include\machine\_default_types.h(93,18): error C2059: syntax error: 'constant'
1>C:\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include\machine\_default_types.h(200,9): error C2059: syntax error: 'constant'
1>C:\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include\machine\_default_types.h(204,18): error C2059: syntax error: 'constant'
1>C:\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include\sys\_stdint.h(36,20): error C2371: 'uint16_t': redefinition; different basic types
1>Y:\Projects\Arduino\T41v15\__vm\.T41v15.vsarduino.h(76): message : see declaration of 'uint16_t'
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\imxrt.h(436,124): error C2059: syntax error: 'volatile'
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\imxrt.h(9942,6): error C2059: syntax error: 'volatile'
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\imxrt.h(9943,11): error C2290: C++ 'asm' syntax ignored. Use __asm.
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\imxrt.h(9948,11): error C2290: C++ 'asm' syntax ignored. Use __asm.
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\imxrt.h(9949,11): error C2290: C++ 'asm' syntax ignored. Use __asm.
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\imxrt.h(9981,6): error C2059: syntax error: 'volatile'
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\imxrt.h(9982,11): error C2290: C++ 'asm' syntax ignored. Use __asm.
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\imxrt.h(9987,11): error C2290: C++ 'asm' syntax ignored. Use __asm.
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\imxrt.h(9988,11): error C2290: C++ 'asm' syntax ignored. Use __asm.
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\imxrt.h(10002,6): error C2059: syntax error: 'volatile'
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\imxrt.h(10003,11): error C2290: C++ 'asm' syntax ignored. Use __asm.
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\imxrt.h(10008,11): error C2290: C++ 'asm' syntax ignored. Use __asm.
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\imxrt.h(10009,11): error C2290: C++ 'asm' syntax ignored. Use __asm.
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\core_pins.h(1798,6): error C3861: '__builtin_constant_p': identifier not found
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\core_pins.h(2049,6): error C3861: '__builtin_constant_p': identifier not found
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\core_pins.h(2183,6): error C3861: '__builtin_constant_p': identifier not found
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\core_pins.h(2380,13): error C3861: '__builtin_constant_p': identifier not found
1>C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\core_pins.h(2400,13): error C3861: '__builtin_constant_p': identifier not found
1>C:\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include\c++\5.4.1\type_traits(32,9): warning C4068: unknown pragma 'GCC'
1>C:\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include\c++\5.4.1\bits\c++0x_warning.h(34,1): fatal error C1189: #error:  This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========[/code]

Title: Re: Cant Build. OK with Arduino 1.8
Post by Tim@Visual Micro on Aug 9th, 2022 at 8:09pm
The project name, folder name and an .ino name must all be the same for visual micro to manage an VS C++ project.

The output you see iif microsoft trying to compile a normal c++ project.

If you attempted to open an existing arduino project for the first time in VS then use "File>Open>Arduino Project" or open via the vMicro menu. Visual Micro automatically adds the code files you are expecting when you do this. It also creates a project with the correct name.

I guess the folder and an .ino have the same name otherwise arduino would not build.

If you are still unsure then zip the folder and email to us using the email address in the yellow box.

I recommend deleting the .vcxproj file that you have created and using the "file>open>arduino project" to open the standard arduino .ino. This will avoid any confusion.

The "Your first project" in the docs might be useful https://www.visualmicro.com/page/User-Guide.aspx?doc=index


VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.