经过几年的VC++的学习,感觉什么都好,但做界面太烦了,上段时间看到BCB做界面竟是如此的容易,而且还漂亮。
因此想在以后写程序时,用BCB做界面,VC++做底层,但发现vc++生成的lib,bcb竟无法直接使用,不知道有什么方法可以让bcb能够使用?

解决方案 »

  1.   

    能用
    VC编写出来的lib需要用CB的工具coff2omf来转换一下
    具体怎么转换,这个工具有帮助提示
      

  2.   

    如果VC++中使用了MFC,也可以用conff2omf来转换吗?
      

  3.   

    不好意思,刚才我看错了.@_@
    我把coff2omf当成conff2omf在google里搜索了,结果没有搜索到.
      

  4.   

    CB中就自己带,应该是CB中的bin目录中
    如果用了MFC,一样可以用
    这个是标准
      

  5.   

    唉呀,原来在cbuilder\bin下就有呀.我真傻!
    我试一下,解决就给分.
      

  6.   

    如果你的PATH中有CB的bin路径
    应该直接在DOS环境中就可以直接使用(就是假DOS)coff2omf命令帮助:
    COFF to OMF Converter Version 1.0.0.74 Copyright (c) 1999, 2000
    ion
    Syntax:   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 (defaul
           st - Normalize names instead of aliasing MS stdcall mangl
           ca - Don't perform MS cdecl aliasing (default is to aliasCOFF2OMF will convert a COFF import library file (InputFile)
    to the corresponding OMF type import library file (OutputFile).
      

  7.   

    如果让VC++生成静态的lib,在VC++中该如何写呢?BCB中如何用呢?
      

  8.   

    我是这样做的:我用VC++生成了一个静态lib, 工程使用了mfc
    VC++中如下:extern "C" void _stdcall testlib(void); 
    void _stdcall testlib()
    {
    MessageBox(NULL, _T("sdfad"), _T("title"), MB_OK);
    }然后我使用coff2omf进行了转换
    在bcb中:
    USELIB("bcblib.lib");
    extern "C" void _stdcall testlib();然后调用 testlib();link总是不通过.
    [Linker Error] Unresolved external 'testlib' referenced from C:\TEMP\BCBTEST\UNIT1.OBJ
    我换了几种方式也不行,我bcb是初学者,不懂,请指教.谢谢了!