Home > Software engineering >  VC 6.0 compiler LEX file times wrong error LNK2001: unresolved external symbol _wWinMain @ 16
VC 6.0 compiler LEX file times wrong error LNK2001: unresolved external symbol _wWinMain @ 16

Time:11-09

See online solution:
1. Incorrect Windows subsystem, tip:
Libcmtd. Lib (crt0. Obj) : error LNK2001: unresolved external symbol _main
Windows program to use subsystem, instead of the Console, it can be set:
[the Project] - & gt; [Settings] - & gt; Select the "Link" property page,
In the Project Options will be/subsystem: the console to/subsystem: Windows
2. The Console subsystem set error, tip:
LIBCD. Lib (wincrt0. Obj) : error LNK2001: unresolved external symbol _WinMain @ 16
Console project to use the Console subsystem, rather than Windows, set:
[the Project] - & gt; [Settings] - & gt; Select the "Link" property page,
In the Project Options will be/subsystem: Windows to/subsystem: the console


I am error 2 press 1, press 2 to error 1, the presence of Daniel infinite loop

CodePudding user response:

If you were an exe, must have the main or winmain function

CodePudding user response:

The
reference 1/f, Simple, Soft reply:
if you exe, must have the main or winmain function


Lex file with the main function

CodePudding user response:

 % option yylineno 

% {
#include
#include
#include


%}

The number [-]? [0-9] + (\ [0-9] +)?
The name [_a - zA - Z] [_0-9 a zA - Z () \. \ *] *
Whitespace [\ n \ t]
St (select | select | select)
FM (from | the from | the from)
Wh (where | where | where)
Gy (group [] + by | group [] + by | group [] + by)
Oy (order [] + by | order [] + by | order + by [])
Terminator [;]
Nsplit [and]
Whsplit (and | and | or | or | or | and)
AS define (AS | | AS | AS)
Operator [& lt; & gt;=| | (& lt;=) (& gt;=)]
Lborder (+ \ [] [] (+)
Rborder + \ [] [] +)
IndId (\ [[a - zA - Z0-9 _], aiaa {1} \])

% %


{indId} {
return 0;
}


{st} {
return 0;
}

{FM} {
return 0;
}

{wh} {
return 0;
}

{gy} {
return 0;
}

{oy} {
return 0;
}

{define} {
return 0;
}

{whsplit} {
return 0;
}

{operator} {
return 0;
}

{nsplit} {
return 0;
}
{lborder} {
return 0;
}

{rborder} {
return 0;
}

{name} {
return 0;
}

{number} {
return 0;
}

{terminator} {
return 0;
}

{whitespace};
% %

Int main ()
{
Printf (" success ");
return 0;
}

CodePudding user response:

, 1 C/C + + Preprocessor difinitions remove _MBCS, plus _UNICODE
2. In ProjectSetting/link/output set Entry to wWinMainCRTStartup

  • Related