Issue with cpp in linux

I just configured a lubuntu box for my projects.
When I tried loading a sketch, that worked in windoos, I got lotsa compile errors.
a quick search in the forum found nothing so I’m (re?)posting

Don’t know enough about Linux yet to know if it’s my linux install or my arduino install or…

Here’s the errors I have runing demo.ino:

/usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.cpp:1:1: error: ‘Skip’ does not name a type Skip to content ^ In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:4:0, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.h:4, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.cpp:11: /usr/lib/avr/include/stdlib.h:151:61: error: ‘size_t’ has not been declared extern void *bsearch(const void *__key, const void *__base, size_t __nmemb, ^ /usr/lib/avr/include/stdlib.h:152:8: error: ‘size_t’ has not been declared size_t __size, int (*__compar)(const void *, const void *)); ^ /usr/lib/avr/include/stdlib.h:183:33: error: ‘size_t’ has not been declared extern void qsort(void *__base, size_t __nmemb, size_t __size, ^ /usr/lib/avr/include/stdlib.h:183:49: error: ‘size_t’ has not been declared extern void qsort(void *__base, size_t __nmemb, size_t __size, ^ /usr/lib/avr/include/stdlib.h:298:21: error: ‘size_t’ was not declared in this scope extern void *malloc(size_t __size) __ATTR_MALLOC__; ^ /usr/lib/avr/include/stdlib.h:310:8: error: ‘size_t’ does not name a type extern size_t __malloc_margin; ^ /usr/lib/avr/include/stdlib.h:327:21: error: ‘size_t’ was not declared in this scope extern void *calloc(size_t __nele, size_t __size) __ATTR_MALLOC__; ^ /usr/lib/avr/include/stdlib.h:327:36: error: ‘size_t’ was not declared in this scope extern void *calloc(size_t __nele, size_t __size) __ATTR_MALLOC__; ^ /usr/lib/avr/include/stdlib.h:327:51: error: expression list treated as compound expression in initializer [-fpermissive] extern void *calloc(size_t __nele, size_t __size) __ATTR_MALLOC__; ^ /usr/lib/avr/include/stdlib.h:346:35: error: ‘size_t’ has not been declared extern void *realloc(void *__ptr, size_t __size) __ATTR_MALLOC__; ^ In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:5:0, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.h:4, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.cpp:11: /usr/lib/avr/include/string.h:114:49: error: ‘size_t’ has not been declared extern void *memccpy(void *, const void *, int, size_t); ^ /usr/lib/avr/include/string.h:115:40: error: ‘size_t’ has not been declared extern void *memchr(const void *, int, size_t) __ATTR_PURE__; ^ /usr/lib/avr/include/string.h:116:47: error: ‘size_t’ has not been declared extern int memcmp(const void *, const void *, size_t) __ATTR_PURE__; ^ /usr/lib/avr/include/string.h:117:43: error: ‘size_t’ has not been declared extern void *memcpy(void *, const void *, size_t); ^ /usr/lib/avr/include/string.h:118:35: error: ‘size_t’ has not been declared extern void *memmem(const void *, size_t, const void *, size_t) __ATTR_PURE__; ^ /usr/lib/avr/include/string.h:118:57: error: ‘size_t’ has not been declared extern void *memmem(const void *, size_t, const void *, size_t) __ATTR_PURE__; ^ /usr/lib/avr/include/string.h:119:44: error: ‘size_t’ has not been declared extern void *memmove(void *, const void *, size_t); ^ /usr/lib/avr/include/string.h:120:41: error: ‘size_t’ has not been declared extern void *memrchr(const void *, int, size_t) __ATTR_PURE__; ^ /usr/lib/avr/include/string.h:121:34: error: ‘size_t’ has not been declared extern void *memset(void *, int, size_t); ^ /usr/lib/avr/include/string.h:129:8: error: ‘size_t’ does not name a type extern size_t strcspn(const char *__s, const char *__reject) __ATTR_PURE__; ^ /usr/lib/avr/include/string.h:131:8: error: ‘size_t’ does not name a type extern size_t strlcat(char *, const char *, size_t); ^ /usr/lib/avr/include/string.h:132:8: error: ‘size_t’ does not name a type extern size_t strlcpy(char *, const char *, size_t); ^ /usr/lib/avr/include/string.h:133:8: error: ‘size_t’ does not name a type extern size_t strlen(const char *) __ATTR_PURE__; ^ /usr/lib/avr/include/string.h:135:44: error: ‘size_t’ has not been declared extern char *strncat(char *, const char *, size_t); ^ /usr/lib/avr/include/string.h:136:48: error: ‘size_t’ has not been declared extern int strncmp(const char *, const char *, size_t) __ATTR_PURE__; ^ /usr/lib/avr/include/string.h:137:44: error: ‘size_t’ has not been declared extern char *strncpy(char *, const char *, size_t); ^ /usr/lib/avr/include/string.h:138:52: error: ‘size_t’ has not been declared extern int strncasecmp(const char *, const char *, size_t) __ATTR_PURE__; ^ /usr/lib/avr/include/string.h:139:8: error: ‘size_t’ does not name a type extern size_t strnlen(const char *, size_t) __ATTR_PURE__; ^ /usr/lib/avr/include/string.h:144:8: error: ‘size_t’ does not name a type extern size_t strspn(const char *__s, const char *__accept) __ATTR_PURE__; ^ In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:8:0, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.h:4, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.cpp:11: /usr/lib/avr/include/avr/pgmspace.h:1137:55: error: ‘size_t’ has not been declared extern const void * memchr_P(const void *, int __val, size_t __len) __ATTR_CONST__; ^ /usr/lib/avr/include/avr/pgmspace.h:1138:49: error: ‘size_t’ has not been declared extern int memcmp_P(const void *, const void *, size_t) __ATTR_PURE__; ^ /usr/lib/avr/include/avr/pgmspace.h:1139:57: error: ‘size_t’ has not been declared extern void *memccpy_P(void *, const void *, int __val, size_t); ^ /usr/lib/avr/include/avr/pgmspace.h:1140:45: error: ‘size_t’ has not been declared extern void *memcpy_P(void *, const void *, size_t); ^ /usr/lib/avr/include/avr/pgmspace.h:1141:37: error: ‘size_t’ has not been declared extern void *memmem_P(const void *, size_t, const void *, size_t) __ATTR_PURE__; ^ /usr/lib/avr/include/avr/pgmspace.h:1141:59: error: ‘size_t’ has not been declared extern void *memmem_P(const void *, size_t, const void *, size_t) __ATTR_PURE__; ^ /usr/lib/avr/include/avr/pgmspace.h:1142:56: error: ‘size_t’ has not been declared extern const void * memrchr_P(const void *, int __val, size_t __len) __ATTR_CONST__; ^ /usr/lib/avr/include/avr/pgmspace.h:1150:8: error: ‘size_t’ does not name a type extern size_t strcspn_P(const char *__s, const char * __reject) __ATTR_PURE__; ^ /usr/lib/avr/include/avr/pgmspace.h:1151:8: error: ‘size_t’ does not name a type extern size_t strlcat_P (char *, const char *, size_t ); ^ /usr/lib/avr/include/avr/pgmspace.h:1152:8: error: ‘size_t’ does not name a type extern size_t strlcpy_P (char *, const char *, size_t ); ^ /usr/lib/avr/include/avr/pgmspace.h:1153:8: error: ‘size_t’ does not name a type extern size_t __strlen_P(const char *) __ATTR_CONST__; /* program memory can't change */ ^ /usr/lib/avr/include/avr/pgmspace.h:1154:8: error: ‘size_t’ does not name a type extern size_t strnlen_P(const char *, size_t) __ATTR_CONST__; /* program memory can't change */ ^ /usr/lib/avr/include/avr/pgmspace.h:1155:50: error: ‘size_t’ has not been declared extern int strncmp_P(const char *, const char *, size_t) __ATTR_PURE__; ^ /usr/lib/avr/include/avr/pgmspace.h:1156:54: error: ‘size_t’ has not been declared extern int strncasecmp_P(const char *, const char *, size_t) __ATTR_PURE__; ^ /usr/lib/avr/include/avr/pgmspace.h:1157:46: error: ‘size_t’ has not been declared extern char *strncat_P(char *, const char *, size_t); ^ /usr/lib/avr/include/avr/pgmspace.h:1158:46: error: ‘size_t’ has not been declared extern char *strncpy_P(char *, const char *, size_t); ^ /usr/lib/avr/include/avr/pgmspace.h:1162:8: error: ‘size_t’ does not name a type extern size_t strspn_P(const char *__s, const char * __accept) __ATTR_PURE__; ^ /usr/lib/avr/include/avr/pgmspace.h:1167:8: error: ‘size_t’ does not name a type extern size_t strlen_PF (uint_farptr_t src) __ATTR_CONST__; /* program memory can't change */ ^ /usr/lib/avr/include/avr/pgmspace.h:1168:8: error: ‘size_t’ does not name a type extern size_t strnlen_PF (uint_farptr_t src, size_t len) __ATTR_CONST__; /* program memory can't change */ ^ /usr/lib/avr/include/avr/pgmspace.h:1169:56: error: ‘size_t’ has not been declared extern void *memcpy_PF (void *dest, uint_farptr_t src, size_t len); ^ /usr/lib/avr/include/avr/pgmspace.h:1171:57: error: ‘size_t’ has not been declared extern char *strncpy_PF (char *dest, uint_farptr_t src, size_t len); ^ /usr/lib/avr/include/avr/pgmspace.h:1173:8: error: ‘size_t’ does not name a type extern size_t strlcat_PF (char *dst, uint_farptr_t src, size_t siz); ^ /usr/lib/avr/include/avr/pgmspace.h:1174:57: error: ‘size_t’ has not been declared extern char *strncat_PF (char *dest, uint_farptr_t src, size_t len); ^ /usr/lib/avr/include/avr/pgmspace.h:1176:58: error: ‘size_t’ has not been declared extern int strncmp_PF (const char *s1, uint_farptr_t s2, size_t n) __ATTR_PURE__; ^ /usr/lib/avr/include/avr/pgmspace.h:1178:62: error: ‘size_t’ has not been declared extern int strncasecmp_PF (const char *s1, uint_farptr_t s2, size_t n) __ATTR_PURE__; ^ /usr/lib/avr/include/avr/pgmspace.h:1180:8: error: ‘size_t’ does not name a type extern size_t strlcpy_PF (char *dst, uint_farptr_t src, size_t siz); ^ /usr/lib/avr/include/avr/pgmspace.h:1181:51: error: ‘size_t’ has not been declared extern int memcmp_PF(const void *, uint_farptr_t, size_t) __ATTR_PURE__; ^ /usr/lib/avr/include/avr/pgmspace.h:1184:54: error: ‘size_t’ does not name a type __attribute__((__always_inline__)) static __inline__ size_t strlen_P(const char * s); ^ /usr/lib/avr/include/avr/pgmspace.h:1185:19: error: ‘size_t’ does not name a type static __inline__ size_t strlen_P(const char *s) { ^ In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:24:0, from /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h:26, from /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h:28, from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:193, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.h:4, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.cpp:11: /usr/lib/avr/include/stdio.h:685:32: error: ‘size_t’ has not been declared extern int snprintf(char *__s, size_t __n, const char *__fmt, ...); ^ /usr/lib/avr/include/stdio.h:691:34: error: ‘size_t’ has not been declared extern int snprintf_P(char *__s, size_t __n, const char *__fmt, ...); ^ /usr/lib/avr/include/stdio.h:713:33: error: ‘size_t’ has not been declared extern int vsnprintf(char *__s, size_t __n, const char *__fmt, va_list ap); ^ /usr/lib/avr/include/stdio.h:719:35: error: ‘size_t’ has not been declared extern int vsnprintf_P(char *__s, size_t __n, const char *__fmt, va_list ap); ^ /usr/lib/avr/include/stdio.h:762:8: error: ‘size_t’ does not name a type extern size_t fwrite(const void *__ptr, size_t __size, size_t __nmemb, ^ /usr/lib/avr/include/stdio.h:840:8: error: ‘size_t’ does not name a type extern size_t fread(void *__ptr, size_t __size, size_t __nmemb, ^ In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h:23:0, from /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:27, from /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h:26, from /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h:28, from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:193, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.h:4, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.cpp:11: /usr/share/arduino/hardware/arduino/cores/arduino/new.h:10:21: error: declaration of ‘operator new’ as non-function void * operator new(size_t size); ^ /usr/share/arduino/hardware/arduino/cores/arduino/new.h:10:21: error: ‘size_t’ was not declared in this scope /usr/share/arduino/hardware/arduino/cores/arduino/new.h:11:23: error: declaration of ‘operator new []’ as non-function void * operator new[](size_t size); ^ /usr/share/arduino/hardware/arduino/cores/arduino/new.h:11:23: error: ‘size_t’ was not declared in this scope In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:27:0, from /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h:26, from /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h:28, from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:193, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.h:4, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.cpp:11: /usr/share/arduino/hardware/arduino/cores/arduino/Printable.h:36:13: error: ‘size_t’ does not name a type virtual size_t printTo(Print& p) const = 0; ^ In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h:26:0, from /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h:28, from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:193, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.h:4, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.cpp:11: /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:38:5: error: ‘size_t’ does not name a type size_t printNumber(unsigned long, uint8_t); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:39:5: error: ‘size_t’ does not name a type size_t printFloat(double, uint8_t); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:48:13: error: ‘size_t’ does not name a type virtual size_t write(uint8_t) = 0; ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:49:5: error: ‘size_t’ does not name a type size_t write(const char *str) { ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:53:13: error: ‘size_t’ does not name a type virtual size_t write(const uint8_t *buffer, size_t size); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:55:5: error: ‘size_t’ does not name a type size_t print(const __FlashStringHelper *); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:56:5: error: ‘size_t’ does not name a type size_t print(const String &); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:57:5: error: ‘size_t’ does not name a type size_t print(const char[]); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:58:5: error: ‘size_t’ does not name a type size_t print(char); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:59:5: error: ‘size_t’ does not name a type size_t print(unsigned char, int = DEC); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:60:5: error: ‘size_t’ does not name a type size_t print(int, int = DEC); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:61:5: error: ‘size_t’ does not name a type size_t print(unsigned int, int = DEC); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:62:5: error: ‘size_t’ does not name a type size_t print(long, int = DEC); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:63:5: error: ‘size_t’ does not name a type size_t print(unsigned long, int = DEC); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:64:5: error: ‘size_t’ does not name a type size_t print(double, int = 2); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:65:5: error: ‘size_t’ does not name a type size_t print(const Printable&); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:67:5: error: ‘size_t’ does not name a type size_t println(const __FlashStringHelper *); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:68:5: error: ‘size_t’ does not name a type size_t println(const String &s); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:69:5: error: ‘size_t’ does not name a type size_t println(const char[]); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:70:5: error: ‘size_t’ does not name a type size_t println(char); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:71:5: error: ‘size_t’ does not name a type size_t println(unsigned char, int = DEC); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:72:5: error: ‘size_t’ does not name a type size_t println(int, int = DEC); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:73:5: error: ‘size_t’ does not name a type size_t println(unsigned int, int = DEC); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:74:5: error: ‘size_t’ does not name a type size_t println(long, int = DEC); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:75:5: error: ‘size_t’ does not name a type size_t println(unsigned long, int = DEC); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:76:5: error: ‘size_t’ does not name a type size_t println(double, int = 2); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:77:5: error: ‘size_t’ does not name a type size_t println(const Printable&); ^ /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:78:5: error: ‘size_t’ does not name a type size_t println(void); ^ In file included from /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h:28:0, from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:193, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.h:4, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.cpp:11: /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h:62:27: error: ‘size_t’ has not been declared bool find(char *target, size_t length); // reads data from the stream until the target string of given length is found ^ /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h:67:32: error: ‘size_t’ has not been declared bool findUntil(char *target, size_t targetLen, char *terminate, size_t termLen); // as above but search ends if the terminate string is found ^ /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h:67:67: error: ‘size_t’ has not been declared bool findUntil(char *target, size_t targetLen, char *terminate, size_t termLen); // as above but search ends if the terminate string is found ^ In file included from /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h:28:0, from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:193, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.h:4, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.cpp:11: /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h:76:3: error: ‘size_t’ does not name a type size_t readBytes( char *buffer, size_t length); // read chars from stream into buffer ^ /usr/share/arduino/hardware/arduino/cores/arduino/Stream.h:80:3: error: ‘size_t’ does not name a type size_t readBytesUntil( char terminator, char *buffer, size_t length); // as readBytes with terminator character ^ In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:193:0, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.h:4, from /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.cpp:11: /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h:62:13: error: ‘size_t’ does not name a type virtual size_t write(uint8_t); ^ /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h:63:12: error: ‘size_t’ does not name a type inline size_t write(unsigned long n) { return write((uint8_t)n); } ^ /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h:64:12: error: ‘size_t’ does not name a type inline size_t write(long n) { return write((uint8_t)n); } ^ /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h:65:12: error: ‘size_t’ does not name a type inline size_t write(unsigned int n) { return write((uint8_t)n); } ^ /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h:66:12: error: ‘size_t’ does not name a type inline size_t write(int n) { return write((uint8_t)n); } ^ /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h:67:18: error: no members matching ‘Print::write’ in ‘class Print’ using Print::write; // pull in write(str) and write(buf, size) from Print ^ /usr/share/arduino/libraries/Motorshield/DualVNH5019MotorShield.cpp:217:1: error: ‘Status’ does not name a type Status API Training Shop Blog About Help ^

Hello.

It sounds like you are trying to use our Arduino library for the Pololu Dual VNH5019 Motor Driver Shield in Linux but getting errors. In general, the best practice is to look at the first error message from the compiler and try to fix it. The first error indicates that line 1 of DualVNH5019MotorShield.cpp includes the text “Skip to content”, which is not valid C++ code. The first line of that file should actually be:

#include "DualVNH5019MotorShield.h"

This makes me think that you did not install the library correctly. Perhaps you visited the Github page for DualVNH5019MotorShield.cpp and copied the entire contents of that page. Instead, you should use the “Download Zip” button on the main repository page. In case you have trouble finding the button, here is a direct download link:

github.com/pololu/dual-vnh5019- … master.zip

By the way, I have moved this topic into the “Pololu Motor Controllers/Drivers and Motors” section of the forum.

–David

Indeed my bad, I could not get the “original” file I downloaded to work, so I did a cut and past.
The issue was however that the folder was with a second folder in the arduino library, hence not read.
Now that I got rid of the extra folder layer it works fine… many thanks.