Sorting out asm(); in KDS: How to change your compiler language to GNU ISO90

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Sorting out asm(); in KDS: How to change your compiler language to GNU ISO90

3,855件の閲覧回数
raels-r
Contributor IV

Problems with asm(); calls in KDS coming back as "undefined reference"?

as the FAQ says: KDS Frequently Asked Questions (FAQ)
"By default the compiler settings are for C99, and there the 'asm' keyword is not recognized. Either change it to __asm (with two underscores) or change the compiler settings to use GNU ISO 90"

 

so you can either add '__' in front of  all asm() calls (a simple search and replace should do), or you can edit the compiler options. If you're using a framework, you might prefer the compiler options route, so here's how to do that:

 

1) Access the Project options by right clicking your project and selecting 'Properties'

2)Navigate through to "C/C++ Build>Settings>Tool Settings>Cross ARM C Compiler > Optimization > Langauge Standard"

13104_13104.pngCompilerLanguageSettings.png

3) Select "Tool Chain Default (GNU ISO C90)" from the drop down menu

 

4) Your project should now build fine and "undefined reference: asm" should be a thing of the past!

 

Hope this is helpful for anyone like me who had asm issues and didn't know how to change these settings

 

If anyone knows how to set this as the default for all new KDS projects, please let me know!

ラベル(1)
0 件の賞賛
返信
1 返信

1,825件の閲覧回数
radiptacandra
Contributor I

I am facing this problem and just try your method, but it still not recognize the asm function. any other solution?

0 件の賞賛
返信