Skip to content

undefined reference with multiple names .ccp file in different folders #34

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

Closed
NicoHood opened this issue Oct 11, 2015 · 5 comments
Closed
Labels
type: support OT: Request for help using the project

Comments

@NicoHood
Copy link

There we go! Found a "better" bug finally :)

If you have a library structure like this:
/src/folderA/file.cpp
/src/folderB/file.cpp

You will get compile errors, even if the .cpp file (with the same name) just exists (empty):

Arduino/sketchbook/libraries/HID-Project/src/MultiReport/../HID-APIs/GamepadAPI.hpp:38: undefined reference to `Gamepad'
[more of them...}

Commit can be found here:
NicoHood/HID@6d6c7d3

This PR is required to build the Gamepad example without (other) compile errors:
arduino/Arduino#3948

So it looks like the builder does not differentiate between folders.

@matthijskooijman
Copy link
Collaborator

Weird, I thought we fixed this by keeping the library directory structure intact, but perhaps this wasn't copied over to the arduino-builder code?

Could you post a full verbose compilation output?

I suspect that this is a limitation of gcc-ar / .a files. If I read the ar manpage right, files inside an archive are by default identified by just their filenames, no path included. It seems there is a non-standard extension to use the full pathname, but gnu ar only supports reading such files, not writing them. Perhaps using compiler.ar.flags=qc (using quick append, rather then replace) might help, though I'm not sure how the linker then treats this archive.

@ffissore ffissore modified the milestones: 1.0.1, 1.0.2 Oct 27, 2015
@ffissore
Copy link
Contributor

@NicoHood can you pls provide full debug output?

@ffissore ffissore modified the milestones: 1.0.2, 1.0.3, 1.0.4 Oct 29, 2015
@NicoHood
Copy link
Author

I could not reproduce this anymore. The commit above does not work with the new Arduino API.
I do not intent to hunt this bug now. Maybe if I feel like renaming my files again I can check if it exists...

@ffissore ffissore modified the milestones: 1.0.4, 1.0.6 Nov 2, 2015
@ffissore
Copy link
Contributor

ffissore commented Nov 2, 2015

Leaving it open then. If if happens to find a way to reproduce it, let us know

@facchinm
Copy link
Member

AFAIK it was never reproduced, reopen if needed

@rsora rsora added the type: support OT: Request for help using the project label Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: support OT: Request for help using the project
Projects
None yet
Development

No branches or pull requests

5 participants