查看单个帖子
旧 2009-05-07, 05:31 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】unable To Compile 1.11

unable to compile 1.11
unable to compile 1.11
hi
i have just downloaded and installed the 1.11 version of dwgdirect and am trying to get a skeleton mfc application to compile. it is using the /mt(d) switches and the following library files (release build):
shlwapi.lib
dd_vc6mt_root.lib
dd_vc6mt_db.lib
dd_vc6mt_gi.lib
dd_vc6mt_ge.lib
dd_vc6mt_gs.lib
dd_vc6mt_alloc.lib
dd_vc6mt_ole.lib
these are the files includes into the project:
exhostappservices.cpp
exsystemservices.cpp
exundocontroller.cpp
these are the header files included int he main app header file:
#include <shlwapi.h>
#include <odacommon.h>
#include <dbdatabase.h>
#include <objects.h>
#include <exsystemservices.h>
#include <exhostappservices.h>
#include <tables.h>
#include <entities.h>
class userbreak
{
};
class cseq2dwgapp : public cwinapp,
public exhostappservices,
public exsystemservices
{
protected:
using cwinapperator new;
using cwinapperator delete;
when i compile, i get these errors:
--------------------configuration: seq2dwg - win32 release--------------------
linking...
nafxcw.lib(afxmem.obj) : error lnk2005: "void * __cdecl operator new(unsigned int)" (??2@yapaxi@z) already defined in dd_vc6mt_alloc.lib(odalloc.obj)
nafxcw.lib(afxmem.obj) : error lnk2005: "void __cdecl operator delete(void *)" (??3@yaxpax@z) already defined in dd_vc6mt_alloc.lib(odalloc.obj)
exhostappservices.obj : error lnk2001: unresolved external symbol "public: virtual bool __thiscall oddbhostappservices::loadapp(class odstring const &)" (?loadapp@oddbhostappservices@@uae_nabvodstring@@@ z)
seq2dwg.obj : error lnk2001: unresolved external symbol "public: virtual bool __thiscall oddbhostappservices::loadapp(class odstring const &)" (?loadapp@oddbhostappservices@@uae_nabvodstring@@@ z)
exsystemservices.obj : error lnk2001: unresolved external symbol "public: __thiscall odwrfilebuf:dwrfilebuf(void)" (??0odwrfilebuf@@qae@xz)
exsystemservices.obj : error lnk2001: unresolved external symbol "public: __thiscall odrdfilebuf:drdfilebuf(void)" (??0odrdfilebuf@@qae@xz)
exsystemservices.obj : error lnk2001: unresolved external symbol "public: static class odrxobjectptr __cdecl odexgirasterimage:seudoconstructor(void)" (?pseudoconstructor@odexgirasterimage@@sa?avodrxob jectptr@@xz)
exsystemservices.obj : error lnk2001: unresolved external symbol "public: void __thiscall exodolestorage::setlockbytes(void *)" (?setlockbytes@exodolestorage@@qaexpax@z)
exsystemservices.obj : error lnk2001: unresolved external symbol "public: virtual class odsmartptr<class odolestream> __thiscall exodolestorageenstream(class odstring const &,unsigned long)" (?openstream@exodolestorage@@uae?av?$odsmartptr@vo dol
estream@@@@abvodstring@@k@z)
exsystemservices.obj : error lnk2001: unresolved external symbol "public: virtual void __thiscall exodolestorage::setstorage(void *)" (?setstorage@exodolestorage@@uaexpax@z)
exsystemservices.obj : error lnk2001: unresolved external symbol "public: __thiscall exodolestorage::exodolestorage(void)" (??0exodolestorage@@qae@xz)
exsystemservices.obj : error lnk2001: unresolved external symbol "public: static class odsmartptr<class odgienhancedmetafile> __cdecl odexgienhancedmetafile::createobject(void)" (?createobject@odexgienhancedmetafile@@sa?av?$odsm artptr@vodgienhanced
metafile@@@@xz)
exsystemservices.obj : error lnk2001: unresolved external symbol "public: virtual __thiscall exodolestorage::~exodolestorage(void)" (??1exodolestorage@@uae@xz)
exsystemservices.obj : error lnk2001: unresolved external symbol "void __cdecl oda::mem_free(void *)" (?mem_free@oda@@yaxpax@z)
exsystemservices.obj : error lnk2001: unresolved external symbol "void * __cdecl oda::mem_alloc(unsigned int)" (?mem_alloc@oda@@yapaxi@z)
release/seq2dwg.exe : fatal error lnk1120: 12 unresolved externals
error executing link.exe.
seq2dwg.exe - 16 error(s), 0 warning(s)
have i forgotten to some steps here? i have tried until my hair is pulled out. extra lib files?
thank you for your help.
andrew
update..
i was using the wrong include folders. i have changed those. i have now added odfilebuf.cpp to the projhect and ignore the msvcrt library. but i still get all these errors:
--------------------configuration: seq2dwg - win32 release--------------------
linking...
nafxcw.lib(afxmem.obj) : error lnk2005: "void * __cdecl operator new(unsigned int)" (??2@yapaxi@z) already defined in dd_vc6mt_alloc.lib(odalloc.obj)
nafxcw.lib(afxmem.obj) : error lnk2005: "void __cdecl operator delete(void *)" (??3@yaxpax@z) already defined in dd_vc6mt_alloc.lib(odalloc.obj)
link : warning lnk4049: locally defined symbol "_fclose" imported
link : warning lnk4049: locally defined symbol "_setvbuf" imported
link : warning lnk4049: locally defined symbol "_fseek" imported
link : warning lnk4049: locally defined symbol "_fputc" imported
link : warning lnk4049: locally defined symbol "_fwrite" imported
link : warning lnk4049: locally defined symbol "_ftell" imported
exsystemservices.obj : error lnk2001: unresolved external symbol "public: static class odrxobjectptr __cdecl odexgirasterimage:seudoconstructor(void)" (?pseudoconstructor@odexgirasterimage@@sa?avodrxob jectptr@@xz)
exsystemservices.obj : error lnk2001: unresolved external symbol "public: void __thiscall exodolestorage::setlockbytes(void *)" (?setlockbytes@exodolestorage@@qaexpax@z)
exsystemservices.obj : error lnk2001: unresolved external symbol "public: virtual class odsmartptr<class odolestream> __thiscall exodolestorageenstream(class odstring const &,unsigned long)" (?openstream@exodolestorage@@uae?av?$odsmartptr@vo dol
estream@@@@abvodstring@@k@z)
exsystemservices.obj : error lnk2001: unresolved external symbol "public: virtual void __thiscall exodolestorage::setstorage(void *)" (?setstorage@exodolestorage@@uaexpax@z)
exsystemservices.obj : error lnk2001: unresolved external symbol "public: __thiscall exodolestorage::exodolestorage(void)" (??0exodolestorage@@qae@xz)
exsystemservices.obj : error lnk2001: unresolved external symbol "public: static class odsmartptr<class odgienhancedmetafile> __cdecl odexgienhancedmetafile::createobject(void)" (?createobject@odexgienhancedmetafile@@sa?av?$odsm artptr@vodgienhanced
metafile@@@@xz)
exsystemservices.obj : error lnk2001: unresolved external symbol "public: virtual __thiscall exodolestorage::~exodolestorage(void)" (??1exodolestorage@@uae@xz)
exsystemservices.obj : error lnk2001: unresolved external symbol "void __cdecl oda::mem_free(void *)" (?mem_free@oda@@yaxpax@z)
odfilebuf.obj : error lnk2001: unresolved external symbol "void __cdecl oda::mem_free(void *)" (?mem_free@oda@@yaxpax@z)
exsystemservices.obj : error lnk2001: unresolved external symbol "void * __cdecl oda::mem_alloc(unsigned int)" (?mem_alloc@oda@@yapaxi@z)
odfilebuf.obj : error lnk2001: unresolved external symbol "void * __cdecl oda::mem_alloc(unsigned int)" (?mem_alloc@oda@@yapaxi@z)
exhostappservices.obj : error lnk2001: unresolved external symbol "public: virtual bool __thiscall oddbhostappservices::loadapp(class odstring const &)" (?loadapp@oddbhostappservices@@uae_nabvodstring@@@ z)
odfilebuf.obj : error lnk2001: unresolved external symbol __imp__fopen
odfilebuf.obj : error lnk2001: unresolved external symbol __imp__fread
release/seq2dwg.exe : fatal error lnk1120: 12 unresolved externals
error executing link.exe.
seq2dwg.exe - 17 error(s), 6 warning(s)
update 2
i did a batch clean of my project and rebuilt it. it is now reduced to these errors:
--------------------configuration: seq2dwg - win32 release--------------------
compiling...
seq2dwg.cpp
seq2dwgdlg.cpp
generating code...
linking...
nafxcw.lib(afxmem.obj) : error lnk2005: "void * __cdecl operator new(unsigned int)" (??2@yapaxi@z) already defined in dd_vc6mt_alloc.lib(odalloc.obj)
nafxcw.lib(afxmem.obj) : error lnk2005: "void __cdecl operator delete(void *)" (??3@yaxpax@z) already defined in dd_vc6mt_alloc.lib(odalloc.obj)
release/seq2dwg.exe : fatal error lnk1169: one or more multiply defined symbols found
error executing link.exe.
seq2dwg.exe - 3 error(s), 0 warning(s)
neil said in another post (and i see it in the documentation) that there is a way to avoid including the alloc lib to avoid this.
please help me.
remove dd_vc6mt_alloc.lib from your link line, and include the odrxxxx memory functions somewhere in your project.

i reverted back to 1.10 which does not use this library.
as you may have seen in an other email, you can revise the order of the files in the dsp file before compiling. it will compile in the right order then.
maybe one day i will move up to 1.11, but even something as simple as what you suggest i have lack of confidence with because the exalloc.cpp file has special identifiers infront of the methods and it also defines new and delete.
as long as i get teh order of compile right in 1.10, it is ok..
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)