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 wmain, and it is trying to use main instead:
error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup
This is what I tried:
- Changing the Properties->General->Character set
Changing the Entry point (In this case I got lot of compatibility errors with libraries that don't even have entry point, so it can't be specified there).
warning LNK4258: directive '/ENTRY:mainCRTStartup' not compatible with switch '/ENTRY:mainWCRTStartup'; ignored
Tried the _tmain instead, just to find out it is just a macro that changes it to main.
- Using the #pragma comment(linker, "/SUBSYSTEM:CONSOLE /ENTRY:mainCRTStartup")
- Using the UNICODE macro
Nothing helps.
Edit: I would like to mention, that I'm using the vs120_xp (Win xp compatibile) toolset, but when I tried to use the default one, it still didn't work.
Edit2: I tried to make brand new project, and the wmain worked there out of the box. I didn't have to change anything, so it have to be some specific setting in the current project that is causing it.