• slider image 442
  • slider image 477
  • slider image 479
  • slider image 480
  • slider image 481
  • slider image 482
:::


Browsing this Thread:   1 Anonymous Users






Re: 請問error: (1098) conflicting declarations for variable "_Bubble_Sort"?
#6
管理員
管理員


查看用戶資訊
jlian你好,詢問一下 com.c 中是否有加入 #include "com.h" ,如果沒有可以嘗試添加後重新編譯。

發表於: 2022/2/17 15:18
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問error: (1098) conflicting declarations for variable "_Bubble_Sort"?
#5
資深會員
資深會員


查看用戶資訊
請問一下, 您的Hex2Asc() function implementation是不是放在Bubble_Sort() function的前面?


如果您把Hex2Asc() function implementation擺放在Bubble_Sort()之後, 我猜編譯的錯誤訊息應該會變成

error: (1098) conflicting declarations for variable "_Hex2Asc"

發表於: 2022/2/16 17:22
不要盲目地從一堆“嘗試”中去找答案;將時間用來找尋“最正確”的方法。
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問error: (1098) conflicting declarations for variable "_Bubble_Sort"?
#4
資深會員
資深會員


查看用戶資訊
有專案嗎? 我可以幫忙看一下~

另外把com.h的Header Guard先comment out掉, 測試看看~

發表於: 2022/2/16 13:51
不要盲目地從一堆“嘗試”中去找答案;將時間用來找尋“最正確”的方法。
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問error: (1098) conflicting declarations for variable "_Bubble_Sort"?
#3
資深會員
資深會員


查看用戶資訊
Dear GodBlessU :

應該沒重複...

謝謝.

發表於: 2022/2/16 9:29

Edited by jlian on 2022年02月16日 09:48:57
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問error: (1098) conflicting declarations for variable "_Bubble_Sort"?
#2
資深會員
資深會員


查看用戶資訊
您可以確認一下您所有的header file的Header Guard是否有重複的名稱.

Header Guard如下 :

#ifndef XC_HEADER_TEMPLATE_H
#define XC_HEADER_TEMPLATE_H

發表於: 2022/2/15 17:42
不要盲目地從一堆“嘗試”中去找答案;將時間用來找尋“最正確”的方法。
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


請問error: (1098) conflicting declarations for variable "_Bubble_Sort"?
#1
資深會員
資深會員


查看用戶資訊
大家好 :

MPLABx : V5.45
XC8 : V2.31

1.出現如下的情況 :
main.c:129:5: warning: implicit declaration of function 'Bubble_Sort' is invalid in C99 [-Wimplicit-function-declaration]
error: (1098) conflicting declarations for variable "_Bubble_Sort" (main.c:129)

2.原因 :
在com.c及com.h皆有Bubble_Sort(),
在main有include com.h及call Bubble_Sort(),
為何會出現1.的情況?

3.解法 :
在main前加一extern即可解決.

4.其他 :
但另一個在com.c及com.h的Hex2Asc()卻不會有這種情形...
有人知道為何會有兩種不同的情況發生?

謝謝.

發表於: 2022/2/15 16:37
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------