Sign in to follow this  
Plasmarobo

Unresolved Externals

Recommended Posts

I seem to be incorrectly linking my files together. Even though I explicitly include the header file, and I clearly define and declare the functions I still get about 50 external functions that are not being linked properly. I am using flex and bison generated code with a setup that is based on the PxdScript tutorial. The generated code is extremely convoluted and long so I am having trouble looking through it for these functions. Actually, I have found the functions, but I don't see anything wrong with it. I'm thinking the problem lies within the differences between C and C++. I know that C code compiles under C++, but is there anything I need to do in order to condition my functions? I'll post my compiler log, but unless someone requests it, I think the files are kind of large.
------ Build started: Project: ASL, Configuration: Debug Win32 ------
Compiling...
language.tab.c
.\language.y(92) : warning C4133: '=' : incompatible types - from 'ITEM *' to 'SCRIPT *'
.\language.y(95) : warning C4133: '=' : incompatible types - from 'MAIN *' to 'ITEM *'
.\language.y(106) : warning C4133: '=' : incompatible types - from 'FUNCTION *' to 'ITEM *'
.\language.y(108) : warning C4133: '=' : incompatible types - from 'FUNCTION *' to 'ITEM *'
Linking...
ASL.obj : error LNK2019: unresolved external symbol "void __cdecl yyparse(void)" (?yyparse@@YAXXZ) referenced in function _main
error.obj : error LNK2001: unresolved external symbol "char * yytext" (?yytext@@3PADA)
language.lex.obj : error LNK2019: unresolved external symbol _yyerror referenced in function _yylex
language.tab.obj : error LNK2001: unresolved external symbol _yyerror
language.lex.obj : error LNK2001: unresolved external symbol _lineno
language.tab.obj : error LNK2019: unresolved external symbol _makeLVALUEid referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPcall referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPlvalue referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPstringconst referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPfloatconst referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPboolconst referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPnumconst referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPcast referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPnot referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPneg referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPand referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPor referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPpow referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPmodulo referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPdiv referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPmult referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPminus referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPplus referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPlequals referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPgequals referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPgreater referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPless referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPnequals referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPequals referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeEXPassignment referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeSTMprint referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeSTMexp referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeSTMdecl referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeSTMscope referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeSTMcontinue referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeSTMbreak referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeSTMwhile referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeSTMifelse referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeSTMif referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeSTMreturn referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeSTMskip referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeSTMsequence referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeDECLarg referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeFUNCTION referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeMAIN referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeIDENTIFIER referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeDECLvar referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeTYPEbool referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeTYPEstring referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeTYPEdeci referenced in function _yyparse
language.tab.obj : error LNK2019: unresolved external symbol _makeTYPEnum referenced in function _yyparse
C:\Documents and Settings\Austen\My Documents\Visual Studio 2008\Projects\ASL\Debug\ASL.exe : fatal error LNK1120: 50 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Austen\My Documents\Visual Studio 2008\Projects\ASL\ASL\Debug\BuildLog.htm"
ASL - 52 error(s), 4 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I really don't understand this. Some build-order issue? I have no idea.

Share this post


Link to post
Share on other sites
Without seeing your code or your lex/yacc files, can't really tell you much.
However, based on the errors, you are probably calling those functions, but have not defined them.

Share this post


Link to post
Share on other sites
Well, I guess it wouldn't be too much to include my lex/yacc files, they are fairly short:

*Content Cut*

Heh, for anyone who cares, C and C++ are not simply compatible, at least not without some help. I changed my file extensions to ".c" and it fixed 90% of my problems, the rest I finagled out.

[Edited by - Plasmarobo on May 13, 2008 8:19:57 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this