Please help.
When compiling debug it works fine. Once I compile the project for release I get the following link error:
Link Error : Undefined : "_io_sdcard_install"
Link failed
Any ideas why this would compile for debug and receive that error once compiling for release?
Thanks in advance.
Solved! Go to Solution.
Any chance in the debug build you are linking to a lib, but in release you are not?
Since I don't have the project, I can only guess.
In release the optimizer is on, perhaps that function gets optimized away????
Thanks Jim,
Is there a way to tell if it gets optimized away?
Look in the map file.
What is in the function?
I really meant do you have the function body?
Sorry, I believe this is what you were asking for:
if(_io_sdcard_install("sdcard:",(pointer)&tSYS_system_sd_init,tSYS_system_spi_handle)==MQX_OK)
it appears to say that the entire _io_sdcard struct is undefined.
Thanks
I think it's saying that the function _io_sdcard_install is not defined.
Do you know where _io_sdcard_install is defined?
It is defined in sdcard.h:
extern _mqx_int _io_sdcard_install(char_ptr,SDCARD_INIT_STRUCT_PTR,MQX_FILE_PTR);
Out of curriousity, it should be defined if it will compile for debug would it not?
Thanks
Here is the entire Errors:
Link Error : Undefined : "_io_sdcard_install"
Referenced from "SYS_system_fs_setup" in
Error : Undefined : "_io_sdcard_spi_init"
Referenced from "tSYS_system_sd_init" in
Error : Undefined : "_io_sdcard_spi_read_block"
Referenced from "tSYS_system_sd_init" in
Error : Undefined : "_io_sdcard_spi_write_block"
Referenced from "tSYS_system_sd_init" in
Link failed.
Any chance in the debug build you are linking to a lib, but in release you are not?
It was indeed not linking to the library. I recompiled the MQX libraries for release and it compiled no problem.
Thanks
Quite possibly,I just dug a little deeper and realized that when I compiled the MQX libraries I compiled the debug but no the release. Trying that right now.
Thanks
SYS_system.c is what is calling it. it is declared in sdcard.h