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

有關Library 問題??

尚未結案
hcw
一般會員


發表:5
回覆:11
積分:3
註冊:2002-09-18

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-05-15 10:33:39 IP:210.64.xxx.xxx 未訂閱
請教各位前輩.... 如何將Vc 產生的 .Lib(Win32 Static Library)檔讓BCB使用?? 請不吝賜教......謝謝!!
axsoft
版主


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

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-05-15 11:23:26 IP:61.218.xxx.xxx 未訂閱
引言: 請教各位前輩.... 如何將Vc 產生的 .Lib(Win32 Static Library)檔讓BCB使用?? 請不吝賜教......謝謝!!
HCW您好: 因為VC++使用的Library都是COFF格式,而Borland開發工具度部分都是沿用OMF的格式,所以需要用COFF2OMF.exe來轉換 COFF2OMF.exe在Program Files\Borland\CBuilder6\bin中
Convert Object and Lib Files to OMF
Digital Mars tools all work with the Intel 32 bit OMF object and library file format. Microsoft's 32 bit tools work with Microsoft's own variant of the COFF format. Many such COFF format files can be converted to OMF with the coff2omf program: 
        coff2omf inputfiles...    
COFF to OMF Converter Version 1.0.0.74 Copyright (c) 1999, 2000 Inprise Corporation    語法:   COFF2OMF [options] InputFile OutputFile
  -h, -?  Display help
  -q      Quiet mode
  -v      Verbose mode
  -r      Remove (delete) output file if empty
  -lib:xx Specify options for OMF import library generation:
       ms - Allow entries that have MS C++ name mangling (default: no)
       st - Normalize names instead of aliasing MS stdcall mangling
       ca - Don't perform MS cdecl aliasing (default is to alias)    COFF2OMF will convert a COFF import library file (InputFile)
to the corresponding OMF type import library file (OutputFile).            
The input files can be either object files (.obj) or library files (.lib). They are converted in place to OMF. 
For example, to convert user32.lib from COFF to OMF:             COFF2OMF input.lib output.lib
        
The Microsoft COFF format apparently changed with Visual C++ 6.0. To use coff2omf on a .lib file with the newer format, use Microsoft's linker to convert the file to the earlier COFF format: 
        link /lib /convert file.lib
        
and then use coff2omf on it.
然後把相關的Library及include File加入BCB的Project中! 另外可以參考這篇 Using Visual C++ DLLs in a C++Builder Project http://www.bcbdev.com/articles/vcdll.htm Delphi.Ktop風紀小隊---[ 發問前請先找找舊文章 ]--- 發表人 - axsoft 於 2003/05/15 12:03:36
tech_state
版主


發表:44
回覆:638
積分:641
註冊:2003-02-10

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-05-15 11:27:26 IP:61.221.xxx.xxx 未訂閱
引言: 請教各位前輩.... 如何將Vc 產生的 .Lib(Win32 Static Library)檔讓BCB使用?? 請不吝賜教......謝謝!!
hcw, 您好 請參考以下連結的資料 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=29880 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=18760 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=18754 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=24702 試試看 ======================= 涵養怒中氣。謹防順口言。留心忙裡錯。珍惜有時錢。 是非終日有,不聽自然無 天下本無事,庸人自擾之
hcw
一般會員


發表:5
回覆:11
積分:3
註冊:2002-09-18

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-05-15 15:28:34 IP:210.64.xxx.xxx 未訂閱
axsoft 前輩您好: 之前我有試過vc 的dll 檔利用implib及coff2omf所產生的.lib可以在bcb使用,但vc中的Win32 Static Library所產生的.lib 我利用您說的 coff2omf 或是先執行link /lib /convert file.lib再coff2omf 這二種方法轉出來的.lib檔都是空的,我用Tdump 產生一個.lst檔內容是: 000000 MSLIBR Index begins at file offset 0. Index is 0 blocks. 000010 MSLEND 不知是何原因??... 而在BCB的錯誤訊息如下 : [Linker Error] Unresolved external 'xxxx' referenced from c:\test\xxx.OBJ
axsoft
版主


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

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-05-15 16:06:05 IP:61.218.xxx.xxx 未訂閱
引言: axsoft 前輩您好: 之前我有試過vc 的Lib 檔利用implib及coff2omf所產生的.lib可以在bcb使用,但vc中的Win32 Static Library所產生的.lib 我利用您說的 coff2omf 或是先執行link /lib /convert file.lib再coff2omf 這二種方法轉出來的.lib檔都是空的,我用Tdump 產生一個.lst檔內容是: 000000 MSLIBR Index begins at file offset 0. Index is 0 blocks. 000010 MSLEND 不知是何原因??... 而在BCB的錯誤訊息如下 : [Linker Error] Unresolved external 'xxxx' referenced from c:\test\xxx.OBJ
可否將你的Lib傳上來,我試試看問題在哪! 請放在 會員求助程式檔案上傳區 http://delphi.ktop.com.tw/forum.asp?FORUM_ID=97 Delphi.Ktop風紀小隊---[ 發問前請先找找舊文章 ]--- 發表人 - axsoft 於 2003/05/15 16:17:41
RaynorPao
版主


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

發送簡訊給我
#6 引用回覆 回覆 發表時間:2003-05-18 22:18:29 IP:61.221.xxx.xxx 未訂閱
引言: 如何將Vc 產生的 .Lib(Win32 Static Library)檔讓BCB使用??
hcw 你好:
(1)據我所知是不行的,因為 *.lib(Win32 Static Library) 在 VC 及 BCB 中
   的格式是不相同的,至於有沒有現成的工具可以轉換?? 這點我就不太清楚了
(2)小弟我一般的做法,是先用 VC 把原來的 *.lib 包成 Win32 DLL 再給 BCB
   使用(靜態連結或動態連結),這種方式是肯定沒問題的
    -- 
        
------
-- 若您已經得到滿意的答覆,請適時結案!! --
-- 欲知前世因,今生受者是;欲知來世果,今生做者是 --
-- 一切有為法,如夢幻泡影,如露亦如電,應作如是觀 --
hcw
一般會員


發表:5
回覆:11
積分:3
註冊:2002-09-18

發送簡訊給我
#7 引用回覆 回覆 發表時間:2003-05-20 17:45:02 IP:210.64.xxx.xxx 未訂閱
感謝 RaynorPao: 我照你的方法把.lib 包成 dll ,bcb就可以使用了.....感激不盡..... 也謝謝axsoft的鼎力相助.... 因為現在可以使用了所以我就不上傳了.....謝謝...
系統時間:2024-05-03 8:59:08
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!