On 15/06/2013 4:49 AM, Sampo Syreeni wrote:
Tell me, is there a way to make Visual Studio behave like standard C/C++
under POSIX, under Windows? Like, that you just get a normal main() and
the normal libraries in the normal way?

I mean, I'm more than capable and *much* more than willing to do it the
conventional way, no matter how far into K&R it reaches, but for some
reason Visual Studio with its Win32 libraries doesn't play game. It just
fucking won't give me even a standard main() prototype and it insists on
weird Windows specific inclusions from the start.

If you can circumvent that stuff, how do you do that? And if you can't,
how precisely do they get to claim they're even *half* POSIX compliant?
(It'd help to know the precise rationale, because their explanation
would prolly spell out all of the stuff I'm asking about, here.)

I don't think MS claim POSIX compliance any more.

But as others have said, you get main() if you ask VS to make a console executable. I think the main point is that you need /SUBSYSTEM:CONSOLE parameter to the compiler/linker, otherwise it looks for WinMain not main(). See first answer here:

http://stackoverflow.com/questions/7316433/difference-between-console-subsystemconsole-and-windows-subsystemwindows

There are also various WinMain => main() adapters floating around if you want to write a gui app with a main() function.

Ross.
--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp

Reply via email to