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

Undefined References #10

Open
alexisguiter opened this issue Jun 2, 2021 · 3 comments
Open

Undefined References #10

alexisguiter opened this issue Jun 2, 2021 · 3 comments

Comments

@alexisguiter
Copy link

alexisguiter commented Jun 2, 2021

Hi,

I am trying to compile C++ code based on the example code "i2c_without_internal_address.c"

However I keep getting erros when compiling such as:

undefined reference to `i2c_open'
undefined reference to `i2c_ioctl_write'
undefined reference to `i2c_close'

Is ther a proper way to compile perhaps? I'm using g++ my_code.cpp -o output

@GNiramay
Copy link

GNiramay commented Sep 1, 2021

I have the same issue. Did anyone find a solution?

@drewfowler17
Copy link

I am having the same issue. Any help?

@drewfowler17
Copy link

You need to compile it all together. I wasn't compiling the library, just the single file. i.e. If you had them all in the same folder (unlike how it is in the repo) your command would be: gcc i2c.c my_code.c -o output. @alexisguiter @GNiramay

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

3 participants