2005년 12월 28일 수요일

FLTK(Fast Light Toolkit) 사용하기

. Video Tutorial
http://seriss.com/people/erco/fltk-videos/
왼쪽 클릭은 빨간색 동그라미, 오른쪽 클릭은 파란색 동그라미로 나타난다.

. FLTK 1.1 받기
http://www.fltk.org/ -> Download -> fltk-1.1.x-r4721.tar.gz

. 메뉴얼
http://www.fltk.org/ -> Manual -> FLTK 1.1.x -> HTML With Comment -> FLTK Basics -> Writing Your First FLTK Program

. 압축풀기

. FLTK를 build한다.
fltk-1.1.x-r4721\visualc\fltk.dsw을 연다.
Convert 할지 물으면 Yes To ALL을 선택한다.
(fltk-1.1.x-r4721\vcnet\fltk.sln을 Visual Studio .NET 2003으로 연다.)
Debug Mode에서 Ctrl+Shift+B를 눌러 build를 한다.
(F5를 눌러 실행을 하는 것은 에러가 난다. build만 하자.)
수많은 vcproj들이 하나씩 build될 것이다.
그러면서 fltk-1.1.x-r4721\lib 디렉퇴에 lib 파일이 하나씩 채워진다.
(처음에는 README.lib 파일 밖에 없었다.)
Build: 70 succeeded, 0 failed, 0 skipped 라고 나오면 모두 성공한 것이다.

. fltkdll.dll 파일복사
D:\util\fltk-1.1.x-r4721\vcnet\fltkdll.dll 파일을 C:\WINDOWS에 복사한다.

\test에 예제 프로그램이 컴파일 된다. (원래 .exe파일은 없었다.)
.exe 파일을 실행해 볼 수도 있고 대응되는 *.cxx 소스파일을 찾아서 볼 수도 있다.
예) curved.exe -> curve.cxx

. header 파일 위치
\FL
. lib 파일 위치
\lib

위의 build과정에서 dependent-argument 에러가 난다면
Tools -> Options -> Projects -> VC++ Directories -> Show directories for : 에서 위에 압축 디렉토리가 있다면 지우고 다시 빌드한다.

프로젝트 열기
New Project -> Win32 Project -> foo라는 이름으로 만듬

Project -> 프로그램명 Property Pages -> Configuration Properties
-> C/C++
-> Runtime Library -> Multi-threaded DLL(/MD)
-> Precompiled Headers -> Created/Use Precompiled Header -> Not Using Precompiled Headers
-> Command Line -> Additional Options -> /Id:\util\fltk-1.1.4
-> Linker
-> Command Line -> d:\util\fltk-1.1.4\fltk.lib wsock32.lib comctl32.lib

foo.cpp 외에는 모두 지운다.
foo.cpp의 내용도 모두 지우고 console 프로그램을 예제 프로그램과 같이 짠다.
실행시키면 된다.

댓글 없음:

댓글 쓰기