[Qt-interest] Building Qt 4.4.3: linker errors LNK2019 w/ MSVC2003 on Windows

Robert Hairgrove evorgriahr at hispeed.ch
Thu Dec 11 17:47:52 CET 2008


Robert Hairgrove wrote:
> Actually, this is referring to std::wstring::begin(), not 
> QString::begin(). But this worked fine in 4.3.0. I will double-check my 
> MSVC import libraries and try again.

In order to keep my sanity, I had to create a test application with no 
Qt invovled just to make sure that there is nothing wrong with my 
compiler setup.

When I build a toy application with no Qt involved, both 
std::string::begin() and std::wstring::begin() are found and linked with 
no problems, so I know that my import library msvcprt.lib is functioning 
correctly. E.g.:

=== code starts here: ===
#include <iostream>
#include <ostream>
#include <string>

typedef std::wstring MyString;

int main()
{
    using std::cout;
    using std::endl;

    MyString str = L"Hello";
    for (MyString::iterator it = str.begin(); it!=str.end(); ++it)
    {
       // cast to char to avoid console output problems:
       cout << static_cast<char>(*it);
    }
    cout << endl;
}
=== code ends ===

Build command line:
===================
cl -EHsc test_string_begin.cpp

Output:
===================
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3052 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

test_string_begin.cpp
Microsoft (R) Incremental Linker Version 7.10.3052
Copyright (C) Microsoft Corporation. All rights reserved.

/out:test_string_begin.exe
test_string_begin.obj

Runtime output:
===================
Hello

Compiling with /Zc:wchar_t turned on behaves exactly the same. So 
something in Qt must be causing this problem!



More information about the Qt-interest-old mailing list