title: QtCreator Boost Error: undefined reference to `_imp__WSACleanup@0'
body: <p>I am using boost 1.57.0 and QT Creator 5.3 with MinGW 32Bit Compiler and I'm using WIndows8.1. I tried to link the Boost Libraries to my project and since it didn't work I started a little Testprogramm but I got the same errors. I've already tried all tutorials I could find but they didnt't work.</p>
  
  <p>I compiled boost with MinGW to boost_libraries folder.
  So here is my .pro File:</p>
  
  <pre><code>QT       += core gui
  
  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  
  TARGET = Test
  TEMPLATE = app
  
  DEFINES += BOOST_SYSTEM_NO_DEPRECATED
  DEFINES += BOOST_ALL_DYN_LINK  # for using dynamic libraries
  
  #here is the part with my boost libraries
  DEPENDPATH += C:/boost_libraries/include/boost-1_57
  INCLUDEPATH += C:/boost_libraries/include/boost-1_57
  LIBS += -L "C:/boost_libraries/lib/" -lboost_thread-mgw48-mt-1_57
  
  SOURCES += main.cpp\
      mainwindow.cpp
  
  HEADERS  += mainwindow.h
  
  FORMS    += mainwindow.ui
  </code></pre>
  
  <p>So here comes my Test Class:</p>
  
  <pre><code>#ifndef MAINWINDOW_H
  #define MAINWINDOW_H
  
  #include &lt;QMainWindow&gt;
  #include &lt;boost/asio.hpp&gt;
  
  namespace Ui {
  class MainWindow;
  }
  
  class MainWindow : public QMainWindow
  {
      Q_OBJECT
  
  public:
      explicit MainWindow(QWidget *parent = 0);
      ~MainWindow();
  
  private:
      Ui::MainWindow *ui;
  };
  
  #endif // MAINWINDOW_H
  </code></pre>
  
  <p>And these are the Errors that I get trying to build it in Release and Debug mode:</p>
  
  <pre><code>C:\Qt\Tools\QtCreator\bin\Test\main.cpp:-1: Fehler: undefined reference to `_imp__WSACleanup@0'
  C:\Qt\Tools\QtCreator\bin\Test\main.cpp:-1: Fehler: undefined reference to `_imp__WSAStartup@8'
  :-1: Fehler: release/main.o: bad reloc address 0x3f in section `.text$_ZN5boost4asio6detail17winsock_init_base7startupERNS2_4dataEhh[__ZN5boost4asio6detail17winsock_init_base7startupERNS2_4dataEhh]'
  collect2.exe:-1: Fehler: error: ld returned 1 exit status
  </code></pre>
  
  <hr>
  
  <p>Hi. now I changed my code a little bit and my .pro file looks like this now:</p>
  
  <pre><code>QT       += core gui
  
  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  
  TARGET = Test
  TEMPLATE = app
  
  DEFINES += BOOST_SYSTEM_NO_DEPRECATED
  DEFINES += BOOST_ALL_DYN_LINK  # for using dynamic libraries
  
  DEPENDPATH += C:/boost_libraries/include/boost-1_57
  INCLUDEPATH += C:/boost_libraries/include/boost-1_57
  
  LIBS += -LC:/boost_libraries/lib/  \
             -lboost_thread-mgw48-mt-1_57 \
             -lboost_system-mgw48-mt-1_57 \
             -lboost_filesystem-mgw48-mt-1_57
  
  LIBS += -lws2_32
  
  SOURCES += main.cpp\
          mainwindow.cpp
  
  HEADERS  += mainwindow.h
  
  FORMS    += mainwindow.ui
  </code></pre>
  
  <p>Now I get this Errors:</p>
  
  <pre><code>C:\Qt\Tools\QtCreator\bin\Test\main.cpp:-1: Fehler: undefined reference to `_imp___ZN5boost6system15system_categoryEv'
  C:\Qt\Tools\QtCreator\bin\Test\mainwindow.cpp:-1: Fehler: undefined reference to `_imp___ZN5boost6system15system_categoryEv'
  moc_mainwindow.cpp:-1: Fehler: undefined reference to `_imp___ZN5boost6system15system_categoryEv'
  collect2.exe:-1: Fehler: error: ld returned 1 exit status
  </code></pre>
  
  <p>Did I make any mistakes linking lboost_system? I also tried out every library in a seperate line.</p>