[antlr-interest] Newbie: Confusion building C-Target project

Jim Idle jimi at temporal-wave.com
Tue Nov 6 15:02:08 PST 2007


My first question would be why you feel the need to use MingW to be honest
as you can use the Microsoft compiler from the .Net Framework SDK, and your
compilation and linking problems should go away.

That said...

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Jorge Fuente-Alba
Sent: Monday, November 05, 2007 11:45 PM
To: antlr-interest at antlr.org
Subject: [antlr-interest] Newbie: Confusion building C-Target project


> I've talked with the guys about building the parser using cygwin as a 
> library and then using said library under mingw. This puts a few bumps in
> our build process that I'd rather not have. Cygwin forces a unix-like
> environment that we'd rather not use. We're happily using CodeBlocks and
> DevCpp before that, both rely on MinGW and we've never had trouble before.


> My questions are two:
> 1.- Is there a reason why MinGW doesn't like libantlr3c? I read something 
> about differences between MinGW-make and Cygwin-make. Is there a way to 
> get libantlr3c to build under mingw?

You are obviously free to build under MingW, but I won’t be spending any
time making autoconf and so on work under MingW ;-). Why not just make a
straight Makefile for Mingw? Or just build a script? If you configure using
cygwin, then you should get a compilable source set, that while you may need
to configure the generated (by automake) header file for Mingw, should be
fine. There is nothing special about the source coed, you should be able to
just compile all the .c files .to object code, then link the library.

However, MingW is binary compatible with Microsoft libraries is it not? So,
probably your easiest option is to download the .Net Framework SDK and just
namke the C runtime source. This will give you MS binaries, which should
just work with MingW.


2.- if the only way to go is to build from Cygwin and then wrap for MinGW,
can anyone explain why i'm getting undefined references to
'_antlr3AsciiFileStreamNew', '_inifileLexerNew',
'_antlr3CommonTokenStreamSourceNew' and '_inifileParserNew' ? Can anyone
help me with a proper makefile? (I suspect include and lib paths, as I just
did gcc main.c)

This is because cygwin binaries are not binary compatible with Windows. You
won’t get a cygwin built library to link with anything other than other
cygwin libraries. I would just build the proper Microsoft versions then link
these with MingW.

Jim





More information about the antlr-interest mailing list