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 8956239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:44:44+00:00 2026-06-15T14:44:44+00:00

I’m trying to compile a simple ANTLR3 project (built using the C target) in

  • 0

I’m trying to compile a simple ANTLR3 project (built using the C target) in Cygwin. I’ve installed the C runtime library using the standard ./configure, make, make install approach, and the libraries appeared to install successfully (the header files are installed in /cygdrive/e/cygwin/usr/local/include/ and the library file is in /cygdrive/e/cygwin/usr/local/lib/.

When I compile with g++ (I am using c++ for the rest of the project – the C++ target does not have the ability to generate ASTs), the files all compile fine but the linking fails. Using:

g++ -m32 -o compile Main.o Lexer.o Parser.o

gives the error

Main.o:Main.cpp:(.text+0xfc): undefined reference to `_antlr3AsciiFileStreamNew'
Main.o:Main.cpp:(.text+0x12b): undefined reference to `_antlr3CommonTokenStreamSourceNew'
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: Main.o: bad reloc address 0x0 in section `.ctors'
collect2: ld returned 1 exit status

Adding the -lantlr3c flag to the command does not work either, although the error is different:

/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lantlr3c
collect2: ld returned 1 exit status
make: *** [compile] Error 1

Finally, keeping the library file in the local directory and using the `-L.’ flag also doesn’t work:

Main.o:Main.cpp:(.text+0xfc): undefined reference to `_antlr3AsciiFileStreamNew'
Main.o:Main.cpp:(.text+0x12b): undefined reference to `_antlr3CommonTokenStreamSourceNew'
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: Main.o: bad reloc address 0x0 in section `.ctors'
collect2: ld returned 1 exit status

The first command works fine on OSX. Anyone got any ideas? I figure that it might have something to do with Cygwin’s weird file structure/choice of install location but I’m not sure.

  • 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-06-15T14:44:46+00:00Added an answer on June 15, 2026 at 2:44 pm

    I succeeded to build python3grammar (by Ales Teska) under cygwin,
    with C runtime named “libantlr3c-3.4” and gcc-mingw32(ver4.7.0).

    Command:

    gcc -m32 *.c output/*.c -Iinclude -I. -L. -lantlr3c  -o py.exe
    

    For this error message; undefined reference to `_antlr3AsciiFileStreamNew’.

    This article may be helpful:
    http://contrapunctus.net/blog/2012/antlr-c
    This works with ANTLR version 3.2 (debian stable), but I also learned today there are some significant C API changes in the latest, version 3.4. For one, antlr3AsciiFileStreamNew must be replaced with antlr3FileStreamNew(filename, ANTLR3_ENC_8BIT).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm making a simple page using Google Maps API 3. My first. One marker
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am trying to render a haml file in a javascript response like so:
I am doing a simple coin flipping experiment for class that involves flipping 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.