headers and compiler configuration
headers and compiler configuration
i need to write a dll that will obtain the xref paths and raster paths
when given a dwg. i understand, for the most part, the process
of iterating through the block table and extracting data from the
appropriate blocks.
i figured i would start with simple console app to get more familiar
with the objects.
however, i cannot get a simple console app to compile with vc6.
i am not sure what headers to include, so i used the odreadex
as an example and provided the compiler with the names of the
libs to use, etc, etc, etc. below is what i am trying to compile and
what the linker is having trouble with. any help would be greatly
appreciated. in fact, if anyone has a workspace that is set up
"plain vanilla" that would be great.
i find anymore with modern compilers and linkers, half the time
is getting it setup so it will operate! then again, i don't have a ton
of experience in the area. thanks!!!!
begin main.cpp ----
#include <iostream.h>
#include "odacommon.h"
#include "dbdatabase.h"
#include "tables.h"
#include "entities.h"
#include "objects.h"
#include "rxobjectimpl.h"
#include "exsystemservices.h"
#include "exhostappservices.h"
//#include "exprotocolextension.h"
int main(int argc, char* argv[])
{
odrxobjectimpl<exhostappservices> svcs;
return 0;
}
linker output
main.cpp
linking...
msvcprtd.lib(msvcp60d.dll) : error lnk2005: "public: __thiscall std::_lockit::~_lockit(void)" (??1_lockit@std@@qae@xz) already defined in main.obj
msvcprtd.lib(msvcp60d.dll) : error lnk2005: "public: __thiscall std::_lockit::_lockit(void)" (??0_lockit@std@@qae@xz) already defined in main.obj
msvcrtd.lib(msvcrtd.dll) : error lnk2005: _sprintf already defined in libcd.lib(sprintf.obj)
msvcrtd.lib(msvcrtd.dll) : error lnk2005: _memmove already defined in libcd.lib(memmove.obj)
msvcrtd.lib(msvcrtd.dll) : error lnk2005: _strstr already defined in libcd.lib(strstr.obj)
msvcrtd.lib(msvcrtd.dll) : error lnk2005: _strncmp already defined in libcd.lib(strncmp.obj)
msvcrtd.lib(msvcrtd.dll) : error lnk2005: _strchr already defined in libcd.lib(strchr.obj)
msvcrtd.lib(msvcrtd.dll) : error lnk2005: _strncpy already defined in libcd.lib(strncpy.obj)
msvcrtd.lib(msvcrtd.dll) : error lnk2005: _free already defined in libcd.lib(dbgheap.obj)
msvcrtd.lib(msvcrtd.dll) : error lnk2005: _malloc already defined in libcd.lib(dbgheap.obj)
link : warning lnk4098: defaultlib "msvcrtd" conflicts with use of other libs; use /nodefaultlib:library
main.obj : error lnk2001: unresolved external symbol "public: virtual void __thiscall exhostappservices::setlimit(int)" (?setlimit@exhostappservices@@uaexh@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual void __thiscall exhostappservices::meterprogress(void)" (?meterprogress@exhostappservices@@uaexxz)
main.obj : error lnk2001: unresolved external symbol "public: virtual void __thiscall exhostappservices::stop(void)" (?stop@exhostappservices@@uaexxz)
main.obj : error lnk2001: unresolved external symbol "public: virtual void __thiscall exhostappservices::start(char const *)" (?start@exhostappservices@@uaexpbd@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual bool __thiscall exhostappservices::ttffilenamebydescriptor(class odttfdescriptor const &,class odstring &)" (?ttffilenamebydescriptor@exhostappservices@@uae_n abvodttfdescriptor@@a
avodstring@@@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual class odsmartptr<class oddbdatabase> __thiscall exhostappservices::readfile(char const *,bool,bool,enum oda::filesharemode,class odarray<unsigned short,class odmemoryallocator<un
signed short> > const &)" (?readfile@exhostappservices@@uae?av?$odsmartptr@v oddbdatabase@@@@pbd_n1w4filesharemode@oda@@abv?$od array@gv?$odmemoryallocator@g@@@@@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual void __thiscall exhostappservices::releaseprogressmeter(class oddbhostappprogressmeter *)" (?releaseprogressmeter@exhostappservices@@uaexpavo ddbhostappprogressmeter@@@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual class oddbhostappprogressmeter * __thiscall exhostappservices::newprogressmeter(void)" (?newprogressmeter@exhostappservices@@uaepavoddbho stappprogressmeter@@xz)
main.obj : error lnk2001: unresolved external symbol "public: __thiscall exhostappservices::exhostappservices(void)" (??0exhostappservices@@qae@xz)
debug/dwgscan.exe : fatal error lnk1120: 9 unresolved externals
error executing link.exe.
dwgscan.exe - 20 error(s), 1 warning(s)
i wend through the workspace config of the odreadex and set up
mine identically and then i was able to get a basic app to compile.
however, i am still seeing a bunch of unresolved external functions
that are most related to the system services. i am trying to use the
implementation done in the odreadex. i don't think it is seeing the implementation?
---code----
#include <iostream.h>
#include "odacommon.h"
#include "dbdatabase.h"
#include "tables.h"
#include "entities.h"
#include "objects.h"
#include "rxobjectimpl.h"
#include "exsystemservices.h"
#include "exhostappservices.h"
#include "exprotocolextension.h"
//#include "modelergeometryimpl.h"
class myservices : public exsystemservices, public exhostappservices
{
protected:
using exsystemservices

erator new;
using exsystemservices

erator delete;
};
int main (int argc, char* argv[])
{
odrxobjectimpl<myservices> svcs;
odinitialize(&svcs); //init open design libraries
oddbdatabaseptr pdb; //smart pointer to the database
pdb = svcs.readfile("c:\\testfiles\\one.dwg");
pdb.release();
oduninitialize();
return 0;
}
linking...
main.obj : error lnk2001: unresolved external symbol "public: virtual class odsmartptr<class oddbdatabase> __thiscall exhostappservices::readfile(char const *,bool,bool,enum oda::filesharemode,class odarray<unsigned short,class odmemoryallocator<un
signed short> > const &)" (?readfile@exhostappservices@@uae?av?$odsmartptr@v oddbdatabase@@@@pbd_n1w4filesharemode@oda@@abv?$od array@gv?$odmemoryallocator@g@@@@@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual void __thiscall exhostappservices::setlimit(int)" (?setlimit@exhostappservices@@uaexh@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual void __thiscall exhostappservices::meterprogress(void)" (?meterprogress@exhostappservices@@uaexxz)
main.obj : error lnk2001: unresolved external symbol "public: virtual void __thiscall exhostappservices::stop(void)" (?stop@exhostappservices@@uaexxz)
main.obj : error lnk2001: unresolved external symbol "public: virtual void __thiscall exhostappservices::start(char const *)" (?start@exhostappservices@@uaexpbd@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual bool __thiscall exhostappservices::ttffilenamebydescriptor(class odttfdescriptor const &,class odstring &)" (?ttffilenamebydescriptor@exhostappservices@@uae_n abvodttfdescriptor@@a
avodstring@@@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual void __thiscall exhostappservices::releaseprogressmeter(class oddbhostappprogressmeter *)" (?releaseprogressmeter@exhostappservices@@uaexpavo ddbhostappprogressmeter@@@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual class oddbhostappprogressmeter * __thiscall exhostappservices::newprogressmeter(void)" (?newprogressmeter@exhostappservices@@uaepavoddbho stappprogressmeter@@xz)
main.obj : error lnk2001: unresolved external symbol "public: virtual enum odcodepageid __thiscall exsystemservices::systemcodepage(void)const " (?systemcodepage@exsystemservices@@ube?aw4odcodepa geid@@xz)
main.obj : error lnk2001: unresolved external symbol "public: virtual class odstring __thiscall exsystemservices::formatmessage(unsigned int,char * *)" (?formatmessage@exsystemservices@@uae?avodstring@@ ipapad@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual class odsmartptr<class odgsdevice> __thiscall exsystemservices::gsbitmapdevice(void)" (?gsbitmapdevice@exsystemservices@@uae?av?$odsmart ptr@vodgsdevice@@@@xz)
main.obj : error lnk2001: unresolved external symbol "public: virtual class odsmartptr<class odolestorage> __thiscall exsystemservices::storagefromstreambuf(class odstreambuf *)" (?storagefromstreambuf@exsystemservices@@uae?av?$o dsmartptr@vodolesto
rage@@@@pavodstreambuf@@@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual bool __thiscall exsystemservices::saverasterimage(class odgirasterimage const *,char const *,int)" (?saverasterimage@exsystemservices@@uae_npbvodgira sterimage@@pbdh@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual class odsmartptr<class odgienhancedmetafile> __thiscall exsystemservices::loadenhancedmetafile(class odstreambuf *)" (?loadenhancedmetafile@exsystemservices@@uae?av?$o dsmartptr@v
odgienhancedmetafile@@@@pavodstreambuf@@@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual class odsmartptr<class odgirasterimage> __thiscall exsystemservices::loadrasterimage(class odstring const &)" (?loadrasterimage@exsystemservices@@uae?av?$odsmar tptr@vodgirasterim
age@@@@abvodstring@@@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual class odsmartptr<class odgirasterimage> __thiscall exsystemservices::loadrasterimage(class odstreambuf *)" (?loadrasterimage@exsystemservices@@uae?av?$odsmar tptr@vodgirasterimage
@@@@pavodstreambuf@@@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual bool __thiscall exsystemservices::unloadapp(class odstring const &)" (?unloadapp@exsystemservices@@uae_nabvodstring@@@z )
main.obj : error lnk2001: unresolved external symbol "public: virtual bool __thiscall exsystemservices::loadapp(class odstring const &,enum oda::loadreasons)" (?loadapp@exsystemservices@@uae_nabvodstring@@w4lo adreasons@oda@@@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual bool __thiscall exsystemservices::unloadmodule(class odstring const &)" (?unloadmodule@exsystemservices@@uae_nabvodstring@ @@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual bool __thiscall exsystemservices::loadmodule(class odstring const &)" (?loadmodule@exsystemservices@@uae_nabvodstring@@@ z)
main.obj : error lnk2001: unresolved external symbol "public: virtual __int64 __thiscall exsystemservices::getfilesize(char const *)" (?getfilesize@exsystemservices@@uae_jpbd@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual long __thiscall exsystemservices::getfilemtime(char const *)" (?getfilemtime@exsystemservices@@uaejpbd@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual bool __thiscall exsystemservices::accessfile(char const *,int)" (?accessfile@exsystemservices@@uae_npbdh@z)
main.obj : error lnk2001: unresolved external symbol "public: virtual class odsmartptr<class odstreambuf> __thiscall exsystemservices::createfile(char const *,enum oda::fileaccessmode,enum oda::filesharemode,enum oda::filecreationdisposition)" (?cr
eatefile@exsystemservices@@uae?av?$odsmartptr@vods treambuf@@@@pbdw4fileaccessmode@oda@@w4filesharemo de@4@w4filecreationdisposition@4@@z)
main.obj : error lnk2001: unresolved external symbol "public: __thiscall exhostappservices::exhostappservices(void)" (??0exhostappservices@@qae@xz)
main.obj : error lnk2001: unresolved external symbol "public: __thiscall exsystemservices::exsystemservices(void)" (??0exsystemservices@@qae@xz)
debug/dwgscan.exe : fatal error lnk1120: 26 unresolved externals
error executing link.exe.
dwgscan.exe - 27 error(s), 0 warning(s)
ok, found the missing implementations and the code compiles!
i think i am going to trim some of the example stuff that i won't
be using. (progress meter implementation. i will probably just
dumb it out).
i hope someone else finds this useful as i am talking to myself right now.....