[C/C++] wmain

Started by
5 comments, last by Rydinare 15 years, 11 months ago
I have a quick question. Do build environments such as GCC (Linux) and Xcode (Mac) use the wmain function like VC++ (Windows) does? Thanks for your time.
Advertisement
First of all I think you're thinking of winmain(). And the answer is no.

The entry point of an ISO C++ program is int main(), however compilers (Visual Studio included) all you to redefine the programs entry point.
Quote:Original post by fpsgamer
First of all I think you're thinking of winmain(). And the answer is no.


I'm not thinking of WinMain. I'm thinking of wmain, the unicode version of main.
Quote:Original post by Daggerbot
Quote:Original post by fpsgamer
First of all I think you're thinking of winmain(). And the answer is no.


I'm not thinking of WinMain. I'm thinking of wmain, the unicode version of main.


My bad. But upon checking MSDN's entry for wmain , it describes it as "Microsoft specific".
Ah thanks. I think for now I'll just convert the char** parameter to wchar_t**, until I figure out the Mac and Linux specific ways of getting unicode parameters.
Wow I guess you really do learn something new all the time especially when it comes to C/C++. First time I ever heard of wmain and from what I can gather it's implementation dependent so you'll have to write you code specifically to whatever compiler/platform you plan on using.
THE C/C++, main() AND COMMAND-LINE ARGUMENT
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
Quote:Original post by daviangel
Wow I guess you really do learn something new all the time especially when it comes to C/C++. First time I ever heard of wmain and from what I can gather it's implementation dependent so you'll have to write you code specifically to whatever compiler/platform you plan on using.
THE C/C++, main() AND COMMAND-LINE ARGUMENT


There's also the _T version, _tmain().

However, personally, I hate Microsoft's _T() macro stuff and refuse to use it. I understand their somewhat noble intention behind it, but it's macro hell. yuck.

This topic is closed to new replies.

Advertisement