線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:2795
推到 Plurk!
推到 Facebook!

BCB 如何使用 VC 的 Obj 檔案

尚未結案
dan59314
中階會員


發表:121
回覆:107
積分:86
註冊:2002-08-16

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-02-16 14:08:55 IP:211.23.xxx.xxx 未訂閱
請問各位先進, 我在 BCB 內import VC 產生的 OBJ 檔案,Compile 後出現以下訊息 [Linker Error] 'F:\SOURCECODE\BCB\CONSOLE\FOS2DONGLE200310\ENCODE\ENCODE.OBJ' contains invalid OMF record, type 0x4c (possibly COFF) 請問要如何能正確使用 VC 的 obj 檔呢? 軟還要更軟,我的Artwork http://delphi.ktop.com.tw/topic.php?TOPIC_ID=27674 Chinese Girl in Rhino3D http://rhino3d.com/gallery/figure/girl.htm 發表人 - taishyang 於 2004/02/16 14:51:22
RaynorPao
版主


發表:139
回覆:3622
積分:7025
註冊:2002-08-12

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-02-17 09:24:11 IP:203.73.xxx.xxx 未訂閱
引言: 請問各位先進, 我在 BCB 內import VC 產生的 OBJ 檔案,Compile 後出現以下訊息 [Linker Error] 'F:\SOURCECODE\BCB\CONSOLE\FOS2DONGLE200310\ENCODE\ENCODE.OBJ' contains invalid OMF record, type 0x4c (possibly COFF) 請問要如何能正確使用 VC 的 obj 檔呢? 軟還要更軟,我的Artwork http://delphi.ktop.com.tw/topic.php?TOPIC_ID=27674 Chinese Girl in Rhino3D http://rhino3d.com/gallery/figure/girl.htm
fy 你好: 據小弟我所知是不行的,比較可行的方式,是將自己拿到的 *.obj 或 *.lib, 先利用 VC 包裝成 DLL 再給 BCB 使用,與這篇文章中的做法類似,先參考看看 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=33420 -- Enjoy Researching & Developing --
------
-- 若您已經得到滿意的答覆,請適時結案!! --
-- 欲知前世因,今生受者是;欲知來世果,今生做者是 --
-- 一切有為法,如夢幻泡影,如露亦如電,應作如是觀 --
dan59314
中階會員


發表:121
回覆:107
積分:86
註冊:2002-08-16

發送簡訊給我
#3 引用回覆 回覆 發表時間:2004-02-17 10:31:47 IP:211.23.xxx.xxx 未訂閱
引言: fy 你好: 據小弟我所知是不行的,比較可行的方式,是將自己拿到的 *.obj 或 *.lib, 先利用 VC 包裝成 DLL 再給 BCB 使用,與這篇文章中的做法類似,先參考看看 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=33420
謝謝 RaynorPao 兄,再請問 obj 檔要怎麼包裝成 DLL 呢?我看了連結的文章,好像沒有提到呢。 軟還要更軟,我的Artwork http://delphi.ktop.com.tw/topic.php?TOPIC_ID=27674 Chinese Girl in Rhino3D http://rhino3d.com/gallery/figure/girl.htm
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#4 引用回覆 回覆 發表時間:2004-02-17 13:11:13 IP:61.218.xxx.xxx 未訂閱
引言:
引言: fy 你好: 據小弟我所知是不行的,比較可行的方式,是將自己拿到的 *.obj 或 *.lib, 先利用 VC 包裝成 DLL 再給 BCB 使用,與這篇文章中的做法類似,先參考看看 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=33420
謝謝 RaynorPao 兄,再請問 obj 檔要怎麼包裝成 DLL 呢?我看了連結的文章,好像沒有提到呢。 軟還要更軟,我的Artwork http://delphi.ktop.com.tw/topic.php?TOPIC_ID=27674 Chinese Girl in Rhino3D http://rhino3d.com/gallery/figure/girl.htm
Hi fy: C++Builder uses different format (OMF) of object files (OBJ) and libraries (LIB) than MS Visual C++ (COFF). As I can guess DirectX SDK is compiled with VC++. C++Builder includes utility called COFF2OMF to convert COFF files to OMF ones. You can found this COFF2OMF.EXE in CBUILDER\BIN directory where CBUILDER means dir you've installed C++Builder. Good Luck!!!
/*生活是一種藝術,用心生活才能享受生活*/
dan59314
中階會員


發表:121
回覆:107
積分:86
註冊:2002-08-16

發送簡訊給我
#5 引用回覆 回覆 發表時間:2004-02-17 15:59:24 IP:211.23.xxx.xxx 未訂閱
引言: C Builder uses different format (OMF) of object files (OBJ) and libraries (LIB) than MS Visual C (COFF). As I can guess DirectX SDK is compiled with VC . C Builder includes utility called COFF2OMF to convert COFF files to OMF ones. You can found this COFF2OMF.EXE in CBUILDER\BIN directory where CBUILDER means dir you've installed C Builder.
AxSoft 兄, Actually I'd tried implib.exe and coff2omf.exe but in vain. It seems only work for *.lib. Thank you. Any other idea? 軟還要更軟,我的Artwork http://delphi.ktop.com.tw/topic.php?TOPIC_ID=27674 Chinese Girl in Rhino3D http://rhino3d.com/gallery/figure/girl.htm
Royce520
高階會員


發表:18
回覆:157
積分:100
註冊:2002-09-13

發送簡訊給我
#6 引用回覆 回覆 發表時間:2004-02-17 17:12:27 IP:61.230.xxx.xxx 未訂閱
fy 你好,   既然 如你所說... 已經試過axsoft 所提的 coff2omf   哪麼還是建議 你採用包仔的建議 用vc 將 obj 轉成   vc 的 lib, 然後再使用 coff2omf 把她轉成 bcb 可以使用   的 lib 來使用... 至於 怎麼把 obj 加到 vc project 編譯   成 lib, 我想跟 BCB 差不多吧... ><>*真實的事物最美, 簡單的道理最好, 我能體會的 太少*
------
不要忘記呼吸,不要忘記編程! ∩__∩
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#7 引用回覆 回覆 發表時間:2004-02-17 17:53:53 IP:61.218.xxx.xxx 未訂閱
[code] Hify: 1.Sorry,記得印像中Coff2omf.exe可以在Borland C++ 5.x時可以轉mfc的Obj   ,所以忘了去看BCB中的Help   COFF2OMF(Convert Object and Lib Files to OMF)   http://www.digitalmars.com/ctg/implib.html    2.BCB Help中的說明:
/*生活是一種藝術,用心生活才能享受生活*/
RaynorPao
版主


發表:139
回覆:3622
積分:7025
註冊:2002-08-12

發送簡訊給我
#8 引用回覆 回覆 發表時間:2004-02-18 09:46:26 IP:203.73.xxx.xxx 未訂閱
引言: 謝謝 RaynorPao 兄,再請問 obj 檔要怎麼包裝成 DLL 呢?我看了連結的文章,好像沒有提到呢。
fy 你好:
其實方法都是很相似的,請參考以下的說明
(>    < src="http://delphi.ktop.com.tw/loadfile.php?TOPICID=10003806&CC=223734"> -- Enjoy Researching & Developing --
        
------
-- 若您已經得到滿意的答覆,請適時結案!! --
-- 欲知前世因,今生受者是;欲知來世果,今生做者是 --
-- 一切有為法,如夢幻泡影,如露亦如電,應作如是觀 --
dan59314
中階會員


發表:121
回覆:107
積分:86
註冊:2002-08-16

發送簡訊給我
#9 引用回覆 回覆 發表時間:2004-02-18 17:24:16 IP:211.23.xxx.xxx 未訂閱
引言: fy 你好: 其實方法都是很相似的,請參考以下的說明 (1)為了配合說明,所以小弟我必須先做幾項假設,因為我並不清楚你拿到的 *.h, *.obj 裡面有哪些可用的、已經被宣告的 function,因此,在此假設 : 你拿到的檔案分別為 VcObj.h, VcObj.obj,而裡面有一個被宣告在 *.h 裡面的 function,其原型為 int ObjAdd(int a, int b); .........
感謝 RaynorPao 兄, 我照您教的方法,成功產生了 LIB 檔,但是產生 DLL檔時又失敗了。出現以下訊息: VCDLL.cpp Linking... Creating library Debug/VCDLL.lib and object Debug/VCDLL.exp LINK : warning LNK4098: defaultlib "LIBCD" conflicts with use of other libs; use /NODEFAULTLIB:library VCLIB.lib(VcLib.obj) : error LNK2001: unresolved external symbol "void __cdecl ReadProductInfo(int,struct product_s *)" (?ReadProductInfo@@YAXHPAUproduct_s@@@Z) VCLIB.lib(VcLib.obj) : error LNK2001: unresolved external symbol "char * __cdecl KeyStatusMessage(int)" (?KeyStatusMessage@@YAPADH@Z) Debug/VCDLL.dll : fatal error LNK1120: 2 unresolved externals Error executing link.exe. VCDLL.dll - 3 error(s), 1 warning(s) 附上Project Sources 和原始檔案檔案,能否麻煩您再幫我看看問題在哪裡?? 原始檔案: encode.obj 和 customer.h Project: [VCLIB] , [VCDLL] http://delphi.ktop.com.tw/loadfile.php?TOPICID=14124764&CC=315896 軟還要更軟,我的Artwork http://delphi.ktop.com.tw/topic.php?TOPIC_ID=27674 Chinese Girl in Rhino3D http://rhino3d.com/gallery/figure/girl.htm 發表人 - fy 於 2004/02/18 17:27:25
系統時間:2024-05-19 18:23:15
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!