在Windows中链接FLTK 2.0中的错误

我正在使用Qt Creator(不使用任何Qt库)来testingFLTK2.0的Hello World项目。 但是我得到的错误如下所示:

错误:UpBox.cxx:-1:错误:未定义引用SelectObject@8' UpBox.cxx:-1: error: undefined reference to SetROP2 @ 8'UpBox.cxx:-1:错误:未定义引用PatBlt@24' UpBox.cxx:-1: error: undefined reference to CreatePatternBrush @ 4'UpBox.cxx:-1:错误:未定义的引用DeleteObject@4' :-1: error: C:\Users\mypc\Desktop\FLTK\fltk-2.0-win-bin\lib/libfltk2.a(UpBox.o): bad reloc address 0xb in section .text中的DeleteObject@4' :-1: error: C:\Users\mypc\Desktop\FLTK\fltk-2.0-win-bin\lib/libfltk2.a(UpBox.o): bad reloc address 0xb in section $ _ZN4fltk7FlatBoxD1Ev [__ ZN4fltk7FlatBoxD1Ev]'

main.cpp文件如下所示:

 #include <fltk/Window.h> #include <fltk/Widget.h> #include <fltk/run.h> using namespace fltk; int main(int argc, char **argv) { Window *window = new Window(300, 180); window->begin(); Widget *box = new Widget(20, 40, 260, 100, "Hello, World!"); box->box(UP_BOX); box->labelfont(HELVETICA_BOLD_ITALIC); box->labelsize(36); box->labeltype(SHADOW_LABEL); window->end(); window->show(argc, argv); return run(); } 

hello.pro文件:

 TEMPLATE = app CONFIG += console CONFIG -= app_bundle CONFIG -= qt SOURCES += main.cpp CONFIG+= c++11 LIBS += -L"C:\\Users\\mypc\\Desktop\\FLTK\\fltk-2.0-win-bin\\lib" -lfltk2 INCLUDEPATH += "C:\\Users\\mypc\\Desktop\\FLTK\\fltk-2.0-win-bin\\include" DEPENDPATH += "C:\\Users\\mypc\\Desktop\\FLTK\\fltk-2.0-win-bin\\include" 

为什么我会收到这些错误?

nb:FLTK 2.o MinGw编译的二进制文件是从FLTK Windows二进制文件下载的

Solutions Collecting From Web of "在Windows中链接FLTK 2.0中的错误"