HI, MCUXpresso Expert
When I include <ctype.h> and call isdigit('A') function, during link stage, it report 'undefined reference to `__ctype'.
This only happens when I use connectivity example project, when uses driver example project, there is no problem.
I had tried to change several library format, it still has the same issue.
Environment: MCUxpresso 10.1.1
SDK: QN908x GA
I believe that this link issue is caused because the "Connectivity" projects having being configured so they use their own linker scripts and library support rather than the "normal" IDE functionality. I suspect that your problem is being triggered by the project effectively using the C library header files from Redlib, but then linking against other C library archives. And Redlib implements ctype differently.
Check the value in:
and if it says "Redlib (Auto)" try changing this to "Newlib (Auto)" instead, then rebuild.
Regards,
MCUXpresso IDE Support
hi, I create a new connectivity project and select newlib in wizard, it is ok now.
But if the project was created already and selected Redlib, I can't just switch to newlib. If I click manager link script, it will disable use my .ld
I want use both my .ld and newlib for existing project.
Hi Neo,
There is a workaround that you can do to have both QN908XC_connectivity.ld and newlib library selected for an existing connectivity project. Here is how:
1. Go to Project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> MCU Linker -> Managed Linker Script
2. Copy the text from Linker script edit box, i.e "QN908XC_connectivity.ld"
3. Select Manage linker script check-box
4. Change library to Newlib
5. Uncheck Manage linker script and paste back the original QN908XC_connectivity.ld file
6. Apply and close
7. Rebuild the project
Regards,
Mihai DRAGNEA
Hi, Expert
Do you mean the 'Library headers' setting in 'Miscellaneous' ? It is strange that I change from 'Redlib (Auto)' to 'Newlib (Auto)' and click apply & OK, next time I open the project setting, it is still 'Redlib (Auto)'. I think we need change library instead of headers?
In other SDK driver example project, it is Redlib, and I have no problem.
Another point is I noticed driver examples uses 'Managed Link script' instead of .ld file, while connectivity project uses .ld.