EDIT: SOLVED see post 5.
Got an issue working on a project to control DMX lights using the DMX512 protocol.
B4R 4.0, Arduino UNO, CQRobot DMX Shield Arduino.
Started to explore how to use the Conceptinetics library with B4R.
Prior developing with B4R tested a simple sketch with the Arduino IDE 2.
STEP 1: Simple C++ sketch is working fine.
STEP 2: B4R test with Inline C with ERROR
ISSUE
When compiling & linking, the error "multiple definition of '__vector_18'" occurs.
It seems there is a double definition of hardware serial 0. The error happens as soon as Conceptinetics.h is included.
Any help appreciated.
B4R IDE Log Snippet
Got an issue working on a project to control DMX lights using the DMX512 protocol.
B4R 4.0, Arduino UNO, CQRobot DMX Shield Arduino.
Started to explore how to use the Conceptinetics library with B4R.
Prior developing with B4R tested a simple sketch with the Arduino IDE 2.
STEP 1: Simple C++ sketch is working fine.
Arduino Test Sketch:
#include <Conceptinetics.h>
#define DMX_MASTER_CHANNELS 10
#define RXEN_PIN 2
DMX_Master dmx_master ( DMX_MASTER_CHANNELS, RXEN_PIN );
void setup() {
dmx_master.enable ();
dmx_master.setChannelValue ( 2, 127 );
dmx_master.setChannelValue ( 4, 50 );
}
void Loop() {}
STEP 2: B4R test with Inline C with ERROR
B4R Test Code:
Sub Process_Globals
Public Serial1 As Serial
Private Channel As Int 'ignore 1-10
Private Value As Byte 'ignore 0-255
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
RunNative ("initialize", Null)
Set_Channel_Value (2, 127)
Set_Channel_Value (4, 50)
End Sub
private Sub Set_Channel_Value(ch As Int, val As Byte)
Channel = ch
Value = val
RunNative("setchannelvalue", Null)
End Sub
#if C
#include <Conceptinetics.h>
#define DMX_MASTER_CHANNELS 10
#define RXEN_PIN 2
DMX_Master dmx_master ( DMX_MASTER_CHANNELS, RXEN_PIN );
void initialize (B4R::Object* o) {
dmx_master.enable ();
}
void setchannelvalue(B4R::Object* o) {
dmx_master.setChannelValue ( b4r_main::_channel, b4r_main::_value );
}
#End If
ISSUE
When compiling & linking, the error "multiple definition of '__vector_18'" occurs.
It seems there is a double definition of hardware serial 0. The error happens as soon as Conceptinetics.h is included.
Any help appreciated.
B4R IDE Log Snippet
B4X:
Linking everything together...
"C:\\Users\\NAME\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\rwbli\\AppData\\Local\\Temp\\arduino\\sketches\\617D7F3746514C7DCD8267DC8C2F520E/src.ino.elf" "C:\\Users\\rwbli\\AppData\\Local\\Temp\\arduino\\sketches\\617D7F3746514C7DCD8267DC8C2F520E\\sketch\\B4RArduino.cpp.o" "C:\\Users\\rwbli\\AppData\\Local\\Temp\\arduino\\sketches\\617D7F3746514C7DCD8267DC8C2F520E\\sketch\\B4RCore.cpp.o" "C:\\Users\\rwbli\\AppData\\Local\\Temp\\arduino\\sketches\\617D7F3746514C7DCD8267DC8C2F520E\\sketch\\B4RStream.cpp.o" "C:\\Users\\rwbli\\AppData\\Local\\Temp\\arduino\\sketches\\617D7F3746514C7DCD8267DC8C2F520E\\sketch\\Scheduler.cpp.o" "C:\\Users\\rwbli\\AppData\\Local\\Temp\\arduino\\sketches\\617D7F3746514C7DCD8267DC8C2F520E\\sketch\\b4r_main.cpp.o" "C:\\Users\\rwbli\\AppData\\Local\\Temp\\arduino\\sketches\\617D7F3746514C7DCD8267DC8C2F520E\\sketch\\src.ino.cpp.o" "C:\\Users\\rwbli\\AppData\\Local\\Temp\\arduino\\sketches\\617D7F3746514C7DCD8267DC8C2F520E\\libraries\\Conceptinetics\\Conceptinetics.cpp.o" "C:\\Users\\rwbli\\AppData\\Local\\Temp\\arduino\\sketches\\617D7F3746514C7DCD8267DC8C2F520E/..\\..\\cores\\arduino_avr_uno_e161e75f098ed477e196c7c14c088163\\core.a" "-LC:\\Users\\NAME\\AppData\\Local\\Temp\\arduino\\sketches\\617D7F3746514C7DCD8267DC8C2F520E" -lm
HardwareSerial0.cpp.o (symbol from plugin): In function `Serial':
(.text+0x0): multiple definition of `__vector_18'
C:\Users\NAME\AppData\Local\Temp\arduino\sketches\617D7F3746514C7DCD8267DC8C2F520E\libraries\Conceptinetics\Conceptinetics.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Error during build: exit status 1
Last edited: