Questions tagged [wmain]

8 questions
38
votes
3 answers

What is the difference between wmain and main?

So I have some class starting with #include #include and there is a wmain function . How is it different from main function i usually use in my C/C++ programs?
Rella
  • 65,003
  • 109
  • 363
  • 636
15
votes
5 answers

Can we use wmain() with Unix compilers or it'll work only on Windows?

Can we use the wmain() function with Unix compilers or it'll work only on/for Windows?
Rella
  • 65,003
  • 109
  • 363
  • 636
8
votes
2 answers

How do I use the wmain() entry point in Code::Blocks?

I did a fresh install of Code::Blocks (I installed the one for Windows 7 which comes with GCC compiler (codeblocks-10.05mingw-setup.exe)). Then I tried to compile this very simple code: int wmain(int argc, wchar_t* argv[]) { return 0; } I got…
hkBattousai
  • 10,583
  • 18
  • 76
  • 124
6
votes
2 answers

How to force the visual studio to use the wmain instead of main

I'm in need of parsing unicode parameters, so I wanted to use the wmain instead. So instead of int main(int argc, char** argv) I would like to use int wmain(int argc, wchar_t** argv) The problem is that the visual studio is not recognizing the…
kovarex
  • 1,766
  • 18
  • 34
3
votes
2 answers

wmain vs main C runtime

I have read few articles about different Windows C entry pooints, wmain and WinMain. So, if I am correct, these are added to C language compilers for Windows OS. But, how are implemented? For example, wmain gets Unicode as argv[], but its Os that…
B.Gen.Jack.O.Neill
  • 8,169
  • 12
  • 51
  • 79
2
votes
1 answer

C++ wmain function error when using Unicode

I was trying to use wmain for simple test code to practice with WCS strings (not MBCS), but I'm consistently getting error, while can't find out why. Here is my code. #include #include using namespace std; int wmain(int argc,…
Hashnut
  • 367
  • 3
  • 18
0
votes
1 answer

main() wrapper to start wmain() program to compile it from commandline

For example i have a program thats "main" function is defined as wmain. int wmain( int argc, wchar_t *argv[] ) { wchar_t* lpModulePath = NULL; wchar_t* lpFunctionName = NULL; lpModulePath = argv[1]; lpFunctionName = argv[2]; } and…
Jane dOE
  • 21
  • 6
-2
votes
3 answers

How do you make the warning come up that has the words 'suspicious' and '-Wmain' in it?

It's a simple question really, and refers to Linux (as opposed to Windows or Mac). How do you generate a warning message from the C or C++ compiler that must have the word 'suspicious' in it, and must refer to (-Wmain). (update) Thanks Boann - I…
Clive
  • 269
  • 1
  • 14