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

Sketch using SdFat fails to link certain functions #184

Open
mweber-ovt opened this issue Sep 6, 2019 · 0 comments
Open

Sketch using SdFat fails to link certain functions #184

mweber-ovt opened this issue Sep 6, 2019 · 0 comments

Comments

@mweber-ovt
Copy link

SdFat links correctly in the Arduino IDE. However, the use of certain functions in a sketch using SdFat results in linker errors as follows:

[100%] Linking CXX executable BGC_4G.elf
libmega_rawdata.a(rawdata.cpp.obj): In function `RAWDATA::store(EVENT, TrapStatus)':
/.../BGC_4G/lib/rawdata/rawdata.cpp:107: undefined reference to `FatFile::printField(int, char)'
collect2: error: ld returned 1 exit status

The recursive option is set for SdFat.

There is a header file SdFat/src/FatLib/FatFile.h which defines the prototypes for FatFile member functions including printField. However, the code for printField itself is in a file FatFilePrint.cpp. Moving it to the file FatFile.cpp eliminates the linker error but that seems like a dangerous workaround.

I am very new to CMake and I wonder if this is a bug or if anybody has a suggestion for what I could do to avoid this error?

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

1 participant