# Compilation Error - Sending Text to a PC From Arduino

**URL:** <https://forum.xod.io/t/compilation-error-sending-text-to-a-pc-from-arduino/2215>\
**Category:** Uncategorized\
**Created:** [May 7, 2019, 11:30am UTC](https://forum.xod.io/t/compilation-error-sending-text-to-a-pc-from-arduino/2215 "2019-05-07T11:30:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmwright](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/jmwright/32/1252_2.png) [@jmwright](https://forum.xod.io/u/jmwright)\
**Post date:** [May 7, 2019, 11:30am UTC](https://forum.xod.io/t/compilation-error-sending-text-to-a-pc-from-arduino/2215/1 "2019-05-07T11:30:01Z")

</div>

I’d like to send data over the USB-serial interface from an Arduino Uno/Nano to my PC. I found the uart-usb block and implemented what I thought would print over USB to the PC, but I got an error.

 ![Screenshot_2019-05-07_07-24-00](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/a/a33441f6c776556a515805cb611970dc78da4749.png)  
Here is the error I get.

```auto
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227707999_sketch/xod_1557227707999_sketch.ino:1806:22: error: request for member 'begin' in '* state->xod::xod __uart__ uart_usb::State::uart', which is of non-class type 'int'
         state->uart->begin();
                      ^

Error: exit status 1
Compilation failed.
Compilation failed
Command `/opt/XOD\ IDE/resources/arduino-cli --config-file=/tmp/arduino-cliOaFk8V/.cli-config.yml compile --fqbn arduino:avr:uno --verbose /tmp/xod_temp_sketchbookh5AAy6/xod_1557227707999_sketch` failed with code 1
The generated C++ code contains errors. It can be due to a bad node implementation or if your board is not compatible with XOD runtime code. The original compiler error message is above. Fix C++ errors to continue. If you believe it is a bug, report the problem to XOD developers.

```

There’s more to the stack trace, but I didn’t want to flood this post with the whole trace. I can post it if needed. I’m so new to XOD I don’t know if my patch is even close to right, and the only examples I’ve found online are for serial communication between two Arduinos. I’m running version 0.29.1 of the XOD IDE.

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [May 7, 2019, 4:43pm UTC](https://forum.xod.io/t/compilation-error-sending-text-to-a-pc-from-arduino/2215/2 "2019-05-07T16:43:34Z")

</div>

After `Compiling sketch...`, there are some first lines of code that marks the error, is that?

I have tried and I have no error, but I can not send data, the truth is that I have not used Uart

---

<div class="post-metadata">

**Author:** ![jmwright](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/jmwright/32/1252_2.png) [@jmwright](https://forum.xod.io/u/jmwright)\
**Post date:** [May 7, 2019, 4:52pm UTC](https://forum.xod.io/t/compilation-error-sending-text-to-a-pc-from-arduino/2215/3 "2019-05-07T16:52:05Z")

</div>

Here’s the full stack trace:

```auto
Begin compiling code for the board Arduino/Genuino Uno 📦

Using board 'uno' from platform in folder: /home/jwright/xod/ __packages__ /packages/arduino/hardware/avr/1.6.21
Using core 'arduino' from platform in folder: /home/jwright/xod/ __packages__ /packages/arduino/hardware/avr/1.6.21

Detecting libraries used...

/home/jwright/xod/ __packages__ /packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/jwright/xod/ __packages__ /packages/arduino/hardware/avr/1.6.21/cores/arduino -I/home/jwright/xod/ __packages__ /packages/arduino/hardware/avr/1.6.21/variants/standard /tmp/arduino-sketch-E9F2EAFBFC762880BDD0722ACEDBD130/sketch/xod_1557227849531_sketch.ino.cpp -o /dev/null

Generating function prototypes...

/home/jwright/xod/ __packages__ /packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/jwright/xod/ __packages__ /packages/arduino/hardware/avr/1.6.21/cores/arduino -I/home/jwright/xod/ __packages__ /packages/arduino/hardware/avr/1.6.21/variants/standard /tmp/arduino-sketch-E9F2EAFBFC762880BDD0722ACEDBD130/sketch/xod_1557227849531_sketch.ino.cpp -o /tmp/arduino-sketch-E9F2EAFBFC762880BDD0722ACEDBD130/preproc/ctags_target_for_gcc_minus_e.cpp

/home/jwright/xod/ __packages__ /packages/builtin/tools/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino-sketch-E9F2EAFBFC762880BDD0722ACEDBD130/preproc/ctags_target_for_gcc_minus_e.cpp

Compiling sketch...

/home/jwright/xod/ __packages__ /packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/jwright/xod/ __packages__ /packages/arduino/hardware/avr/1.6.21/cores/arduino -I/home/jwright/xod/ __packages__ /packages/arduino/hardware/avr/1.6.21/variants/standard /tmp/arduino-sketch-E9F2EAFBFC762880BDD0722ACEDBD130/sketch/xod_1557227849531_sketch.ino.cpp -o /tmp/arduino-sketch-E9F2EAFBFC762880BDD0722ACEDBD130/sketch/xod_1557227849531_sketch.ino.cpp.o

/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino: In constructor 'xod::xod __debug__ tweak_string_16::State::State()':
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1153:24: error: array used as initializer
     State() : view(buff) {}
                        ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino: At global scope:
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1368:5: error: 'Serial_' does not name a type
     Serial_ _serial;
     ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1373:21: error: expected ')' before 'serial'
     UsbUart(Serial_ serial, long baud = 9600)
                     ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1406:5: error: 'Serial_' does not name a type
     Serial_* toUsbSerial() {
     ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino: In member function 'virtual bool xod::xod __uart__ uart_usb::UsbUart::available()':
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1383:22: error: '_serial' was not declared in this scope
         return (bool)_serial.available();
                      ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino: In member function 'virtual bool xod::xod __uart__ uart_usb::UsbUart::writeByte(uint8_t)':
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1387:22: error: '_serial' was not declared in this scope
         return (bool)_serial.write(byte);
                      ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino: In member function 'virtual bool xod::xod __uart__ uart_usb::UsbUart::readByte(uint8_t*)':
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1391:20: error: '_serial' was not declared in this scope
         int data = _serial.read();
                    ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino: In member function 'virtual void xod::xod __uart__ uart_usb::UsbUart::begin()':
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1413:5: error: '_serial' was not declared in this scope
     _serial.begin(getBaudRate());
     ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino: In member function 'virtual void xod::xod __uart__ uart_usb::UsbUart::end()':
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1417:5: error: '_serial' was not declared in this scope
     _serial.end();
     ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino: In member function 'virtual void xod::xod __uart__ uart_usb::UsbUart::flush()':
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1420:5: error: '_serial' was not declared in this scope
     _serial.flush();
     ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino: At global scope:
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1428:26: error: 'Serial_' was not declared in this scope
 struct ChooseUartWrapper<Serial_> {
                          ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1428:33: error: template argument 1 is invalid
 struct ChooseUartWrapper<Serial_> {
                                 ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1433:49: error: 'SerialUSB' was not declared in this scope
     uint8_t mem[sizeof(ChooseUartWrapper<typeof SerialUSB>::UartT)];
                                                 ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1433:58: error: template argument 1 is invalid
     uint8_t mem[sizeof(ChooseUartWrapper<typeof SerialUSB>::UartT)];
                                                          ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1434:30: error: 'SerialUSB' was not declared in this scope
     ChooseUartWrapper<typeof SerialUSB>::UartT* uart;
                              ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1434:39: error: template argument 1 is invalid
     ChooseUartWrapper<typeof SerialUSB>::UartT* uart;
                                       ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1434:42: error: expected ';' at end of member declaration
     ChooseUartWrapper<typeof SerialUSB>::UartT* uart;
                                          ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino: In function 'void xod::xod __uart__ uart_usb::evaluate(xod::xod __uart__ uart_usb::Context)':
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1533:35: error: 'struct xod::xod __uart__ uart_usb::State' has no member named 'mem'
         state->uart = new (state->mem) ChooseUartWrapper<typeof SerialUSB>::UartT(SerialUSB, (uint32_t)getValue<input_BAUD>(ctx));
                                   ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1533:65: error: 'SerialUSB' was not declared in this scope
         state->uart = new (state->mem) ChooseUartWrapper<typeof SerialUSB>::UartT(SerialUSB, (uint32_t)getValue<input_BAUD>(ctx));
                                                                 ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1533:74: error: template argument 1 is invalid
         state->uart = new (state->mem) ChooseUartWrapper<typeof SerialUSB>::UartT(SerialUSB, (uint32_t)getValue<input_BAUD>(ctx));
                                                                          ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1534:48: error: no matching function for call to 'emitValue(xod::xod __uart__ uart_usb::ContextObject*&, int*&)'
         emitValue<output_UART>(ctx, state->uart);
                                                ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1534:48: note: candidate is:
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1508:33: note: template<class OutputT> void xod::xod __uart__ uart_usb::emitValue(xod::xod __uart__ uart_usb::Context, typename xod::xod __uart__ uart_usb::ValueType<OutputT>::T)
 template<typename OutputT> void emitValue(Context ctx, typename ValueType<OutputT>::T val) {
                                 ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1508:33: note: template argument deduction/substitution failed:
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1534:48: note: cannot convert 'state->xod::xod __uart__ uart_usb::State::uart' (type 'int*') to type 'xod::xod __uart__ uart_usb::ValueType<xod::xod __uart__ uart_usb::output_UART>::T {aka xod::Uart*}'
         emitValue<output_UART>(ctx, state->uart);
                                                ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch/xod_1557227849531_sketch.ino:1538:22: error: request for member 'begin' in '* state->xod::xod __uart__ uart_usb::State::uart', which is of non-class type 'int'
         state->uart->begin();
                      ^

Error: exit status 1
Compilation failed.
Compilation failed
Command `/opt/XOD\ IDE/resources/arduino-cli --config-file=/tmp/arduino-cliOaFk8V/.cli-config.yml compile --fqbn arduino:avr:uno --verbose /tmp/xod_temp_sketchbookh5AAy6/xod_1557227849531_sketch` failed with code 1
The generated C++ code contains errors. It can be due to a bad node implementation or if your board is not compatible with XOD runtime code. The original compiler error message is above. Fix C++ errors to continue. If you believe it is a bug, report the problem to XOD developers.

```

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [May 7, 2019, 5:02pm UTC](https://forum.xod.io/t/compilation-error-sending-text-to-a-pc-from-arduino/2215/4 "2019-05-07T17:02:47Z")

</div>

> [@jmwright](#):
>
> /tmp/xod\_temp\_sketchbookh5AAy6/xod\_1557227849531\_sketch/xod\_1557227849531\_sketch.ino: In constructor ‘xod::xod\_\_debug\_\_tweak\_string\_16::State::State()’:

Your mistake starts here. 👆

I think it uses Linux, in W10, I do not have that error.

Change `tweak-string-16` by `constant-string` or just put “,” in concat, to see if the error disappears.

---

<div class="post-metadata">

**Author:** ![jmwright](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/jmwright/32/1252_2.png) [@jmwright](https://forum.xod.io/u/jmwright)\
**Post date:** [May 7, 2019, 5:11pm UTC](https://forum.xod.io/t/compilation-error-sending-text-to-a-pc-from-arduino/2215/5 "2019-05-07T17:11:42Z")

</div>

@cesars Thanks for the help. Your suggestion eliminated that tweak error, but more still remain. I forgot to mention that I’m on Ubuntu 18.04.

```auto
/home/jwright/xod/ __packages__ /packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/jwright/xod/ __packages__ /packages/arduino/hardware/avr/1.6.21/cores/arduino -I/home/jwright/xod/ __packages__ /packages/arduino/hardware/avr/1.6.21/variants/standard /tmp/arduino-sketch-474461764F7EBBAC95E11CD6EB649512/sketch/xod_1557248877405_sketch.ino.cpp -o /tmp/arduino-sketch-474461764F7EBBAC95E11CD6EB649512/sketch/xod_1557248877405_sketch.ino.cpp.o

/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1281:5: error: 'Serial_' does not name a type
     Serial_ _serial;
     ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1286:21: error: expected ')' before 'serial'
     UsbUart(Serial_ serial, long baud = 9600)
                     ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1319:5: error: 'Serial_' does not name a type
     Serial_* toUsbSerial() {
     ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino: In member function 'virtual bool xod::xod __uart__ uart_usb::UsbUart::available()':
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1296:22: error: '_serial' was not declared in this scope
         return (bool)_serial.available();
                      ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino: In member function 'virtual bool xod::xod __uart__ uart_usb::UsbUart::writeByte(uint8_t)':
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1300:22: error: '_serial' was not declared in this scope
         return (bool)_serial.write(byte);
                      ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino: In member function 'virtual bool xod::xod __uart__ uart_usb::UsbUart::readByte(uint8_t*)':
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1304:20: error: '_serial' was not declared in this scope
         int data = _serial.read();
                    ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino: In member function 'virtual void xod::xod __uart__ uart_usb::UsbUart::begin()':
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1326:5: error: '_serial' was not declared in this scope
     _serial.begin(getBaudRate());
     ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino: In member function 'virtual void xod::xod __uart__ uart_usb::UsbUart::end()':
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1330:5: error: '_serial' was not declared in this scope
     _serial.end();
     ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino: In member function 'virtual void xod::xod __uart__ uart_usb::UsbUart::flush()':
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1333:5: error: '_serial' was not declared in this scope
     _serial.flush();
     ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino: At global scope:
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1341:26: error: 'Serial_' was not declared in this scope
 struct ChooseUartWrapper<Serial_> {
                          ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1341:33: error: template argument 1 is invalid
 struct ChooseUartWrapper<Serial_> {
                                 ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1346:49: error: 'SerialUSB' was not declared in this scope
     uint8_t mem[sizeof(ChooseUartWrapper<typeof SerialUSB>::UartT)];
                                                 ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1346:58: error: template argument 1 is invalid
     uint8_t mem[sizeof(ChooseUartWrapper<typeof SerialUSB>::UartT)];
                                                          ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1347:30: error: 'SerialUSB' was not declared in this scope
     ChooseUartWrapper<typeof SerialUSB>::UartT* uart;
                              ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1347:39: error: template argument 1 is invalid
     ChooseUartWrapper<typeof SerialUSB>::UartT* uart;
                                       ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1347:42: error: expected ';' at end of member declaration
     ChooseUartWrapper<typeof SerialUSB>::UartT* uart;
                                          ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino: In function 'void xod::xod __uart__ uart_usb::evaluate(xod::xod __uart__ uart_usb::Context)':
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1446:35: error: 'struct xod::xod __uart__ uart_usb::State' has no member named 'mem'
         state->uart = new (state->mem) ChooseUartWrapper<typeof SerialUSB>::UartT(SerialUSB, (uint32_t)getValue<input_BAUD>(ctx));
                                   ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1446:65: error: 'SerialUSB' was not declared in this scope
         state->uart = new (state->mem) ChooseUartWrapper<typeof SerialUSB>::UartT(SerialUSB, (uint32_t)getValue<input_BAUD>(ctx));
                                                                 ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1446:74: error: template argument 1 is invalid
         state->uart = new (state->mem) ChooseUartWrapper<typeof SerialUSB>::UartT(SerialUSB, (uint32_t)getValue<input_BAUD>(ctx));
                                                                          ^

/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1447:48: error: no matching function for call to 'emitValue(xod::xod __uart__ uart_usb::ContextObject*&, int*&)'
         emitValue<output_UART>(ctx, state->uart);
                                                ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1447:48: note: candidate is:
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1421:33: note: template<class OutputT> void xod::xod __uart__ uart_usb::emitValue(xod::xod __uart__ uart_usb::Context, typename xod::xod __uart__ uart_usb::ValueType<OutputT>::T)
 template<typename OutputT> void emitValue(Context ctx, typename ValueType<OutputT>::T val) {
                                 ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1421:33: note: template argument deduction/substitution failed:
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1447:48: note: cannot convert 'state->xod::xod __uart__ uart_usb::State::uart' (type 'int*') to type 'xod::xod __uart__ uart_usb::ValueType<xod::xod __uart__ uart_usb::output_UART>::T {aka xod::Uart*}'
         emitValue<output_UART>(ctx, state->uart);
                                                ^
/tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch/xod_1557248877405_sketch.ino:1451:22: error: request for member 'begin' in '* state->xod::xod __uart__ uart_usb::State::uart', which is of non-class type 'int'
         state->uart->begin();
                      ^

Error: exit status 1
Compilation failed.
Compilation failed
Command `/opt/XOD\ IDE/resources/arduino-cli --config-file=/tmp/arduino-cliOaFk8V/.cli-config.yml compile --fqbn arduino:avr:uno --verbose /tmp/xod_temp_sketchbookh5AAy6/xod_1557248877405_sketch` failed with code 1
The generated C++ code contains errors. It can be due to a bad node implementation or if your board is not compatible with XOD runtime code. The original compiler error message is above. Fix C++ errors to continue. If you believe it is a bug, report the problem to XOD developers.

```

---

<div class="post-metadata">

**Author:** ![jmwright](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/jmwright/32/1252_2.png) [@jmwright](https://forum.xod.io/u/jmwright)\
**Post date:** [May 7, 2019, 5:19pm UTC](https://forum.xod.io/t/compilation-error-sending-text-to-a-pc-from-arduino/2215/6 "2019-05-07T17:19:13Z")

</div>

I just noticed that if I replace the uart-usb block with the uart block, I don’t get an error.

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [May 7, 2019, 5:23pm UTC](https://forum.xod.io/t/compilation-error-sending-text-to-a-pc-from-arduino/2215/7 "2019-05-07T17:23:01Z")

</div>

Ups, I was testing in UART, I thought you had renamed it, I also have the error with UART-USB

---

<div class="post-metadata">

**Author:** ![jmwright](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/jmwright/32/1252_2.png) [@jmwright](https://forum.xod.io/u/jmwright)\
**Post date:** [May 7, 2019, 5:43pm UTC](https://forum.xod.io/t/compilation-error-sending-text-to-a-pc-from-arduino/2215/8 "2019-05-07T17:43:06Z")

</div>

Ok, interesting. It happens in Windows too then. I wonder if I should open an issue on GitHub.

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [May 7, 2019, 8:21pm UTC](https://forum.xod.io/t/compilation-error-sending-text-to-a-pc-from-arduino/2215/9 "2019-05-07T20:21:08Z")

</div>

yes, i think this is an issue

---

<div class="post-metadata">

**Author:** ![jmwright](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/jmwright/32/1252_2.png) [@jmwright](https://forum.xod.io/u/jmwright)\
**Post date:** [May 8, 2019, 9:36pm UTC](https://forum.xod.io/t/compilation-error-sending-text-to-a-pc-from-arduino/2215/10 "2019-05-08T21:36:20Z")

</div>

I submitted an issue on GitHub for this: [https://github.com/xodio/xod/issues/1775](https://github.com/xodio/xod/issues/1775)

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [May 13, 2019, 9:29am UTC](https://forum.xod.io/t/compilation-error-sending-text-to-a-pc-from-arduino/2215/11 "2019-05-13T09:29:51Z")

</div>

Yeah, this is so misguiding that it should be considered a bug.

The `uart-usb` node represents a USB serial on the boards having a dedicated CDC interface (like Leonardo or Micro). For Uno and Nano the interface is shared with UART #0. So, if you would use `uart-0` instead of `uart-usb`, all should work fine for you.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [May 15, 2019, 9:29am UTC](https://forum.xod.io/t/compilation-error-sending-text-to-a-pc-from-arduino/2215/12 "2019-05-15T09:29:52Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
