XGate Shared Variables Link Errors (S12XE)

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

XGate Shared Variables Link Errors (S12XE)

ソリューションへジャンプ
874件の閲覧回数
rayhall
Contributor V

I am getting link errors and warnings when I make my project. I do not know how to fix them. This shows the errors.  http://www.turbofast.com.au/tfbin/ErrorsCanLogger.png

 

The problem relates to a structure that is defined in the GlobalsShared.h file. I get no errors when I compile the project.

 

I have attached the project files.

 

Ray.

Original Attachment has been moved to: CAN_Logger.zip

ラベル(1)
0 件の賞賛
1 解決策
661件の閲覧回数
kef2
Senior Contributor IV

XGATE compiler by default word aligns all struct members with sizeof() > 1. So you need to either insert "uint8_t dummy;" below or above unpaired acRequest , or in HC12 sources, which include GlobalsShared.h use pragma align like this

#pragma align on

#include "GlobalsShared.h"

#pragma align off

This will resolve different object size message. And to resolve "object defined twice", you need to insert extern keyword above your struct in *.h file.

Edward

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
662件の閲覧回数
kef2
Senior Contributor IV

XGATE compiler by default word aligns all struct members with sizeof() > 1. So you need to either insert "uint8_t dummy;" below or above unpaired acRequest , or in HC12 sources, which include GlobalsShared.h use pragma align like this

#pragma align on

#include "GlobalsShared.h"

#pragma align off

This will resolve different object size message. And to resolve "object defined twice", you need to insert extern keyword above your struct in *.h file.

Edward

0 件の賞賛
661件の閲覧回数
rayhall
Contributor V

Edward,

Thank you,

Ray.

0 件の賞賛