![](/img/trans.png)
[英]Unresolved external symbols in my x86-32 code despite linking the library
[英]unresolved symbols remain Code composer studio
我一直在 MSP4302355 微控制器上嘗試我的第一個匯編級程序。 我所做的只是將值從一個寄存器移到另一個寄存器。 但是每當我編譯代碼時,我都會收到一個錯誤“錯誤 #10234-D:未解析的符號仍然存在”
錯誤 #10010:鏈接過程中遇到錯誤; “Register_Mode_Addr_2355.out”未構建”
我已經盡我所能,但仍然沒有用。
;-------------------------------------------------------------------------------
; MSP430 Assembler Code Template for use with TI Code Composer Studio
;
;
;-------------------------------------------------------------------------------
.cdecls C,LIST,"msp430.h" ; Include device header file
;-------------------------------------------------------------------------------
.def RESET ; Export program entry-point to
; make it known to linker.
;-------------------------------------------------------------------------------
.text ; Assemble into program memory.
.retain ; Override ELF conditional linking
; and retain current section.
.retainrefs ; And retain any sections that have
; references to current section.
;-------------------------------------------------------------------------------
RESET mov.w #__STACK_END,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer
;-------------------------------------------------------------------------------
; Main loop here
;-------------------------------------------------------------------------------
main:
mov.w PC, R4 ;Move from Program counter to Register R4
mov.w R4, R5 ;Move from R4 to Register R5
mov.w R5, R6 ;Move from R5 to Register R6
jmp main
;-------------------------------------------------------------------------------
; Stack Pointer definition
;-------------------------------------------------------------------------------
.global __STACK_END
.sect .stack
;-------------------------------------------------------------------------------
; Interrupt Vectors
;-------------------------------------------------------------------------------
.sect ".reset" ; MSP430 RESET Vector
.short RESET
請幫助我,提前謝謝
“保留未解析的符號”意味着鏈接器失敗,因為它無法從您的匯編源解析一個或多個符號,很可能是 __STACK_END 符號。 建議您打開顯示構建過程的控制台窗口,然后滾動查看未解析符號列表,很可能在最后。 這將確認 __STACK_END 符號,這是我對問題的猜測。 有點舊,但這個線程可能會有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.