EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Linker error when using CbFs and CbFlt in the same project

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#19957
Posted: 04/27/2012 05:09:11
by Bernd Kammerberger (Standard support level)
Joined: 04/27/2012
Posts: 7

We want to use Callback File System and CallbackFilter in the same VS 2010 project. This gives me a ton of linker errors because both libs use a lot of identical functions:

cbfs_32bit_static.lib(misc.obj) : error LNK2005: _DsIsWow64Process@0 ist bereits in CbFlt_32bit_static.lib(misc.obj) definiert.
2>cbfs_32bit_static.lib(misc.obj) : error LNK2005: _DsIsX64System@0 ist bereits in CbFlt_32bit_static.lib(misc.obj) definiert.
2>cbfs_32bit_static.lib(misc.obj) : error LNK2005: _DsDisableWow64Redirection@0 ist bereits in CbFlt_32bit_static.lib(misc.obj) definiert.
2>cbfs_32bit_static.lib(misc.obj) : error LNK2005: _DsRevertWow64Redirection@4 ist bereits in CbFlt_32bit_static.lib(misc.obj) definiert.
2>cbfs_32bit_static.lib(misc.obj) : error LNK2005: _DsUnregisterService@4 ist bereits in CbFlt_32bit_static.lib(misc.obj) definiert.
2>

I can ignore the errors with the /FORCE:MULTIPLE linker option, but that doesn't sound like a solid solution and may give unexpected errors.

Any better solution?

Tilo
#19959
Posted: 04/27/2012 05:29:21
by Eugene Mayevski (EldoS Corp.)

Unfortunately, there's no way to do this in C++ in a single module. You need to create two separate DLLs (or main module and a DLL) and have each of libraries in a separate module. The reason is that CBFS and CallbackFilter share a set of common libraries, and as products have different release schedule, there always be a conflict between those libraries.


Sincerely yours
Eugene Mayevski
#19960
Posted: 04/27/2012 05:31:16
by Volodymyr Zinin (EldoS Corp.)

I don't think it's possible to statically link these libraries into one binary, because both of them use the same internal functions. Perhaps it's good idea to wrap them (and the code that uses them) to separated DLLs and then use these ones in your program.

Reply

Statistics

Topic viewed 1306 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!