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

C++: change compiler variables to simplify cross-compilation #44

Merged
merged 1 commit into from
Apr 21, 2020

Conversation

corteccia
Copy link
Contributor

@corteccia corteccia commented Apr 20, 2020

Hello!

I tried to cross-compiled and got some errors: ld returned 1 exit status, make: Command not found, or just compiled using g++, not cross-compiler.

In order to fix this I suggest this change.

Even though it doesn't fix everything (there's still dependency on pigpio library that can't just be installed on host machine), it's better.

After applying this change and compiling with arm-linux-gnueabihf-g++ you'll get errors with RCInput_Navio.cpp that has a dependency on pigpio.h. I would try to handle with it in other commits.

Copy link
Contributor

@staroselskii staroselskii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR!

Could you please elaborate on what kind of issues you had?

"C++: all: Makefile: change CXX to optional" doesn't really represent what is going on in this commit.

You're actually not only making CXX optional but also changing CC to CXX in some examples. Please, add more context to the commit message.

@corteccia
Copy link
Contributor Author

Change commit message. Is it more understandable now?

@corteccia corteccia changed the title C++: all: Makefile: change CXX to optional C++: change compiler variables to simplify cross-compilation Apr 20, 2020
Some C++ examples could not be cross-compiled for RPi using export
CXX=arm-linux-gnueabihf-g++  because some compiler variables could not
be set from outside or were compiled with C compiler. After this change,
all examples will be compiled with C++ compiler that can be overridden
with an environment variable set to the cross-compiler.
This commit doesn't make everything cross-compile as there's a
dependency on pigpio library that should be addressed in other commits.
Copy link
Contributor

@staroselskii staroselskii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@staroselskii staroselskii merged commit 2f7512f into emlid:master Apr 21, 2020
@corteccia corteccia deleted the pr-cross-compilation-fix branch September 2, 2020 16:48
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

Successfully merging this pull request may close these issues.

None yet

2 participants