链接错误 [英] linking error

查看:72
本文介绍了链接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我使用microsoft visual studio 6.0,当我尝试构建我的应用程序时出现此错误:

vhdl.obj:错误LNK2001 :未解析的外部符号_yylex

LIBCD.lib(wincrt0.obj):错误LNK2001:未解析的外部符号_WinMain @ 16

Debug / parseur_vhdl.exe:致命错误LNK1120:2未解决的外部问题

执行link.exe时出错。

parseur_vhdl.exe - 3个错误,0个警告


任何帮助请!!

Hello all,
I use microsoft visual studio 6.0 and i have this error when I try to built my application :

vhdl.obj : error LNK2001: unresolved external symbol _yylex
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/parseur_vhdl.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
parseur_vhdl.exe - 3 error(s), 0 warning(s)


Any help please!!

推荐答案

由于您没有提供任何代码供我们查看,因此很难说。但是,我的第一个猜测是你没有链接所有必要的目标文件(即链接器找不到以下函数yylex()和WinMain()。
Its hard to say for sure since you haven''t supplied any of your code for us to look at. However, my first guess is that you aren''t linking all the necessary object files (ie. the linker can''t find the following functions "yylex()" and "WinMain()").



由于您没有提供任何代码供我们查看,因此很难说。但是,我的第一个猜测是你没有链接所有必要的目标文件(即链接器找不到以下函数yylex()和WinMain())。
Its hard to say for sure since you haven''t supplied any of your code for us to look at. However, my first guess is that you aren''t linking all the necessary object files (ie. the linker can''t find the following functions "yylex()" and "WinMain()").



vhdl.o来自vhdl.c,此文件由bison生成。我的应用程序是一个vhdl解析器。

vhdl.o is from vhdl.c, this file is generated by bison. My application is a vhdl parser.



vhdl.o来自vhdl.c,这个文件是由bison生成的。我的应用程序是一个vhdl解析器。
vhdl.o is from vhdl.c, this file is generated by bison. My application is a vhdl parser.



好​​的,问题是bison只生成解析某些令牌集的必要代码。解析代码需要一个函数yylex来获取令牌。通常,您的词法分析器代码将由flex或lex生成。最后,这些代码生成器中没有一个生成主方法。您需要提供此代码的其余部分以生成有效的应用程序。

Okay, the problem is that bison only generates the necessary code for parsing some set of tokens. The parsing code expects a function yylex for obtaining tokens. Generally, your lexer code would be generated by flex or lex. Finally neither one of these code generators produces a main method. You need to supply the rest of this code to produce a working application.


这篇关于链接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆