samjking / i2c

PHP extension port of the i2c tools
2 stars 2 forks source link

undefined symbol: i2c_smbus_write_word_data #1

Open kepon85 opened 5 years ago

kepon85 commented 5 years ago

Hello, I compiled and added i2c in extension but I get an error message when I try to run a command (i2cset for example)

A simple script :

<?php
i2cset(1, 0x04, 0x04, 0x61);
?>

Return : php: symbol lookup error: /usr/lib/php/20180731/i2c.so: undefined symbol: i2c_smbus_write_word_data

If I test with your example I get:


root@pi0(rw):/opt/i2c# php i2c.php 
Functions available in the test extension:
i2cget
i2cset

PHP Fatal error:  Uncaught Error: Call to undefined function confirm_i2c_compiled() in /opt/i2c/i2c.php:16
Stack trace:
#0 {main}
  thrown in /opt/i2c/i2c.php on line 16

Do you have an idea to help me?

Thank you in advance for your support! And thank you for this code!

David

nineff commented 4 years ago

likewise, i2c_smbus_read_word_data ist also undefined

halfer commented 1 year ago

Looks like it is not particular to a specific PHP ext project, I get it on this separate repo: https://github.com/embedded-php/ext-i2c/issues/2