Skip to content

Undefined reference to 'i2c_smbus_write_byte_data' v.2 #3

@TNemes-3141

Description

@TNemes-3141

Hello,

It's me again, who commented here a while ago with the same problem. Now I decided to start using the USFS boards and would be very happy using your library for it. Can you please make the same changes to the Makefile as you did earlier to fix the problem of compilation? For comprehension, this is my error message:

g++ -std=c++11 -Wall -I/home/tamas/CrossPlatformDataBus/src -I../../src -c MasterTest.cpp
g++ -std=c++11 -Wall -I/home/tamas/CrossPlatformDataBus/src -I../../src -c ../../src/USFS.cpp
g++ -std=c++11 -Wall -I/home/tamas/CrossPlatformDataBus/src -I../../src -c ../../src/USFS_Master.cpp
g++ -std=c++11 -Wall -I/home/tamas/CrossPlatformDataBus/src -c /home/tamas/CrossPlatformDataBus/extras/i2c/i2cdev/src/I2CDevI2C.cpp
g++ -std=c++11 -Wall -c main.cpp
g++ -std=c++11 -o MasterTest MasterTest.o USFS.o USFS_Master.o I2CDevI2C.o main.o 
I2CDevI2C.o: In function `cpi2c_writeRegister(unsigned char, unsigned char, unsigned char)':
I2CDevI2C.cpp:(.text+0x148): undefined reference to `i2c_smbus_write_byte_data'
I2CDevI2C.o: In function `cpi2c_readRegisters(unsigned char, unsigned char, unsigned char, unsigned char*)':
I2CDevI2C.cpp:(.text+0x180): undefined reference to `i2c_smbus_write_byte'
I2CDevI2C.cpp:(.text+0x19c): undefined reference to `i2c_smbus_read_byte'
I2CDevI2C.o: In function `cpi2c_writeRegister_16_8(unsigned char, unsigned short, unsigned char)':
I2CDevI2C.cpp:(.text+0x1f8): undefined reference to `i2c_smbus_write_byte_data'
I2CDevI2C.o: In function `cpi2c_readRegister_8_16(unsigned char, unsigned char)':
I2CDevI2C.cpp:(.text+0x228): undefined reference to `i2c_smbus_write_byte'
I2CDevI2C.cpp:(.text+0x234): undefined reference to `i2c_smbus_read_word_data'
collect2: error: ld returned 1 exit status
Makefile:33: recipe for target 'MasterTest' failed
make: *** [MasterTest] Error 1

And I also have a question: In MasterTest.cpp, you don't read the Magnetometer values although the class features them. I can still add it with usfs.readMagnetometer(mx, my, mz), right?
Thanks for all your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions