[C/C++] wmain
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.
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.
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 DaggerbotQuote: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
THE C/C++, main() AND COMMAND-LINE ARGUMENT
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
Popular Topics
Advertisement