I opened the old workspace, which is libray and its test harness. It worked fine, but now it doesn't, and older versions of the code do not work with the same errors. I tried to recreate the project, and this also causes the same errors. In the project settings, nothing fails, and the generated code works in the main application.
I deleted most of the files and kept it to a minimum to generate an error. Unfortunately, I can not publish the project, because it is used in production code.
The LNK2001 linker error that I get usually means that I left the library or forgot to implement a virtual function. However, this is part of the standard template library - and this is the title.
The code that is indicated as having a problem in IOCompletionPort.obj does not actually use std::string directly, but calls a class that does: Comms::Exception takes the value std::string and the value GetLastError or WSAGetLastError .
The function mentioned in the error ( GetMessage ) is implemented, but it is a virtual function, so other classes can override it if necessary. However, it seems that the compiler did this as a version of Ansi, but I can not find any parameters in the settings that would control this. I suspect this may be a problem, but since there are very few options in the library, I don’t know for sure. However, both projects specify _MBCS in the compiler options.
-------------------- Configuration: TestComms - Win32 Debugging -------------------- Binding ... Comms.lib (IOCompletionPort.obj): error LNK2001: unresolved external character "public: virtual class stand :: basic_string, class std :: allocator> __thiscall Comms :: Exception :: GetMessageA (void) const" (? GetMessageA @ Exception @ Communication @@ UBO? AV? $ Basic_string @DU? $ Char_traits @D @ stand @@ V? $ Distributor @D @ 2 @@ stand @@ XZ) Debug / TestComms.exe: fatal error LNK1120: 1 unresolved external Runtime error link.exe.
TestComms.exe - 2 errors, 0 warnings (s)
Any suggestions? I have lost most of the morning and do not want to lose most of the day.
c ++ visual-c ++ linker vc6
graham.reeds
source share