【发布时间】:2022-11-23 06:04:23
【问题描述】:
我是 C++ 的新手,正在使用 FLTK 和 cURL 制作项目。目前我正在尝试使用 MinGW g++ 为 Windows 编译我的应用程序。 我将来自 FLTK 和 cURL 的 include 和 lib 文件夹中的文件放入我自己的项目文件夹中的 include 和 lib 文件夹中。
然后我尝试使用它来编译它
g++ main.cpp -o out.exe -Wall -Iinclude -Llib
但是得到错误列表
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0x218): undefined reference to `Fl_Widget::deactivate()'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0x42e): undefined reference to `Fl::check()'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0x440): undefined reference to `_imp__curl_easy_init'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0x469): undefined reference to `_imp__curl_easy_setopt'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0x486): undefined reference to `_imp__curl_easy_setopt'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0x4a5): undefined reference to `_imp__curl_easy_setopt'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0x4b2): undefined reference to `_imp__curl_easy_perform'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0x4c2): undefined reference to `_imp__curl_easy_cleanup'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0x6a5): undefined reference to `Fl::check()'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0x887): undefined reference to `Fl::check()'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0xa50): undefined reference to `Fl_Widget::copy_label(char const*)'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0xa75): undefined reference to `Fl_Widget::activate()'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0xc98): undefined reference to `Fl_Widget::label(char const*)'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0xca5): undefined reference to `Fl_Widget::activate()'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0xcf6): undefined reference to `Fl_Window::Fl_Window(int, int, char const*)'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0xd38): undefined reference to `Fl_Box::Fl_Box(int, int, int, int, char const*)'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0xd7a): undefined reference to `Fl_Box::Fl_Box(int, int, int, int, char const*)'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0xdbf): undefined reference to `Fl_Progress::Fl_Progress(int, int, int, int, char const*)'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0xe04): undefined reference to `Fl_Input::Fl_Input(int, int, int, int, char const*)'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0xe49): undefined reference to `Fl_Return_Button::Fl_Return_Button(int, int, int, int, char const*)'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0xef6): undefined reference to `Fl_Input_::static_value(char const*)'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0xf2b): undefined reference to `Fl_Group::end()'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0x1025): undefined reference to `Fl_Window::show(int, char**)'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text+0x102d): undefined reference to `Fl::run()'
C:\Users\TYMURP~1\AppData\Local\Temp\ccxAfSN5.o:main.cpp:(.text$_ZN11Fl_Progress5valueEf[__ZN11Fl_Progress5valueEf]+0x18): undefined reference to `Fl_Widget::redraw()'
collect2.exe: error: ld returned 1 exit status
我究竟做错了什么?
【问题讨论】:
标签: c++ g++ mingw libcurl fltk