0
0

Hello there

I’m trying include fsbank library into my application.

I have the following linking pipeline:
1. make myown.lib with fsbanklib.lib and fmodvc.lib
2. make app.exe by linking with myown.lib

only myown.lib code uses fsbank.lib code

There is error on linking app.exe:

Linking…
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _calloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _fprintf already defined in LIBCMTD.lib(fprintf.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _fopen already defined in LIBCMTD.lib(fopen.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strncpy already defined in LIBCMTD.lib(strncpy.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _strchr already defined in LIBCMTD.lib(strchr.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: “private: __thiscall type_info::type_info(class type_info const &)” (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
MSVCRT.lib(ti_inst.obj) : error LNK2005: “private: class type_info & __thiscall type_info::operator=(class type_info const &)” (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: __unlink already defined in LIBC.lib(unlink.obj)
MSVCRT.lib(MSVCR71.dll) : error LNK2005: __strupr already defined in LIBCMTD.lib(strupr.obj)
LINK : warning LNK4098: defaultlib ‘LIBC’ conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib ‘MSVCRT’ conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib ‘LIBCMT’ conflicts with use of other libs; use /NODEFAULTLIB:library
Win32\Debug/Exporter.exe : fatal error LNK1169: one or more multiply defined symbols found

Error executing link.exe (tool returned code: 1169)

Please help me

I have ony one idea what kind of problem is this – maybe we are using different linking options.
myown.lib uses Runtime Library: Multi-threaded option and maybe fsbank.lib uses Single-threaded. If it is so, please could you provide me fsbanklib.lib built with Multi-threaded option?

  • You must to post comments
0
0

thx, it’s working!

  • You must to post comments
0
0

yes, it’s still working. but…

Could you please provide fsbanklib.lib which links without need setting CodeGeneration property multithreaded DLL. We need this very much. For example to increase performance – every call of any CRT function is made via msvcrt.dll or msvcr71.dll in this case.

Please, could you give us fsbanklib.lib which could be linked with our project which is multihreaded (NOT dll)

  • You must to post comments
0
0

First of all, we would like to provide our application without msvcr71.dll If project will be code generated with multithreaded DLL, msvcr71.dll is required at the very start of programm.

Performance. Let me demonstrate a simple program:

include <stdio.h>

include <string.h>

int main()
{
char str[1024];
gets(str);
printf(“%s”, str);
return 0;

}

With multithreaded codegeneration the assembler session of printf section looks like this:

printf("%s", str);

0040101B lea ecx,[esp+4]
0040101F push ecx
00401020 push offset string “%s” (40811Ch)

00401025 call printf (40103Fh)

As you can see, printf called by absolute address without any calculations of address.

And if we use multithreaded dll codegeneration:

printf("%s", str);

0040101C lea ecx,[esp+4]
00401020 push ecx
00401021 push offset string “%s” (40209Ch)

00401026 call dword ptr [__imp__printf (402070h)]

the call of printf function goes via ptr resolution from msvcr71.dll loaded at the start. That is lack of performance on most CRT function used in programm.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.