Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make fails part 2 #9

Open
fnoop opened this issue May 15, 2019 · 0 comments
Open

make fails part 2 #9

fnoop opened this issue May 15, 2019 · 0 comments

Comments

@fnoop
Copy link
Contributor

fnoop commented May 15, 2019

Related to #1

In file included from /usr/include/aarch64-linux-gnu/bits/byteswap.h:34:0,
                 from /usr/include/byteswap.h:24,
                 from /srv/maverick/var/build/jtx1inst/src/jtx1pow.c:17:
/srv/maverick/var/build/jtx1inst/src/jtx1pow.c: In function ‘convShuntVol’:
/srv/maverick/var/build/jtx1inst/src/jtx1pow.c:43:27: warning: implicit declaration of function ‘i2c_smbus_read_word_data’ [-Wimplicit-function-declaration]
   uint16_t v = __bswap_16(i2c_smbus_read_word_data(file, reg));
                           ^
/srv/maverick/var/build/jtx1inst/src/jtx1pow.c: In function ‘jtx1_get_ina3221_userspace_i2c’:
/srv/maverick/var/build/jtx1inst/src/jtx1pow.c:173:7: warning: implicit declaration of function ‘ioctl’ [-Wimplicit-function-declaration]
   if (ioctl(file, I2C_SLAVE, addr) < 0) {
       ^~~~~
/srv/maverick/var/build/jtx1inst/src/jtx1pow.c:203:10: warning: ‘return’ with a value, in function returning void
   return 0;

...

[100%] Linking C executable jtx1inst_demo
libjtx1inst.so: undefined reference to `i2c_smbus_read_word_data'
collect2: error: ld returned 1 exit status
CMakeFiles/jtx1inst_demo.dir/build.make:95: recipe for target 'jtx1inst_demo' failed
make[2]: *** [jtx1inst_demo] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/jtx1inst_demo.dir/all' failed
make[1]: *** [CMakeFiles/jtx1inst_demo.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

If I install libi2c-dev and include i2c/smbus.h in src/jtx1pow.c it gets rid of the implicit declaration but still doesn't link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant