On 20.05.2011 at 19:13, Greg Ercolano wrote:

> There's an #ifdef clause that encloses it, which might be causing
> the problem, not sure:
>
> #if defined(WIN32)&&  !defined(FL_DLL)&&  !defined (__GNUC__)

yep, that's it.

> If that #if becomes false, it seems FLTK won't define WinMain.
> Since you're using DLL's, I'm wondering if that !defined(FL_DLL)
> is causing WinMain() not to be defined.

Yes, this is not defined in FLTK's dll build, but it should be in
the user's code if he want to link against the dll.

> There's probably a reason for the above logic; the comments in that
> file say:
>
>   * Because of problems with the Microsoft Visual C++ header files
>   * and/or compiler, you cannot have a WinMain function in a DLL.
>   * I don't know why.  Thus, this nifty feature is only available
>   * if you link to the static library.

I don't know if it is generally impossible (that may well be), but
at least this instance of a WinMain function can't be in the dll
for sure, since it wants to call main() - and main would be in the
user code and not in the dll...

> Perhaps experiment with putting the WinMain() code from that file
> into your app to see if that helps.

Looks like you could probably #include the entire file in your main
source file (before your own main() function).

Aside from that: Asif, you can't get rid of the console window if
you link with fltkdlld.dll (the one with the 'd'), since this is
the debugging dll, and it is a *feature* that this dll version
always opens a console window. You must use the fltkdll.dll (built
in "Release" mode) and set /subwindows:windows to get rid of the
console!

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

Reply via email to