Wie verwende/installiere ich FLTK2
-
Hallo,
auf der FLTK Homepage ist die Installation mit VS 2003 als sehr einfach beschrieben, mit 2 Sätzen, einfach fltk.dsw Datei öffnen und Build drücken.
Wenn ich das mit VC++ Express ausprobiere, hagelt es jede Menge Fehlermeldungen. Was soll bei diesem Build Vorgang eigentlich herrauskommen ?
Warum gibt es nicht einfach ein paar libs zum einbinden, diverse Headerdateien und ein Template zum einfachen erstellen ?
-
Witzbold! Poste doch mal ein paar Fehlermeldungen. Wir können ja nicht hellsehen.
-
ok hier die Meldungen, sind insgesamt 40 DIN A4 Seiten. Hier mal ein Teil der 1.
----- Build started: Project: zlib, Configuration: Debug Win32 ------
Compiling...
cl : Command line warning D9035 : option 'Fr' has been deprecated and will be removed in a future release
cl : Command line warning D9036 : use 'FR' instead of 'Fr'
adler32.c
compress.c
crc32.c
deflate.c
gzio.c
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\images\zlib\gzio.c(108) : warning C4996: 'strcpy' was declared deprecated
c:\programme\microsoft visual studio 8\vc\include\string.h(73) : see declaration of 'strcpy'
Message: 'This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\images\zlib\gzio.c(156) : warning C4996: 'fopen' was declared deprecated
c:\programme\microsoft visual studio 8\vc\include\stdio.h(234) : see declaration of 'fopen'
Message: 'This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\images\zlib\gzio.c(201) : warning C4996: 'sprintf' was declared deprecated
c:\programme\microsoft visual studio 8\vc\include\stdio.h(345) : see declaration of 'sprintf'
Message: 'This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\images\zlib\gzio.c(535) : warning C4996: 'vsprintf' was declared deprecated
c:\programme\microsoft visual studio 8\vc\include\stdio.h(345) : see declaration of 'vsprintf'
Message: 'This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\images\zlib\gzio.c(871) : warning C4996: 'strcpy' was declared deprecated
c:\programme\microsoft visual studio 8\vc\include\string.h(73) : see declaration of 'strcpy'
Message: 'This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\images\zlib\gzio.c(872) : warning C4996: 'strcat' was declared deprecated
c:\programme\microsoft visual studio 8\vc\include\string.h(78) : see declaration of 'strcat'
Message: 'This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\images\zlib\gzio.c(873) : warning C4996: 'strcat' was declared deprecated
c:\programme\microsoft visual studio 8\vc\include\string.h(78) : see declaration of 'strcat'
Message: 'This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
infblock.c
infcodes.c
-
Gib uns nur die 'error' Meldungen, 'warning' ist erstmal uninteressant.
-
Hier mal ein Teil der Fehler. Er findet wohl die windows.h nicht ?
------ Build started: Project: fltk, Configuration: Debug Win32 ------
Compiling...c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\src\filename_absolute.cxx(174) : error C3861: 'tolower': identifier not found
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\src\filename_absolute.cxx(174) : error C3861: 'tolower': identifier not found
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\src\filename_absolute.cxx(188) : error C3861: 'tolower': identifier not found
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\src\filename_absolute.cxx(188) : error C3861: 'tolower': identifier not found
addarc.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
addcurve.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
args.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
bmpImage.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
clip.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
Color.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
Cursor.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
dnd.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
drawimage.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
error.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
event_key_state.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
FileBrowser.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\src\filebrowser.cxx(57) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
fillrect.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
fltk_theme.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
Font.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
gifImage.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
GSave.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
Image.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
list_fonts.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
Generating Code...
Compiling...
load_plugin.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
lock.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\src\win32\lock.cxx(1) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
MenuWindow.cxx
c:\dokumente und einstellungen\philipp\desktop\fltk-2.0.x-r4948\fltk-2.0.x-r4948\fltk\win32.h(33) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
-
so wie ich das sehe ist bei VC++ Express das Platform SDK nicht dabei. Welches muss ich denn installieren bei windows xp:
-Windows Server 2003 SP1 Platform SDK Web Install
-Microsoft Windows SDK for the February 2006 CTP Genuine Windows download
-Windows Server 2003 R2 Platform SDK Web Install
-
Siehste, ist doch gleich viel einfacher, mit ein paar konkreten Fehlermeldungen.
Die PlatformSDK mußt du tatsächlich extra herunter laden und installiere. Eine genaue Anleitung gibt es auf der Download-Seite der Express-Version (der letzte Step).
Am besten lädts du dir das aktuellste PlatformSDK runter. Wenn es die vom Februar ist, dann halt die. Weiß jetzt nicht ob man selbst bestimmen kann, was man davon runter lädt. Wenn du Pech hast, dann die ganzen 600 MB, oder wieviele das sind.
-
So also, der aktuelle Status sieht so aus:
PSDK heruntergeladen, installiert nach Anleitung. FLTK kompiliert ohne Fehlermeldungen. Wollte nun das Hello World FLTK Projekt kompilieren, habe den include Pfad angepasst und erhalte jetzt noch folgende Fehler:------ Build started: Project: fltk, Configuration: Debug Win32 ------
Compiling...
main.cpp
Linking...
main.obj : error LNK2019: unresolved external symbol "protected: __thiscall Fl_Widget::Fl_Widget(int,int,int,int,char const *)" (??0Fl_Widget@@IAE@HHHHPBD@Z) referenced in function "public: __thiscall Fl_Box::Fl_Box(int,int,int,int,char const *)" (??0Fl_Box@@QAE@HHHHPBD@Z)
main.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Fl_Box::draw(void)" (?draw@Fl_Box@@MAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Fl_Box::handle(int)" (?handle@Fl_Box@@UAEHH@Z)
main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Widget::resize(int,int,int,int)" (?resize@Fl_Widget@@UAEXHHHH@Z)
main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Fl_Widget::~Fl_Widget(void)" (??1Fl_Widget@@UAE@XZ) referenced in function "public: virtual __thiscall Fl_Box::~Fl_Box(void)" (??1Fl_Box@@UAE@XZ)
main.obj : error LNK2019: unresolved external symbol "public: static int __cdecl Fl::run(void)" (?run@Fl@@SAHXZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: void __thiscall Fl_Window::show(int,char * *)" (?show@Fl_Window@@QAEXHPAPAD@Z) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: void __thiscall Fl_Group::end(void)" (?end@Fl_Group@@QAEXXZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "enum Fl_Labeltype __cdecl fl_define_FL_SHADOW_LABEL(void)" (?fl_define_FL_SHADOW_LABEL@@YA?AW4Fl_Labeltype@@XZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: __thiscall Fl_Window::Fl_Window(int,int,char const *)" (??0Fl_Window@@QAE@HHPBD@Z) referenced in function _main
C:\Dokumente und Einstellungen\philipp\Eigene Dateien\Visual Studio 2005\Projects\fltk\Debug\fltk.exe : fatal error LNK1120: 10 unresolved externals
Build log was saved at "file://c:\Dokumente und Einstellungen\philipp\Eigene Dateien\Visual Studio 2005\Projects\fltk\fltk\Debug\BuildLog.htm"
fltk - 11 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
-
Das sind Linker-Errors. Der findet die FLTK-Libraries nicht, also die fertig gebauten *.lib-Dateien. Die Includes hat er ja, immerhin, sonst hätte der Compiler fehler gemeldet. Also, noch die Libs bekannt geben:
Projekt->Eigenschaften->Linker->BefehlzeileDort die nötigen lib-Dateien durch Leerzeichen getrennt angeben.
-
So jetzt funktioniert alles. Vielen Dank für die Hilfe und für die Geduld. Die fltkdlld.dll muss ich wohl der exe Datei beilegen, da er sich sonst beschwert, dass er die dll nicht finden kann.
-
Artchi schrieb:
Dort die nötigen lib-Dateien durch Leerzeichen getrennt angeben.
wie bekommte ich heraus, was die nötigen lib-Dateien sind? sind das die 7 dateien im 'lib'-ordner? die habe ich nämlich über project->properties->linker->command line eingefügt. jetzt habe ich aber immer noch folgende fehlermeldungen:
Error 1 error LNK2019: unresolved external symbol ___WSAFDIsSet@8 referenced in function "int __cdecl fl_wait(double)" (?fl_wait@@YAHN@Z) fltkd.lib
Error 2 error LNK2019: unresolved external symbol _select@20 referenced in function "int __cdecl fl_wait(double)" (?fl_wait@@YAHN@Z) fltkd.lib
Error 3 error LNK2019: unresolved external symbol __imp___TrackMouseEvent@4 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) fltkd.lib
Error 4 fatal error LNK1120: 3 unresolved externals C:\Dokumente und Einstellungen\User\Eigene Dateien\TEST\Debug\TEST.exeDANKE.
STICK.// EDIT: die lösing sieht so aus:
#pragma comment(lib, "winmm.lib") #pragma comment(lib, "wsock32.lib") #pragma comment(lib, "advapi32.lib")
-
stick_thai schrieb:
Artchi schrieb:
Dort die nötigen lib-Dateien durch Leerzeichen getrennt angeben.
wie bekommte ich heraus, was die nötigen lib-Dateien sind? sind das die 7 dateien im 'lib'-ordner? die habe ich nämlich über project->properties->linker->command line eingefügt. jetzt habe ich aber immer noch folgende fehlermeldungen:
Error 1 error LNK2019: unresolved external symbol ___WSAFDIsSet@8 referenced in function "int __cdecl fl_wait(double)" (?fl_wait@@YAHN@Z) fltkd.lib
Error 2 error LNK2019: unresolved external symbol _select@20 referenced in function "int __cdecl fl_wait(double)" (?fl_wait@@YAHN@Z) fltkd.lib
Error 3 error LNK2019: unresolved external symbol __imp___TrackMouseEvent@4 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) fltkd.lib
Error 4 fatal error LNK1120: 3 unresolved externals C:\Dokumente und Einstellungen\User\Eigene Dateien\TEST\Debug\TEST.exeDANKE.
STICK.// EDIT: die lösing sieht so aus:
#pragma comment(lib, "winmm.lib") #pragma comment(lib, "wsock32.lib") #pragma comment(lib, "advapi32.lib")