[antlr-interest] Compiling C runtime & linking

Yves Weißig weissig at rbg.informatik.tu-darmstadt.de
Mon Oct 24 08:20:19 PDT 2011


I compile under Windows with VS2010:

U:\libantlr3c-3.4-beta4>DEVENV C.sln /Build Release

Microsoft (R) Visual Studio Version 10.0.30319.1.
Copyright (C) Microsoft Corp. Alle Rechte vorbehalten.
1>------ Erstellen gestartet: Projekt: C, Konfiguration: Release Win32
------
1>Der Buildvorgang wurde am 24.10.2011 12:24:00 gestartet.
1>InitializeBuildStatus:
1>  "Release\C.unsuccessfulbuild" wird erstellt, da "AlwaysCreate"
angegeben wur
de.
1>ClCompile:
1>  antlr3baserecognizer.c
1>  antlr3basetree.c
1>  antlr3basetreeadaptor.c
1>  antlr3bitset.c
1>  antlr3collections.c
1>  antlr3commontoken.c
1>  antlr3commontree.c
1>  antlr3commontreeadaptor.c
1>  antlr3commontreenodestream.c
1>  antlr3convertutf.c
1>  antlr3cyclicdfa.c
1>  antlr3debughandlers.c
1>  antlr3encodings.c
1>  antlr3exception.c
1>  antlr3filestream.c
1>  antlr3inputstream.c
1>  antlr3intstream.c
1>  antlr3lexer.c
1>  antlr3parser.c
1>  antlr3rewritestreams.c
1>  Kompilieren...
1>  antlr3string.c
1>  antlr3tokenstream.c
1>  antlr3treeparser.c
1>Lib:
1>  C.vcxproj -> U:\01. Education\01.
TUD\Master_Thesis_2\techniques\ANTLR\liban
tlr3c-3.4-beta4\Release\antlr3c.lib
1>FinalizeBuildStatus:
1>  Die Datei "Release\C.unsuccessfulbuild" wird gelöscht.
1>  Aktualisieren des Timestamps von "Release\C.lastbuildstate".
1>
1>Das Erstellen war erfolgreich.
1>
1>Verstrichene Zeit 00:00:15.81
========== Erstellen: 1 erfolgreich, Fehler bei 0, 0 aktuell, 0
übersprungen ===
=======

I use runtime "libantlr3c-3.4-beta4", ANTLR "antlr-3.4-complete.jar" and
"antlrworks-1.4.3.jar".

Compiling parser and lexer should be done with MinGW:

d:\Programme\MinGW\bin>g++ --version
g++ (GCC) 3.4.5 (mingw-vista special r3)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

Best regards and thanks for the help...

Yves

Am 24.10.2011 17:12, schrieb Jim Idle:
> You need to send the output of the library build and your session. Here
> you say you are building with VS2010 and trying to compile with GNU C++,
> which makes no sense. What operating system? What compiler? Which version
> of ANTLR?
> 
> Jim
> 
>> -----Original Message-----
>> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
>> bounces at antlr.org] On Behalf Of Yves Weißig
>> Sent: Monday, October 24, 2011 3:35 AM
>> To: antlr-interest at antlr.org
>> Subject: [antlr-interest] Compiling C runtime & linking
>>
>> Hi list,
>> I successfully compiled the C runtime for ANTLR with VS 2010.
>> Now I want to compile the generated code (Lexer and Parser) with this
>> command:
>> g++ -Iantlrinclude -static -L. -lantlr3c RtfLexer.c RtfParser.c
>> as you may notice, antlr.h and all includefiles are in antlrinclude and
>> the antlr3c.lib (copied from the Release dir of VS solution) lies in
>> the current working dir. I would like to include the runtime statically
>> ("-static").
>> But it throws:
>> C:\Users\Yves\AppData\Local\Temp/ccctgQP2.o:RtfLexer.c:(.text+0xb9):
>> undefined reference to `antlr3LexerNewStream'
>> which makes me believe the library is not correctly linked... what is
>> wrong here?
>> Best regards, Yves
>>
>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
>> email-address
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address


More information about the antlr-interest mailing list