I work on a project in which I use an external library which allows me to control a device.
In the documentation of the library, they say that we have to set "use runtime libraries" to "multithreaded dll" in project->settings->code generation
Before I added this library I used the runtime library "multithreaded". I kept this option because people at my work who used the same library as the one I want to add made it work with this setting.
The problem that I face is that when I execute my program (with the "multithreaded" option) I get the following execution error :
HEAP[name.exe]: Invalid Address specified to RtlValidateHeap( 003F0000, 00379488 )
I have read in msdn and other places that this could be due to the fact that I use the "multithreaded" runtime library instead of "multithreaded dll", so I tried to change that and now I get the following linker's errors :
libcmtd.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCRTD.dll)
libcmtd.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCRTD.dll)
libcmtd.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)
libcmtd.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "libcmtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
So I tried to ignore the libraries "msvcrtd.lib", "libcmtd.lib", but it created linking errors (unresolved external symbols) in libraries included in my projects.
Could anyone suggest me something to solve this ? Could it be possible to either solve the linking problem with the "multithreaded dll" runtime library, or either suppress the execution error (the heap thing) with the "multithreaded" runtime library ?
Thanks for your help