-
July 7th, 2011, 06:16 PM
#1
Linking error in visual studio C++ 2010
I am using MS visual studio 2010 for building a C project. My project uses flex and bison for parsing purpose. When I build the project there is no error in compiling but error in linking.
Following is the error:
proparse.obj:could not resolved the pro_lex referenced in the function pro_parse
Now,pro_lex is the function defined in the lex file. Lets say pro.lex. I used flex to generate the pro.c .And this function is defined and called as follows:
In prolex.c
#ifndef YY_ABCD
#define YY_ABCD 1
extern int pro_lex (void);
#define YY_ABCD int pro_lex (void)
#endif
YY_ABCD{ /*This is the main function which does all the lexical function
.....
........}
And the yacc file proparse.y generates two file using bison viz proparse.h and proparse.c . The functions pro_lex and pro_parse are defined in the proparse.c as follows.
In proparse.c
#define yyparse pro_parse
#define yylex pro_lex
int yylex(void); /*defined in lex file
.
.
.
pro_parse(); /*parsing function is called.
Could you please let me know what can be the reason for it? I would also like to know if I can set some rules to link certain object files in the IDE. I think it is getting this error
becasue of the inability of linking. I would be glad if you could let me know if I can set some rules so that these two files can link.
Many thanks in advance.
Last edited by __bairagi; July 7th, 2011 at 06:20 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|