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

Linking error: multiple definition of '_mbox_fd' #2

Open
Razamuhin opened this issue Oct 4, 2022 · 3 comments
Open

Linking error: multiple definition of '_mbox_fd' #2

Razamuhin opened this issue Oct 4, 2022 · 3 comments

Comments

@Razamuhin
Copy link

Attempting to compile on Raspberry Pi 3B+ gives the following error message:

/usr/bin/ld: CMakeFiles/mipea.dir/src/mipea.c.o:/home/nova/pi-sat/cfs/apps/mipea/src/dma.h:106: multiple definition of `_mbox_fd'; CMakeFiles/mipea.dir/src/dma.c.o:/home/nova/pi-sat/cfs/apps/mipea/src/dma.h:106: first defined here
collect2: error: ld returned 1 exit status
make[7]: *** [apps/mipea/CMakeFiles/mipea.dir/build.make:253: apps/mipea/mipea.so] Error 1
make[6]: *** [CMakeFiles/Makefile2:1635: apps/mipea/CMakeFiles/mipea.dir/all] Error 2
make[5]: *** [Makefile:160: all] Error 2
make[4]: *** [CMakeFiles/native_default_cpu1-install.dir/build.make:76: CMakeFiles/native_default_cpu1-install] Error 2
make[3]: *** [CMakeFiles/Makefile2:512: CMakeFiles/native_default_cpu1-install.dir/all] Error 2
make[2]: *** [CMakeFiles/Makefile2:220: CMakeFiles/mission-install.dir/rule] Error 2
make[1]: *** [Makefile:207: mission-install] Error 2
make: *** [Makefile:123: install] Error 2

I've tried editing dma.h to include a '#pragma once' statement, and I've tried wrapping the offending variable with 'ifndef _mbox_fd ... endif', but no luck.

Attempting to compile on a Raspberry Pi 3B+ running Raspbian 11 (bullseye).

@Razamuhin
Copy link
Author

As a temporary fix, anyone having this issue can move the line 'int _mbox_fd' from 'cfs/apps/mipea/src/dma.h' into 'cfs/apps/mipea/src/dma.c'. This may not be very good practice but it will compile.

@dmccomas
Copy link
Contributor

dmccomas commented Oct 4, 2022

Thanks for posting a workaround. It's actually the solution I used when I migrated this work to cFS Basecamp and forgot that it needed to be fixed here. I'll make the fix here, but in the long term, Basecamp will be the future of my pi-sat work.

Basecamp is a modular solution that takes a cFS 'app store' approach. It has a Python GUI and cFS App Repos. The GUI automates the integration of adding apps to the Basecamp cFS target so users can build their own custom pi-sat. The mipea library has been renamed to pi_iolib.

Basecamp has built in tutorials and the gpio_demo was just added. I'm working on a remote ops tutorial with some Basecamp enhancements that will let the gpio_demo be remotely controlled by another Basecamp GUI instance. This should be done within the week.

@Razamuhin
Copy link
Author

That makes sense. Thanks for the quick response and for the pointer to Basecamp - I'll check it out.

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

2 participants