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

  • SEARCH
  • Home
  • 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 4614332
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:41:04+00:00 2026-05-22T01:41:04+00:00

Some context: My program uses libary libfl.a ( flex library). I compile it under

  • 0

Some context:

  • My program uses libary libfl.a (flex library).
    I compile it under linux:

    gcc lex.yy.c -lfl

  • I have mingw compiler installed i586-mingw32msvc-gcc (simple ‘hello world’ stuff compiles without problem)

  • I use ubuntu (probably does not matter)

  • I want to compile under linux for windows (produce binary .exe file which would be usable on windows)

My problem and questions:

When I try compiling my program

i586-mingw32msvc-gcc lex.yy.c -lfl

I get errors:

[...] undefined reference to '_yywrap' 
[...] undefined reference to '_WinMain@16'
  1. Do I understand correctly that I have to compile the content of libfl.a also with i586-mingw32msvc-gcc to be able to use it in this cross-compilation?
  2. In the source code there is function yywrap(), but not _yywrap(). Why I get error for function with underscore _?
  3. Whats up with the _WinMain@16? (no usage in source code)

My goal would be to understand what is happening here.
If I get it to work, then its bonus points 🙂

Any help is appreciated

  • 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-22T01:41:05+00:00Added an answer on May 22, 2026 at 1:41 am
    1. Yes, certainly. And here’s why:
    2. C++ encodes additional semantic information about functions such as namespace/class affinity, parameter types etc. in the function name (that is called name mangling). Thus C++ library names are somewhat different from what you see in the source code. And each compiler does it in it’s own way, that’s why generally you’re unable to link against C++ functions (C function names don’t get mangled still) of a library built with a different compiler.
    3. Judging to mangling style, the undefined symbols are brought in by the Microsoft C++ compiler. I don’t know exactly about why it needs WinMain, but after you recompile the libs with it, all these errors likely will be gone. And yes: maybe the WinMain() thing rises from msvc using it instead of main(), which presence is obligatory for a well-formed program? 😉
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program which uses an io_service and several threads. It instantiates some
For some unfortunate reasons, I have to convert a proprietary and binary library from
When my cpp file uses #include to add some header, does my final program's
I have a Setup Project which uses a System.Configuration.Install.Installer Class forhandling some custom actions.
I am extracting some functionality from an existing program into a separate library. This
Some context upfront: Imagine a 200+ developers company finally setting up a more or
Some Context From Javascript: The Definitive Guide : When regexp is a global regular
Some context: one of the systems I'm working on is a .net 2.0 web
Title said it all. Some context: I got a search mechanism - search view,
Some code for context: class WordTable { public: WordTable(); ~WordTable(); List* GetListByAlphaKey(char key); void

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.