On 21.05.2011 17:01, asif saeed wrote:
> Hello Albrecht,
>
> This time,after defining FL_DLL as a preprocessor symbol, I got the
> following errors:

Did you *also* define "WIN32" ?

> 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>E:\scratch\tt\Release\tt.exe : fatal error LNK1120: 24 unresolved
> externals

Okay, "__declspec(dllimport)" and "__imp_" show that you do in fact try
to link with the dll version (FL_DLL is defined). Okay.

> 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.

No, the linker doesn't need nor does it look for the .dll file.
The linker needs the .lib file! IIRC I explained this already.
You need the .dll files when you want to run the executable.

> Any help now?

(1) check whether you defined "WIN32" (see above)

(2) check whether you defined the dependencies correctly:
(2a) add "fltkdll.lib" in
      Properties/Linker/Input/Additional Dependencies
      right before comctl32.lib
      (there should not be other fltk*.lib files in this line)
(2b) add "<path-to-fltk>/test" in
      Properties/Linker/General/Additional Library Directories
      (replace or remove "<path-to-fltk>/lib" if it is there).

Please report *everything* you do so that I can help you better.

And, again, please remove all fltkdll.dll files you copied until
you got the build working. Then, when you are ready to run the
program, try it first w/o copying the fltkdll.dll file. This
ought to issue an error message. Then copy only *one* fltkdll.dll
file into the *same* directory where you built your test .exe file.
Start it again: it should work.

Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to