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

RPi2 w/ Ubuntu ARM: undefined reference when trying to build examples_linux #239

Closed
hy565 opened this issue Apr 4, 2016 · 4 comments
Closed
Labels

Comments

@hy565
Copy link

hy565 commented Apr 4, 2016

Hi guys,

I'm trying to get the library running on a Raspberry Pi 2, but I'm having some problems. I think it could be because I'm running Ubuntu 14.04 LTS on my RPi2 instead of Raspbian.

I git cloned the RF24 library and had no problems installing it using "sudo make install".

However, when I tried to build the examples to test out the hardware, I'm getting a whole bunch of "undefined reference" errors, shown in the screenshot below:

screenshot 2016-04-04 19 07 06

The installation seems to install the library files to /usr/local/include and /usr/local/lib, I don't know if that's right...but it seems that the compiler can't find the appropriate header files.

Has anybody encountered something similar or can suggest any way I can troubleshoot this?

Thank you.

@martin-mat
Copy link
Collaborator

Hi @hy565
This is result of my last commit, sorry :-)
I'll be able to test/detect problems on ubuntu later today.
Until then, to unblock you, undo my latest change by:
git reset --hard a1d346a9d18d318da8ee0638969f12f064b0351f

@hy565
Copy link
Author

hy565 commented Apr 5, 2016

Hi @mz-fuzzy,

Thanks for the quick reply. I don't think it has to do with your last commit though. I tried making the examples_RPi folder before the weekend (before your commit) and faced the same error. I saw your new commit and tried it out again with the examples_linux folder and hit the same wall.

I've also did the git reset and tried to make the examples_RPi folder again, and sure enough, I am still getting the same undefined reference errors.

I'm still trying to figure out what exactly is the difference in my Ubuntu ARM setup that prevents the example from compiling, and I hope you or anyone here can help me out!

Thanks.

martin-mat referenced this issue Apr 5, 2016
in c++ build command line. Fix for ubunutu compilation.

Signed-off-by: mz-fuzzy <mzfuzzy800@gmail.com>
@martin-mat
Copy link
Collaborator

fixed by 061341e
@hy565 please check.

@martin-mat martin-mat added the bug label Apr 5, 2016
@hy565
Copy link
Author

hy565 commented Apr 5, 2016

Your latest commit fixed it, I am able to compile the examples on Ubuntu now.

Thanks @mz-fuzzy !

ubuntu@ubuntu:/RF24/examples_linux$ make
arm-linux-gnueabihf-g++ -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -Ofast -Wall -pthread -I/usr/local/include/RF24/.. -I.. -L/usr/local/lib gettingstarted.cpp -lrf24 -o gettingstarted
arm-linux-gnueabihf-g++ -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -Ofast -Wall -pthread -I/usr/local/include/RF24/.. -I.. -L/usr/local/lib gettingstarted_call_response.cpp -lrf24 -o gettingstarted_call_response
arm-linux-gnueabihf-g++ -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -Ofast -Wall -pthread -I/usr/local/include/RF24/.. -I.. -L/usr/local/lib transfer.cpp -lrf24 -o transfer
arm-linux-gnueabihf-g++ -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -Ofast -Wall -pthread -I/usr/local/include/RF24/.. -I.. -L/usr/local/lib pingpair_dyn.cpp -lrf24 -o pingpair_dyn
pingpair_dyn.cpp: In function 'int main(int, char**)':
pingpair_dyn.cpp:201:42: warning: 'len' may be used uninitialized in this function [-Wmaybe-uninitialized]
radio.write( receive_payload, len );
^
ubuntu@ubuntu:
/RF24/examples_linux$

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

No branches or pull requests

2 participants