PCDVD數位科技討論區

PCDVD數位科技討論區 (https://www.pcdvd.com.tw/index.php)
-   疑難雜症區 (https://www.pcdvd.com.tw/forumdisplay.php?f=34)
-   -   請教 C++ duplicate symbol 修復問題 (https://www.pcdvd.com.tw/showthread.php?t=1037442)

mrLaba 2014-01-22 09:48 AM

請教 C++ duplicate symbol 修復問題
 
終端機編譯的時候出現 duplicate symbol

錯誤的地方在這裡(紅字部分)
xxx.c
代碼:
#include "xxx.h"
.....略
	if (ssse3_obj->islegacy) {
		_store_mmx (ssse3_obj->udo_dst->base - UD_R_MM0, &ssse3_obj->dst.uint64[0]);
		if (ssse3_obj->udo_src->type == UD_OP_REG) {
			_store_mmx (ssse3_obj->udo_src->base - UD_R_MM0, &ssse3_obj->src.uint64[0]);


		_store_xmm (ssse3_obj->udo_dst->base - UD_R_XMM0, &ssse3_obj->dst.uint128);
		if (ssse3_obj->udo_src->type == UD_OP_REG) {
			_store_xmm (ssse3_obj->udo_src->base - UD_R_XMM0, &ssse3_obj->src.uint128);


xxx.h 內容

代碼:
inline void _store_xmm (const uint8_t n, __uint128_t *where)
{
	switch (n) {
case 0:  storedqu_template(0, where); break;
case 1:  storedqu_template(1, where); break;
case 2:  storedqu_template(2, where); break;
case 3:  storedqu_template(3, where); break;
case 4:  storedqu_template(4, where); break;
case 5:  storedqu_template(5, where); break;
case 6:  storedqu_template(6, where); break;
case 7:  storedqu_template(7, where); break;
case 8:  storedqu_template(8, where); break;
case 9:  storedqu_template(9, where); break;
case 10: storedqu_template(10, where); break;
case 11: storedqu_template(11, where); break;
case 12: storedqu_template(12, where); break;
case 13: storedqu_template(13, where); break;
case 14: storedqu_template(14, where); break;
case 15: storedqu_template(15, where); break;
}}

T磨人 2014-01-22 10:01 AM

參考這篇
http://stackoverflow.com/questions/...ate-symbol-in-c

27681049 2014-01-22 10:58 AM

請問一下你用哪個編譯器.
VS2008不會抱怨…

:confused: :confused: :confused:

mrLaba 2014-01-22 11:50 AM

引用:
作者27681049
請問一下你用哪個編譯器.
VS2008不會抱怨…

:confused: :confused: :confused:


XCODE 4.1 :confused:

T磨人 2014-01-22 12:00 PM

引用:
作者mrLaba
XCODE 4.1 :confused:



http://www.zhihu.com/question/20728615

mrLaba 2014-01-22 12:11 PM

引用:
作者T磨人
http://www.zhihu.com/question/20728615


我是安裝 4.1 指令行工具 用終端機輸入指令編譯

但是這個用 Xcode 5.0.2 編譯就沒問題了

我對這個也不是很懂

換到 4.1 突然不會改 :confused:


所有的時間均為GMT +8。 現在的時間是01:55 AM.

vBulletin Version 3.0.1
powered_by_vbulletin 2026。