VC++6.0编译LEX文件时报错error LNK2001: unresolved external symbol _wWinMain@16

neeeewbee 2020-05-29 11:53:14
在网上看到解决方案:
1. Windows子系统设置错误, 提示:
libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Windows项目要使用Windows子系统, 而不是Console, 可以这样设置:
[Project] --> [Settings] --> 选择"Link"属性页,
在Project Options中将/subsystem:console改成/subsystem:windows
2. Console子系统设置错误, 提示:
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
控制台项目要使用Console子系统, 而不是Windows, 设置:
[Project] --> [Settings] --> 选择"Link"属性页,
在Project Options中将/subsystem:windows改成/subsystem:console


我按1改就报错2,按2改就报错1。有无大牛破解死循环
...全文
864 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
顾小白xx 2021-01-14
  • 打赏
  • 举报
回复
VC6 早该舍弃了,我现在用2013都觉得老了。。
Simple-Soft 2020-05-29
  • 打赏
  • 举报
回复
你要是exe的,得有main或者winmain函数
zgl7903 2020-05-29
  • 打赏
  • 举报
回复
1. C/C++, Preprocessor difinitions 去除_MBCS,加_UNICODE 2. 在ProjectSetting/link/output 中设置Entry为wWinMainCRTStartup
neeeewbee 2020-05-29
  • 打赏
  • 举报
回复
%option yylineno

%{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


%}

number 		[-]?[0-9]+(\.[0-9]+)?
name		[_a-zA-Z][_0-9a-zA-Z()\.\*]*
whitespace	[ \n\t]
st		(select|SELECT|Select)
fm		(from|FROM|From)
wh		(where|WHERE|Where)
gy		(group[ ]+by|GROUP[ ]+BY|Group[ ]+By)
oy		(order[ ]+by|ORDER[ ]+BY|Order[ ]+By)
terminator	[;]
nsplit		[,]
whsplit		(and|AND|or|OR|Or|And)
define		(AS|as|As|aS)
operator	[<>=|(<=)|(>=)]
lborder		([ ]+\([ ]+)
rborder		([ ]+\)[ ]+)
indId		(\[[a-zA-Z0-9_]{1,24}\])

%%


{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;
}
neeeewbee 2020-05-29
  • 打赏
  • 举报
回复
引用 1 楼 Simple-Soft 的回复:
你要是exe的,得有main或者winmain函数
Lex文件中用main函数

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧