title: Qt/mingw32 undefined reference errors... unable to link a .lib
body: <p>I am new to Qt and have one error I am unable to fix.</p>
  
  <p>I have a bunch of windows (VS2005) static library file (<code>.lib</code>). And I am testing if they work well with Qt. So I took the most simple library that I have. (Called <code>MessageBuffer</code>).</p>
  
  <p>So I added <code>MessageBuffer.h</code> to the <code>main.cpp</code>, and added the location of those file in the <code>INCLUDEPATH</code> of the <code>.pro</code>.</p>
  
  <p>Until then everything seem fine, I can use the class and Qt IDE show all method and everything. So to me it look like it found the .h file.</p>
  
  <p>Now I added the <code>MessageBuffer.lib</code> (VS2005/Debug build) in the <code>.pro</code> like this:</p>
  
  <pre><code>LIBS += E:/SharedLibrary/lib/MessageBufferd.lib
  </code></pre>
  
  <p>I have also tried the following:</p>
  
  <pre><code>win32:LIBS += E:/SharedLibrary/lib/MessageBufferd.lib
  LIBS += -LE:/SharedLibrary/lib -lMessageBufferd
  win32:LIBS += -LE:/SharedLibrary/lib -lMessageBufferd
  </code></pre>
  
  <p>Here is the content of my <code>.pro</code> file:</p>
  
  <pre><code>QT += opengl
  TARGET = SilverEye
  TEMPLATE = app
  INCLUDEPATH += E:/SharedLibrary/MessageBuffer
  SOURCES += main.cpp \
      silvereye.cpp
  HEADERS += silvereye.h
  FORMS += silvereye.ui
  OTHER_FILES += 
  win32:LIBS += E:/SharedLibrary/lib/MessageBufferd.lib
  </code></pre>
  
  <p>They all give me the same errors: (and I get the same even if I don't include the <code>.lib</code>)</p>
  
  <pre><code>Running build steps for project SilverEye...
  Configuration unchanged, skipping QMake step.
  Starting: C:/Qt/2009.03/mingw/bin/mingw32-make.exe -w 
  mingw32-make: Entering directory `C:/Documents and Settings/JP/My Documents/QTProjects/SilverEye'
  C:/Qt/2009.03/mingw/bin/mingw32-make -f Makefile.Debug
  mingw32-make[1]: Entering directory `C:/Documents and Settings/JP/My Documents/QTProjects/SilverEye'
  g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\SilverEye.exe debug/main.o debug/silvereye.o debug/moc_silvereye.o -L"c:\Qt\2009.03\qt\lib" -lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmaind E:/SharedLibrary/lib/MessageBufferd.lib -lQtOpenGLd4 -lQtGuid4 -lQtCored4
  mingw32-make[1]: Leaving directory `C:/Documents and Settings/JP/My Documents/QTProjects/SilverEye'
  mingw32-make: Leaving directory `C:/Documents and Settings/JP/My Documents/QTProjects/SilverEye'
  debug/main.o: In function `Z5qMainiPPc':
  C:/Documents and Settings/JP/My Documents/QTProjects/SilverEye/main.cpp:12: undefined reference to `MessageBuffer::MessageBuffer()'
  C:/Documents and Settings/JP/My Documents/QTProjects/SilverEye/main.cpp:13: undefined reference to `MessageBuffer::Append(char*, int)'
  C:/Documents and Settings/JP/My Documents/QTProjects/SilverEye/main.cpp:17: undefined reference to `MessageBuffer::~MessageBuffer()'
  C:/Documents and Settings/JP/My Documents/QTProjects/SilverEye/main.cpp:17: undefined reference to `MessageBuffer::~MessageBuffer()'
  collect2: ld returned 1 exit status
  mingw32-make[1]: *** [debug\SilverEye.exe] Error 1
  mingw32-make: *** [debug] Error 2
  Exited with code 2.
  Error while building project SilverEye
  When executing build step 'Make'
  </code></pre>
  
  <p>Can anyone help please?</p>