基本的なところでスタックした
以下にあるように、CでビルドしたライブラリとC++でビルドしたライブラリ名前のマングリングが異なっている。
http://kaisk.hatenadiary.com/entry/2014/06/23/172411は
Cのライブラリのヘッダを以下のように変えることでC++から呼べるようになる
#ifdef __cplusplus extern "C" { #endif (見つけた関数宣言) #ifdef __cplusplus } #endif
具体的にはi2c.hを以下のように変更した
PYNQ/pynq/lib/arduino/bsp_iop_arduino/iop_arduino_mb/include/i2c.h
#ifndef _I2C_H_ #define _I2C_H_ #include <xparameters.h> #ifdef XPAR_XIIC_NUM_INSTANCES /* * IIC API */ typedef int i2c; #ifdef __cplusplus extern "C" { #endif i2c i2c_open_device(unsigned int device); i2c i2c_open(unsigned int sda, unsigned int scl); void i2c_read(i2c dev_id, unsigned int slave_address, unsigned char* buffer, unsigned int length); void i2c_write(i2c dev_id, unsigned int slave_address, unsigned char* buffer, unsigned int length); void i2c_close(i2c dev_id); unsigned int i2c_get_num_devices(void); #ifdef __cplusplus } #endif #endif #endif // _I2C_H_