Link Error

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
3,283件の閲覧回数
blakehodder
Contributor III

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.

ラベル(1)
タグ(3)
0 件の賞賛
返信
1 解決策
3,071件の閲覧回数
JimDon
Senior Contributor III

Any chance in the debug build you are linking to a lib, but in release you are not?

元の投稿で解決策を見る

0 件の賞賛
返信
12 返答(返信)
3,071件の閲覧回数
JimDon
Senior Contributor III

Since I don't have the project, I can only guess.

In release the optimizer is on, perhaps that function gets optimized away????

0 件の賞賛
返信
3,071件の閲覧回数
blakehodder
Contributor III

Thanks Jim,

Is there a way to tell if it gets optimized away?

0 件の賞賛
返信
3,071件の閲覧回数
JimDon
Senior Contributor III

Look in the map file.

What is in the function?

0 件の賞賛
返信
3,071件の閲覧回数
JimDon
Senior Contributor III

I really meant do you have the function body?

0 件の賞賛
返信
3,071件の閲覧回数
blakehodder
Contributor III

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

0 件の賞賛
返信
3,071件の閲覧回数
JimDon
Senior Contributor III

I think it's saying that the function _io_sdcard_install is not defined.

Do you know where _io_sdcard_install is defined?

0 件の賞賛
返信
3,071件の閲覧回数
blakehodder
Contributor III

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

0 件の賞賛
返信
3,071件の閲覧回数
blakehodder
Contributor III

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.

0 件の賞賛
返信
3,072件の閲覧回数
JimDon
Senior Contributor III

Any chance in the debug build you are linking to a lib, but in release you are not?

0 件の賞賛
返信
3,071件の閲覧回数
blakehodder
Contributor III

It was indeed not linking to the library. I recompiled the MQX libraries for release and it compiled no problem.

Thanks

0 件の賞賛
返信
3,071件の閲覧回数
blakehodder
Contributor III

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

0 件の賞賛
返信
3,071件の閲覧回数
blakehodder
Contributor III

SYS_system.c is what is calling it. it is declared in sdcard.h

0 件の賞賛
返信