Hi, I'm working on a compiler for a small toy language and I'm using the llvm sample project layout, i.e. the llvm make system. I've got one library (lomo-core) which contains my parser and all that stuff and one tool (lomoc) that's my compiler. The tool declares the library as dependency using: USEDLIBS = lomo-core Now that I've started to add IR generation I declared the following dependencies in the library makefile: LINK_COMPONENTS := support system engine This compiles and links the library without problems. But no matter what I do to the makefile of the tool it won't compile. I always get errors in llvm/Support/Annotation.h that look like some type declarations are missing. Unfortunately my experience building C/C++ programs, especially with make, is very limited if not to say non-existent so I'm pretty much clueless and I would very much appreciate any hint on what I'm doing wrong. Both makefiles also change the compiler and linker flags after including the Makefile.common if that's of any relevance: CXXFLAGS += -I/usr/local/include LDFLAGS += -L/usr/local/lib -lantlr3c I'm using llvm 2.5 and building with gcc 3.4.5, gnu make 3.81 on, may the lord forgive me, windows using mingw/msys builds. LLVM itself compiled without problems though so I'm pretty sure it's just me doing something wrong rather than my setup. thanks, Stefan
Hi again, I managed to compile it now, manually was well as with make. I have no idea why it works now, there is no difference. A simple empty program including llvm/Function.h and my antlr parser and lexer worked fine so I tried to find the problem by copying my code piece by piece into a new project but it never showed up. Something else must be messed up with it but I'm sure I will discover the problem now that I have a working project. thanks and sorry for my initial double posting btw. I had a slight confusion with email addresses. Stefan
Hi,> I have no > idea why it works now, there is no difference.the problem was caused by including the ANTLR headers before the LLVM headers. kind regards, Stefan
Whoops, sending it to to llvm list as well, freaking takes another ~70 seconds to do a reply to all instead of a reply to, headers still not following standards of every other list I have ever been on... On Wed, Sep 23, 2009 at 6:34 AM, Stefan Oestreicher <stefan.oestreicher at deluxe-design.at> wrote:> Hi, >> I have no >> idea why it works now, there is no difference. > the problem was caused by including the ANTLR headers before the LLVM > headers.Correct, ANTLR defines a *LOT* of common-name macros for whatever exceedingly idiotic reason. I had a lot of issues with when I was creating my Spirit2.1 and ANTLR benchmark (where Spirit continues to blow ANTLR away in speed, power, expression, and low amount of code to write, no I do not work for Spirit, I was creating benchmarks for every grammar parser I could find, so far nothing bests Spirit in speed and power...).