Giter Club home page Giter Club logo

antlr-4.7-cpp-cmake-base's Introduction

antlr-4.7-cpp-cmake-base

A base repository for a project taht includes antlr4's C++ target as an external dependency

antlr-4.7-cpp-cmake-base's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

antlr-4.7-cpp-cmake-base's Issues

${antlr4cpp_src_files_antlrcpptest} is empty on build

Hello,

Because of some subtleties of CMake, it looks like this variable is actually not set when

add_executable(test_antlr main.cpp ${antlr4cpp_src_files_antlrcpptest}) is called. I think this is due to the fact that this variable is set at build time.

As a result, the linker will not be able to resolve references to TParser, etc. This can be seen with the following main.cpp:

#include <iostream>
#include <antlr4-runtime.h>
#include "TParser.h"

int main() {
  std::cout << "Hello World" << std::endl;
  antlrcpptest::TParser tp(nullptr);
  return 0;
}
CMakeFiles/test_antlr.dir/main.cpp.o: In function `main':
main.cpp:(.text+0x53): undefined reference to `antlrcpptest::TParser::TParser(antlr4::TokenStream*)'
main.cpp:(.text+0x67): undefined reference to `antlrcpptest::TParser::~TParser()'

This seems to only be the case on a fresh build i.e. one where cmake .. has only been done once. The next time cmake is run this variable will be populated, and the build will succeed.

OSX Build fails

ON os I have downloaded the git repository the make. command goes well but man give this error:

Scanning dependencies of target antlr4cpp
[ 10%] Creating directories for 'antlr4cpp'
[ 20%] Performing download step (verify and extract) for 'antlr4cpp'
-- antlr4cpp download command succeeded.  See also /Users/bisegni/sources/greeshift/antlr-4.7-cpp-cmake-base/locals/antlr4cpp/src/antlr4cpp-stamp/antlr4cpp-download-*.log
[ 30%] No patch step for 'antlr4cpp'
[ 40%] No update step for 'antlr4cpp'
[ 50%] Performing configure step for 'antlr4cpp'
-- antlr4cpp configure command succeeded.  See also /Users/bisegni/sources/greeshift/antlr-4.7-cpp-cmake-base/locals/antlr4cpp/src/antlr4cpp-stamp/antlr4cpp-configure-*.log
[ 60%] Performing build step for 'antlr4cpp'
CMake Error at /Users/bisegni/sources/greeshift/antlr-4.7-cpp-cmake-base/locals/antlr4cpp/src/antlr4cpp-stamp/antlr4cpp-build-.cmake:49 (message):
  Command failed: 2

   '/Library/Developer/CommandLineTools/usr/bin/make'

  See also

    /Users/bisegni/sources/greeshift/antlr-4.7-cpp-cmake-base/locals/antlr4cpp/src/antlr4cpp-stamp/antlr4cpp-build-*.log


make[2]: *** [locals/antlr4cpp/src/antlr4cpp-stamp/antlr4cpp-build] Error 1
make[1]: *** [CMakeFiles/antlr4cpp.dir/all] Error 2
make: *** [all] Error 2

the error in log file is:

==> /Users/bisegni/sources/greeshift/antlr-4.7-cpp-cmake-base/locals/antlr4cpp/src/antlr4cpp-stamp/antlr4cpp-build-err.log <==
make[3]: *** No targets specified and no makefile found. Stop.

==> /Users/bisegni/sources/greeshift/antlr-4.7-cpp-cmake-base/locals/antlr4cpp/src/antlr4cpp-stamp/antlr4cpp-build-out.log <==

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.