任何帮助请!! 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 _yylexLIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16Debug/parseur_vhdl.exe : fatal error LNK1120: 2 unresolved externalsError 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. 这篇关于链接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-22 09:12