Visual Studio linker problem (strtoll)
Enno Rehling <[email protected]>
| Newsgroups | gmane.comp.lib.fox-toolkit.user |
|---|---|
| Message-ID | <[email protected]> |
I am maintaining a legacy application built with Fox 1.6, and in the
course of that work, have stumbled upon a problem when building with
Visual Studio 2019 that I've isolated into a small sample. The linker
message in question is this:
Build started...
1>------ Build started: Project: strtoll_bug, Configuration: Debug Win32
------
1>ucrt.lib(api-ms-win-crt-convert-l1-1-0.dll) : error LNK2005: _strtoll
already defined in FOX-1.6.lib(strtoll.obj)
1> Creating library X:\Debug\strtoll_bug.lib and object
X:\Debug\strtoll_bug.exp
1>X:\Debug\strtoll_bug.exe : fatal error LNK1169: one or more multiply
defined symbols found
1>Done building project "strtoll_bug.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
This is the source (main.cpp):
#include <cassert>
#include <cstdlib>
#include <fx.h>
#include <FXString.h>
int main(void)
{
const char* input = "1234567890test";
char* endp;
long long value = strtoll(input, &endp, 10);
assert(value == 1234567890);
assert(endp[0] == 't');
value = FXLongVal(FXString(input), 10);
assert(value == 1234567890);
return 0;
}
It appears that FOX-1.6.lib defines a strtoll function that conflicts
with the one in the runtime? Why is that?