2
FLTK을 시도하기 위해, 나는 다음과 같은 파일 구조 않은 : 나는 지금 실행링크 FLTK는
#include <FL/Fl.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Window.H>
int main()
{
Fl_Window window(200, 200, "Window title");
Fl_Box box(0,0,200,200,"Hello, World!");
window.show();
return Fl::run();
}
때 :
project
|--main.cc
|--include
| |--FL
| | |--all FLTK header files
|--lib
| |--libfltk.a
| |--other fltk libraries
main.cc에서 다음과 같은 내용을
g++ -std=c++11 -c -o main.o main.cc -I include
g++ -std=c++11 -o main.exe main.o -L lib -lfltk
나는 두 번째 호출 후 오류의 모두를 얻을 g ++ :
lib/libfltk.a(Fl.o):Fl.cxx:(.text$_ZL13image_to_iconPK12Fl_RGB_Imagebii+0xf3): undefined reference to `[email protected]'
lib/libfltk.a(Fl.o):Fl.cxx:(.text$_ZL13image_to_iconPK12Fl_RGB_Imagebii+0x1cf): undefined reference to `[email protected]'
lib/libfltk.a(Fl.o):Fl.cxx:(.text$_ZL13image_to_iconPK12Fl_RGB_Imagebii+0x258): undefined reference to `[email protected]'
lib/libfltk.a(Fl.o):Fl.cxx:(.text$_ZL13image_to_iconPK12Fl_RGB_Imagebii+0x2a6): undefined reference to `[email protected]'
lib/libfltk.a(Fl.o):Fl.cxx:(.text$_ZL13image_to_iconPK12Fl_RGB_Imagebii+0x2b1): undefined reference to `[email protected]'
lib/libfltk.a(Fl.o):Fl.cxx:(.text$__tcf_1+0x5b): undefined reference to `[email protected]'
lib/libfltk.a(Fl.o):Fl.cxx:(.text$__tcf_1+0x83): undefined reference to `[email protected]'
etc ...
다른 FLTK 라이브러리를 연결하려고하면 결과가 동일합니다. 누구든지 저를 도울 수 있습니까?
Windows에서 gcc를 사용하며 MingW와 함께 사용합니다.
FLTK 프로그램을 컴파일하기위한 라이브러리와 컴파일러 플래그를 파악할 수 있도록 모든 FLTK 릴리즈에 포함 된 'fltk-config'라는 편리한 도구가 있습니다. 그래서 터미널에서'fltk-config --libs'를 실행하십시오. 나는 당신이 "- lwindows"또는 이와 비슷한 것을 추가했다고 생각한다. (나는 창문이 없다.) – Andy