title: Why does QCOMPARE(QString("1"), "1") cause a linker error?
body: <p>I'm exploring Qt's unit test framework, and I noticed an odd thing - considering that QString already implements the equality operator for <code>const char *</code>, I would have expected <code>QCOMPARE(QString("1"), "1")</code> to just work, but instead it causes a linker error:</p>
  
  <pre><code>tst_untitled14test.obj:-1: error: LNK2019: unresolved external symbol "bool __cdecl QTest::qCompare&lt;class QString,char const [2]&gt;(class QString const &amp;,char const (&amp;)[2],char const *,char const *,char const *,int)" (??$qCompare@VQString@@$$BY01$$CBD@QTest@@YA_NABVQString@@AAY01$$CBDPBD22H@Z) referenced in function "private: void __thiscall Untitled14Test::testCase1(void)" (?testCase1@Untitled14Test@@AAEXXZ)
  </code></pre>
  
  <p>Example code:</p>
  
  <pre><code>QVERIFY(QString("1") == "1");         // This works.
  QCOMPARE(QString("1"), QString("1")); // This works.
  // QCOMPARE(QString("1"), "1");       // Causes a linker error!
  </code></pre>
  
  <p>Why is that? Doesn't <code>QCOMPARE</code> use the equality operator of the 2 terms?</p>
  
  <p><strong>Edit:</strong> Since it was asked in the comments, the project is created by Qt Creator's unit test wizard (File->New Project->Other Project->Qt Unit Test), so of course it has been set up properly, and <code>QT += testlib</code> is included.</p>