analogdevicesinc / pmbus_dpsm

PMBus/SMBus example code for Digital Power System Management devices
Other
3 stars 0 forks source link

error: ‘i2c_smbus_write_byte_data’ was not declared in this scope #1

Open johnsoupir opened 2 years ago

johnsoupir commented 2 years ago

I'm trying to compile following the instructions in the readme. There are many

not declared in this scope

errors. It seems maybe some header is missing or wrong, not sure. Complete output from make is below:

pi@raspberrypi:~/pmbus_dpsm $ make make all-recursive make[1]: Entering directory '/home/pi/pmbus_dpsm' Making all in src make[2]: Entering directory '/home/pi/pmbus_dpsm/src' g++ -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT LT_PMBusApp.o -MD -MP -MF .deps/LT_PMBusApp.Tpo -c -o LT_PMBusApp.o LT_PMBusApp.cpp mv -f .deps/LT_PMBusApp.Tpo .deps/LT_PMBusApp.Po g++ -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT LT_PMBus.o -MD -MP -MF .deps/LT_PMBus.Tpo -c -o LT_PMBus.o LT_PMBus.cpp mv -f .deps/LT_PMBus.Tpo .deps/LT_PMBus.Po g++ -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT LT_SMBus.o -MD -MP -MF .deps/LT_SMBus.Tpo -c -o LT_SMBus.o LT_SMBus.cpp mv -f .deps/LT_SMBus.Tpo .deps/LT_SMBus.Po g++ -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT LT_SMBusBase.o -MD -MP -MF .deps/LT_SMBusBase.Tpo -c -o LT_SMBusBase.o LT_SMBusBase.cpp LT_SMBusBase.cpp: In member function ‘virtual int LT_SMBusBase::writeByte(uint8_t, uint8_t, uint8_t)’: LT_SMBusBase.cpp:98:7: error: ‘i2c_smbus_write_byte_data’ was not declared in this scope if (i2c_smbus_write_byte_data(LTSMBusBase::file, command, data) == -1) ^~~~~~~~~ LT_SMBusBase.cpp:98:7: note: suggested alternative: ‘i2c_smbus_ioctl_data’ if (i2c_smbus_write_byte_data(LTSMBusBase::file, command, data) == -1) ^~~~~~~~~ i2c_smbus_ioctl_data LT_SMBusBase.cpp: In member function ‘virtual int LT_SMBusBase::readByte(uint8_t, uint8_t)’: LT_SMBusBase.cpp:146:17: error: ‘i2c_smbus_read_byte_data’ was not declared in this scope if ((result = i2c_smbus_read_byte_data(LTSMBusBase::file, command)) == -1) ^~~~~~~~ LT_SMBusBase.cpp:146:17: note: suggested alternative: ‘i2c_smbus_ioctl_data’ if ((result = i2c_smbus_read_byte_data(LTSMBusBase::file, command)) == -1) ^~~~~~~~ i2c_smbus_ioctl_data LT_SMBusBase.cpp: In member function ‘virtual int LT_SMBusBase::writeWord(uint8_t, uint8_t, uint16_t)’: LT_SMBusBase.cpp:167:7: error: ‘i2c_smbus_write_word_data’ was not declared in this scope if (i2c_smbus_write_word_data(LTSMBusBase::file, command, data) == -1) ^~~~~~~~~ LT_SMBusBase.cpp:167:7: note: suggested alternative: ‘i2c_smbus_ioctl_data’ if (i2c_smbus_write_word_data(LTSMBusBase::file, command, data) == -1) ^~~~~~~~~ i2c_smbus_ioctl_data LT_SMBusBase.cpp: In member function ‘virtual int LT_SMBusBase::readWord(uint8_t, uint8_t)’: LT_SMBusBase.cpp:188:16: error: ‘i2c_smbus_read_word_data’ was not declared in this scope if((result = i2c_smbus_read_word_data(LTSMBusBase::file, command)) == -1) ^~~~~~~~ LT_SMBusBase.cpp:188:16: note: suggested alternative: ‘i2c_smbus_ioctl_data’ if((result = i2c_smbus_read_word_data(LTSMBusBase::file, command)) == -1) ^~~~~~~~ i2c_smbus_ioctl_data LT_SMBusBase.cpp: In member function ‘virtual int LT_SMBusBase::writeBlock(uint8_t, uint8_t, uint8_t, uint16_t)’: LT_SMBusBase.cpp:209:15: error: ‘I2C_FUNC_SMBUS_READ_BLOCK_DATA’ was not declared in this scope if (funcs & I2C_FUNC_SMBUS_READ_BLOCK_DATA) ^~~~~~~~~~ LT_SMBusBase.cpp:213:9: error: ‘i2c_smbus_write_block_data’ was not declared in this scope if (i2c_smbus_write_block_data(LTSMBusBase::file, address, command, block) == -1) ^~~~~~ LT_SMBusBase.cpp:213:9: note: suggested alternative: ‘i2c_smbus_ioctl_data’ if (i2c_smbus_write_block_data(LTSMBusBase::file, address, command, block) == -1) ^~~~~~ i2c_smbus_ioctl_data LT_SMBusBase.cpp: In member function ‘virtual int LT_SMBusBase::readBlock(uint8_t, uint8_t, uint8_t, uint16_t)’: LT_SMBusBase.cpp:246:15: error: ‘I2C_FUNC_SMBUS_READ_BLOCK_DATA’ was not declared in this scope if (funcs & I2C_FUNC_SMBUS_READ_BLOCK_DATA) ^~~~~~~~~~ LT_SMBusBase.cpp:251:13: error: ‘i2c_smbus_read_block_data’ was not declared in this scope count = i2c_smbus_read_block_data(LTSMBusBase::file, command, block); ^~~~~~~~~ LT_SMBusBase.cpp:251:13: note: suggested alternative: ‘i2c_smbus_ioctl_data’ count = i2c_smbus_read_block_data(LTSMBusBase::file, command, block); ^~~~~~~~~ i2c_smbus_ioctl_data LT_SMBusBase.cpp: In member function ‘virtual int LT_SMBusBase::sendByte(uint8_t, uint8_t)’: LT_SMBusBase.cpp:276:7: error: ‘i2c_smbus_write_byte’ was not declared in this scope if (i2c_smbus_write_byte(LTSMBusBase::file, command) == -1) ^~~~~~~~ LT_SMBusBase.cpp:276:7: note: suggested alternative: ‘i2c_smbus_ioctl_data’ if (i2c_smbus_write_byte(LTSMBusBase::file, command) == -1) ^~~~~~~~ i2c_smbus_ioctl_data LT_SMBusBase.cpp: In member function ‘virtual int LT_SMBusBase::waitForAck(uint8_t, uint8_t)’: LT_SMBusBase.cpp:332:9: error: ‘i2c_smbus_read_byte_data’ was not declared in this scope if (i2c_smbus_read_byte_data(LTSMBusBase::file, command) >= 0) ^~~~~~~~ LT_SMBusBase.cpp:332:9: note: suggested alternative: ‘i2c_smbus_ioctl_data’ if (i2c_smbus_read_byte_data(LTSMBusBase::file, command) >= 0) ^~~~~~~~ i2c_smbus_ioctl_data LT_SMBusBase.cpp: In member function ‘virtual uint8_t LT_SMBusBase::probe(uint8_t)’: LT_SMBusBase.cpp:364:14: error: ‘i2c_smbus_read_byte_data’ was not declared in this scope result = i2c_smbus_read_byte_data(LTSMBusBase::file, command); ^~~~~~~~ LT_SMBusBase.cpp:364:14: note: suggested alternative: ‘i2c_smbus_ioctl_data’ result = i2c_smbus_read_byte_data(LTSMBusBase::file, command); ^~~~~~~~ i2c_smbus_ioctl_data LT_SMBusBase.cpp: In member function ‘virtual uint8_t LT_SMBusBase::probeUnique(uint8_t)’: LT_SMBusBase.cpp:411:14: error: ‘i2c_smbus_read_byte_data’ was not declared in this scope result = i2c_smbus_read_byte_data(LTSMBusBase::file, command); ^~~~~~~~ LT_SMBusBase.cpp:411:14: note: suggested alternative: ‘i2c_smbus_ioctl_data’ result = i2c_smbus_read_byte_data(LTSMBusBase::file, command); ^~~~~~~~ i2c_smbus_ioctl_data LT_SMBusBase.cpp: In member function ‘virtual int LT_SMBusBase::writeByte(uint8_t, uint8_t, uint8_t)’: LT_SMBusBase.cpp:108:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ LT_SMBusBase.cpp: In member function ‘virtual int LT_SMBusBase::readByte(uint8_t, uint8_t)’: LT_SMBusBase.cpp:157:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ LT_SMBusBase.cpp: In member function ‘virtual int LT_SMBusBase::writeWord(uint8_t, uint8_t, uint16_t)’: LT_SMBusBase.cpp:177:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ LT_SMBusBase.cpp: In member function ‘virtual int LT_SMBusBase::readWord(uint8_t, uint8_t)’: LT_SMBusBase.cpp:200:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ LT_SMBusBase.cpp: In member function ‘virtual int LT_SMBusBase::readBlock(uint8_t, uint8_t, uint8_t*, uint16_t)’: LT_SMBusBase.cpp:245:8: warning: control reaches end of non-void function [-Wreturn-type] ioctl(LTSMBusBase::file, I2C_FUNCS, &funcs);


LT_SMBusBase.cpp: In member function ‘virtual int LT_SMBusBase::sendByte(uint8_t, uint8_t)’:
LT_SMBusBase.cpp:286:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make[2]: *** [Makefile:468: LT_SMBusBase.o] Error 1
make[2]: Leaving directory '/home/pi/pmbus_dpsm/src'
make[1]: *** [Makefile:357: all-recursive] Error 1
make[1]: Leaving directory '/home/pi/pmbus_dpsm'
make: *** [Makefile:298: all] Error 2
sipvoip commented 2 years ago

Getting the same issue.