1

I've trying to compile a project with tcmalloc in Visual Studio 2013. I've compiled .lib file for libtcmalloc from gperftools package and added libtcmalloc.lib into linker input options.

When I'm trying to build my project, I get the following error:

1> Finished generating code
1>* CIL library *(* CIL module *) : error LNK2005: _strtoll already defined in LIBCMT.lib(strtoq.obj)
1> fatal error LNK1169: one or more multiply defined symbols found

If I remove libtcmalloc.lib from linker options, project compiles fine..

Artem Mostyaev
  • 3,874
  • 10
  • 53
  • 60
  • 1
    Try to look for a workaround [here](https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0d4ee537-ea99-4346-90d7-a1521d875eaf/vs-2012-already-defined-in-nafxcwlibafxmemobj?forum=vclanguage). Still the answer given on MSDN is far from perfect — it doesn't deal with the problem but just overcome it with force. – ixSci Dec 24 '15 at 15:19
  • Also, check out how your `libtcmalloc` gets built. It might be that it gets united with a CRT static lib by the Librarian(so you need to check your Librarian options in the project property page) – ixSci Dec 24 '15 at 15:24
  • Thanks, @ixSci. Your first comment works as a workaround. Can you write what option I need to see in the `libtcmalloc` project? – Artem Mostyaev Dec 24 '15 at 15:27
  • Check `Librarian->Link Library Dependencies` and if it's set then check what dependencies are provided and remove unnecessary ones. – ixSci Dec 24 '15 at 15:35
  • That check is disabled, so problem is somewhere else. – Artem Mostyaev Dec 24 '15 at 15:47

0 Answers0