Hi Greg,

I get unresolved linker error on main when I use /SUBSYSTEM:WINDOWS:

1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol
_WinMain@16 referenced in function ___tmainCRTStartup
1>E:\scratch\ttt\Debug\ttt.exe : fatal error LNK1120: 1 unresolved externals

Now in this case I replaced my own code with code from an example
editor.cxx. Same error results. It works fine if I switch to
SUBSYSTEM:CONSOLE. Strangely, I don't know why but when I run editord.exe
from windows shell, it runs without any dos window. All the other examples
in the test directory run with dos window.

I await for your feedback.

Thanks, Asif


On Fri, May 20, 2011 at 9:46 PM, Greg Ercolano <[email protected]> wrote:

> asif saeed wrote:
> > It does show me the win32 Hello, World window but it also displays an
> ugly
> > dos window. The program builds, runs and ends perfectly fine but shows
> the
> > DOS window.
>
>         Are you still building against the debug version of FLTK?
>        IIRC, the debug version of FLTK builds 'console' apps
> (/subsystem:console)
>        and the release version of FLTK builds 'windows' apps
> (/subsystem:windows)
>        when it comes to the test programs.
>
>        Either way, check this linker flag in your executable's build.
>
>        Quoting the docs:
>        http://fltk.org/doc-1.3/osissues.html
>
> * * *
> How to Not Get a MSDOS Console Window
>
> WIN32 has a really stupid mode switch stored in the executables that
> controls
> whether or not to make a console window.
>
> To always get a console window you simply create a console application
> (the "/SUBSYSTEM:CONSOLE" option for the linker). For a GUI-only
> application
> create a WIN32 application (the "/SUBSYSTEM:WINDOWS" option for the
> linker).
>
> FLTK includes a WinMain() function that calls the ANSI standard main()
> entry point for you. This function creates a console window when you
> use the debug version of the library.
>
> WIN32 applications without a console cannot write to stdout or stderr,
> even if they are run from a console window. Any output is silently thrown
> away. Additionally, WIN32 applications are run in the background by the
> console, although you can use "start /wait program" to run them in the
> foreground.
>
> * * *
> _______________________________________________
> fltk mailing list
> [email protected]
> http://lists.easysw.com/mailman/listinfo/fltk
>
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to