Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3783710
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:15:57+00:00 2026-05-19T11:15:57+00:00

I am using this windows version of flex (lex) and bison (yacc) to port

  • 0

I am using this windows version of flex (lex) and bison (yacc) to port my query compiler from linux to Windows.
The output files, lex.yy.c, y.tab.c and y.tab.h are getting generated properly.
However, I am getting the following link error.

Error 29 error LNK2001: unresolved external symbol _yylval G:\Project\lex.yy.obj QC
Error 30 error LNK1120: 1 unresolved externals G:\Project\QC.exe QC

I tried copying the above files generated by the original linux versions of flex and yacc to Visual studio project folder. But that too gives the same link error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:15:58+00:00Added an answer on May 19, 2026 at 11:15 am

    This could happen because you’re mixing C++ and C files together in one project. So if you’re including y.tab.h into a .cpp file then make sure it has extern "C" { ... } around it. Like this:

    extern "C"
    {
        #include "y.tab.h"
    }
    

    Update: From your comment I understood that y.tab.c is y.tab.cc now. This causes a link time error. This could be fixed by either making both files C++ (or C). Or by changing yylval declaration in y.tab.h to

    #ifdef __cplusplus
    extern "C" YYSTYPE  yylval;
    #endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Microsoft Windows XP [Version 5.1.2600] Trying to do this. Trying to
I am using this code to get the windows version: #define BUFSIZE 256 bool
I have IE9 installed on my Windows 7 machine. Using this version of IE,
I'm using this edit-in-place widget jquery.jeditable.js . On Windows 7, in Chrome (latest version
Using this tutorial: http://www.c-sharpcorner.com/uploadfile/UrmimalaPal/creating-a-windows-phone-7-application-consuming-data-using-a-wcf-service/ I have created sample/hello world application on the windows phone
I am using this text editor for my windows forms application This works great
I have installed Qt for windows CE using this link http://qt.nokia.com/products/platform/qt-for-windows-ce for visual studio8,
I have a Windows 7 machine with Visual Studio 2005 SP1 installed. Using this,
This application is using windows integrated authentication in IIS. No anonymous login. It's also
I am creating a windows application using VB.Net and this application will take a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.