Yacc and bison in visual studio

I am going to transfer the project C, which was for unix in windows. Until now, I could compile it, but not build it. The problem I am getting is that some of the functions declared in the header files are defined in the yacc files. So I get the following errors:

 error LNK2001: unresolved external symbol function_name

I am adding .y and .l files to the project source directory. I think I could not transfer the yacc files to the Windows version or I am doing something stupid. I am looking for him on the Internet, but could not get the right study guide for him. Could you tell me

  • How can I add .y or .l files to a project.
  • How can I make these files compatible with windows?
  • How to link them with other object files.

EDIT

I tried changing files .lto files .yy.cusing flex.exe.Following - this is the command for it

     c:\> flex.exe name.l

, flex.exe name.l C;>. .l .y(previously present for parsing in unix system) .yy.c(corrsonding yacc file for windows) .

 Can't read the header file  parserheaderfile.h 

, bison unix . , bison windows. , , ?

.

+5
1

.y .l .

  • .c .l .y.
  • .l,.y .c
  • .l
  • - >
  • - > - >
  • Custom Build Tool- > General- > Command Line β†’ flex -olexer.c lexer.l
  • Custom Build Tool- > General- > Outputs β†’ lexer.c
  • Custom Build Tool- > General- > Additional Dependencies β†’ parser.y parser.c
  • .y
  • - >
  • - > - >
  • Custom Build Tool- > General- > Command Line β†’ bison -oparser.c parser.y
  • Custom Build Tool- > General- > Outputs β†’ parser.c parser.h

flex.exe, bison.exe m4.exe . , VS , , - lexer, .

+7

All Articles