Hello Albrecht, This time,after defining FL_DLL as a preprocessor symbol, I got the following errors:
1>tt.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static int __cdecl Fl::run(void)" (__imp_?run@Fl@@SAHXZ) referenced in function _main 1>tt.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Fl_Window::show(int,char * *)" (__imp_?show@Fl_Window@@QAEXHPAPAD@Z) referenced in function _main 1>tt.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Fl_Group::end(void)" (__imp_?end@Fl_Group@@QAEXXZ) referenced in function _main 1>tt.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) enum Fl_Labeltype __cdecl fl_define_FL_SHADOW_LABEL(void)" (__imp_?fl_define_FL_SHADOW_LABEL@@YA?AW4Fl_Labeltype@@XZ) referenced in function _main 1>tt.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: __thiscall Fl_Widget::Fl_Widget(int,int,int,int,char const *)" (__imp_??0Fl_Widget@@IAE@HHHHPBD@Z) referenced in function _main 1>tt.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Fl_Window::Fl_Window(int,int,char const *)" (__imp_??0Fl_Window@@QAE@HHPBD@Z) referenced in function _main 1>tt.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Fl_Window::draw(void)" (?draw@Fl_Window@@MAEXXZ) 1>tt.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Fl_Window::handle(int)" (?handle@Fl_Window@@UAEHH@Z) 1>tt.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Window::resize(int,int,int,int)" (?resize@Fl_Window @@UAEXHHHH@Z) 1>tt.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Window::show(void)" (?show@Fl_Window@@UAEXXZ) 1>tt.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Window::hide(void)" (?hide@Fl_Window@@UAEXXZ) 1>tt.obj : error LNK2001: unresolved external symbol "public: virtual class Fl_Group * __thiscall Fl_Group::as_group(void)" (?as_group@Fl_Group @@UAEPAV1@XZ) 1>tt.obj : error LNK2001: unresolved external symbol "public: virtual class Fl_Window * __thiscall Fl_Window::as_window(void)" (?as_window@Fl_Window @@UAEPAV1@XZ) 1>tt.obj : error LNK2001: unresolved external symbol "public: virtual class Fl_Gl_Window * __thiscall Fl_Widget::as_gl_window(void)" (?as_gl_window@Fl_Widget@@UAEPAVFl_Gl_Window@@XZ) 1>tt.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Fl_Window::flush(void)" (?flush@Fl_Window@@MAEXXZ) 1>tt.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Fl_Box::draw(void)" (?draw@Fl_Box@@MAEXXZ) 1>tt.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Fl_Box::handle(int)" (?handle@Fl_Box@@UAEHH@Z) 1>tt.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Widget::resize(int,int,int,int)" (?resize@Fl_Widget @@UAEXHHHH@Z) 1>tt.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Widget::show(void)" (?show@Fl_Widget@@UAEXXZ) 1>tt.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Fl_Widget::hide(void)" (?hide@Fl_Widget@@UAEXXZ) 1>tt.obj : error LNK2001: unresolved external symbol "public: virtual class Fl_Group * __thiscall Fl_Widget::as_group(void)" (?as_group@Fl_Widget @@UAEPAVFl_Group@@XZ) 1>tt.obj : error LNK2001: unresolved external symbol "public: virtual class Fl_Window * __thiscall Fl_Widget::as_window(void)" (?as_window@Fl_Widget @@UAEPAVFl_Window@@XZ) 1>tt.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Fl_Widget::~Fl_Widget(void)" (__imp_??1Fl_Widget@ @UAE@XZ) referenced in function "public: virtual void * __thiscall Fl_Box::`scalar deleting destructor'(unsigned int)" (??_GFl_Box@@UAEPAXI@Z) 1>tt.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Fl_Window::~Fl_Window(void)" (__imp_??1Fl_Window@ @UAE@XZ) referenced in function "public: virtual void * __thiscall Fl_Window::`scalar deleting destructor'(unsigned int)" (??_GFl_Window@ @UAEPAXI@Z) 1>E:\scratch\tt\Release\tt.exe : fatal error LNK1120: 24 unresolved externals Apparently, the linker cannot find the dll. Even though I have placed it in the same directory where the EXE is supposed to be created. Any help now? Thanks and regards, Asif On Sat, May 21, 2011 at 7:27 PM, Albrecht Schlosser <[email protected]>wrote: > On 21.05.2011 15:24, asif saeed wrote: > > > I built in release configuration (with multi-byte character set) the > > following projects in order: > > > > fltkjpeg > > fltkpng > > fltkzlib > > fltkdll (I built fltkdll separately) > > > > This created .lib files for jpeg, png and zlib in the > fltk-1.3.x-r8514\lib > > directory and an fltkdll.dll in fltk-1.3.x-r8514\test directory. > > okay so far ... > > > Then > > 1) I created a new empty win32 application .exe project. > > 2) set the configuration to Release > > 3) specified multi-byte character-set in the Configuration > > Properties/General > > Why do you do this? You'd better only do one step after the other. If it > is not necessary, don't do it. But I don't say that this matters here... > > > 4) put "E:\libs\fltk-1.3.x-r8514" in the > C++/General/Additional > > Include Directories > > 5) specified "E:\libs\fltk-1.3.x-r8514\lib" in > > Linker/General/Additional Library Directories > > 6) specified "comctl32.lib" in Linker/Input - according to > the > > online docs. > > 7) set Linker/System/Subsystem to Windows (/SUBSYTEM:WINDOWS) > > okay. > > > I got the following errors: > > > > > > 1>tt.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) > > 1>tt.obj : error LNK2001: unresolved external symbol "protected: virtual > > void __thiscall Fl_Box::draw(void)" (?draw@Fl_Box@@MAEXXZ) > > ... > > > 1>E:\scratch\tt\Release\tt.exe : fatal error LNK1120: 13 unresolved > > externals > > You missed probably two more points in your project's setup: > > (1) you must define "WIN32" for all FLTK projects > (2) you must define "FL_DLL" if you want to link with the dll version > > You can do this in the compiler/c++ setup (I don't know the exact > menu names), there you can define additional macros or something like > this. > > > I also specified the directory E:\libs\fltk-1.3.x-r8514\test in the > > operating system's PATH variable and put fltkdll.dll in every > sub-directory > > under the project directory tree. > > Again, don't do this (and you'd better delete all these fltkdll.dll > copies, because you'd otherwise have old copies somewhere, and you > never know which one is used). > > If you changed the OS PATH variable, you may need to reboot (I don't > know, and I won't try this for you), but it is much easier to copy > fltkdll.dll *only* to the same directory where you built your own > application (.exe file). You may also need the other 3 .dll files > you mentioned above, but I'm not sure. > > > I hope you can help me get these errors fixed. > > Okay, let's try this, and do only the steps I wrote above. Do not > rebuild fltk(dll), since this is probably okay. > > I'm not sure if and where these compiler macros are defined, but > please add them to your project for now, and let's see that later. > > If it doesn't work, please post your error messages again, and > describe what you did so far. > > HTH > Albrecht > _______________________________________________ > fltk mailing list > [email protected] > http://lists.easysw.com/mailman/listinfo/fltk > _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

