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

Nucleo64 : undefined reference to `_open' #33

Open
CFTechno opened this issue Jun 8, 2023 · 6 comments
Open

Nucleo64 : undefined reference to `_open' #33

CFTechno opened this issue Jun 8, 2023 · 6 comments
Labels
progress: waiting for confirmation and close Waiting for confirmation and close

Comments

@CFTechno
Copy link

CFTechno commented Jun 8, 2023

c:/users/xxx/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe:

c:/users/xxx/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/10.3.1-2.3/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard\libc_nano.a(lib_a-openr.o): in function _open_r': (.text._open_r+0x10): undefined reference to _open'
collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

@wystewart
Copy link

you need to modify filesupport.cpp and .h for your board. The library only supports M5STack and WIOTerminal at the moment. From wiki:

SD card access is strongly hardware dependent, so for hardware other than M5Stack and Wio Terminal, you will need to add file manipulation functions to FileSupport.cpp/.h.

@Uzair835
Copy link

I am also having this issue and unsure how to go about fixing it. I am using an STM32 (bluepill), and NOT loading the font from an SD card. How can the library be modified to accept the font file being saved within the chip? Everything that I see appears to rely on FileSupport and loading files from the SD card

@takkaO
Copy link
Owner

takkaO commented Jan 16, 2024

I'm implementing changes to handle the file I/O processes that different for each board in an unified manner. There are in the tmp branch now.

Users can handle all types of storage by simply providing five functions (fopen, fclose, fread, fseek, ftell) to manipulate files from any storage.

The input/output and operation of these five functions are the same as standard C language functions.

I plan to integrate it into the master branch in the near future.
Thank you.

@Uzair835
Copy link

Thank you! At the moment, is there any workaround to using this library without an SD card? I see examples about loading binary fonts, but even when copying those I get the same error of there being no reference to _open. Just want to make sure I am not missing something obvious.

@takkaO
Copy link
Owner

takkaO commented Jan 17, 2024

@Uzair835

Perhaps the fopen function etc. is not recognized, try including stdio.h in FileSupport.h.
If including stdio.h causes other problems, try defining an appropriate empty function in FileSupport.cpp.

@takkaO
Copy link
Owner

takkaO commented May 8, 2024

@Uzair835

OpenFontRender v1.2 now includes enhanced support for file systems.
This should allow font files to be loaded on various hardware without library changes.

Please see document and sample code for more info.
Welcome your feedback.

Sorry for the crazy slow response.

@takkaO takkaO added the progress: waiting for confirmation and close Waiting for confirmation and close label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
progress: waiting for confirmation and close Waiting for confirmation and close
Projects
None yet
Development

No branches or pull requests

4 participants