'System' is not a namespace-name - c++

I am tying to use some .Net namespaces in my c++ code. From here I have found, how can I do that. In my code I have:
#include <iostream>
using namespace System;
using namespace System::Data;
using namespace System::Data::Sql;
using namespace Microsoft::Sqlserver::Server;
using namespace System::Data::SqlTypes;
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
If I run it I get these errors:
0:08:06: Running steps for project Test...
10:08:06: Configuration unchanged, skipping qmake step.
10:08:06: Starting: "/usr/bin/make"
g++ -c -m64 -pipe -g -Wall -W -DQT_WEBKIT -I/usr/share/qt4/mkspecs/linux-g++-64 -I../Test -I../Test -I. -o main.o ../Test/main.cpp
../Test/main.cpp:2:17: error: 'System' is not a namespace-name
../Test/main.cpp:2:23: error: expected namespace-name before ';' token
../Test/main.cpp:3:17: error: 'System' has not been declared
../Test/main.cpp:3:25: error: 'Data' is not a namespace-name
../Test/main.cpp:3:29: error: expected namespace-name before ';' token
../Test/main.cpp:4:17: error: 'System' has not been declared
../Test/main.cpp:4:31: error: 'Sql' is not a namespace-name
../Test/main.cpp:4:34: error: expected namespace-name before ';' token
../Test/main.cpp:5:17: error: 'Microsoft' has not been declared
../Test/main.cpp:5:39: error: 'Server' is not a namespace-name
../Test/main.cpp:5:45: error: expected namespace-name before ';' token
../Test/main.cpp:6:17: error: 'System' has not been declared
../Test/main.cpp:6:31: error: 'SqlTypes' is not a namespace-name
../Test/main.cpp:6:39: error: expected namespace-name before ';' token
make: *** [main.o] Error 1
10:08:06: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project Test (kit: Desktop)
When executing step 'Make'
10:08:06: Elapsed time: 00:00.
what should I do to solve this problem?
By the way, I have read this and this posts, but I could not understand, what should I do with /clr in my cpp code?

Related

dlib example, test builds fail

Running ubuntu 12.04, I downloaded the source and compiled it as instructed (see https://github.com/davisking/dlib). Below is the error message displayed.
cmake --build . --config Release
[ 1%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bsp/bsp.cpp.o
In file included from /home/andreif/downlib/dlib-19.2/dlib/bsp/../sockets/../threads/parallel_for_extension.h:9:0,
from /home/my_path/dlib-19.2/dlib/bsp/../sockets/../threads.h:24,
from /home/my_path/dlib-19.2/dlib/bsp/../sockets/sockets_kernel_2.h:33,
from /home/my_path/dlib-19.2/dlib/bsp/../sockets/posix.h:4,
from /home/my_path/dlib-19.2/dlib/bsp/../sockets.h:14,
from /home/my_path/dlib-19.2/dlib/bsp/bsp.h:7,
from /home/my_path/dlib-19.2/dlib/bsp/bsp.cpp:6:
/home/my_path/dlib-19.2/dlib/bsp/../sockets/../threads/async.h: In function ‘std::future<typename std::result_of<_Functor(_ArgTypes="" ...)="">::type> dlib::async(dlib::thread_pool&, Function&&, Args&& ...)’:
/home/my_path/dlib-19.2/dlib/bsp/../sockets/../threads/async.h:63:15: error: expected nested-name-specifier before ‘bind_t’
/home/my_path/dlib-19.2/dlib/bsp/../sockets/../threads/async.h:63:15: error: ‘bind_t’ has not been declared
/home/my_path/dlib-19.2/dlib/bsp/../sockets/../threads/async.h:63:22: error: expected ‘;’ before ‘=’ token
/home/my_path/dlib-19.2/dlib/bsp/../sockets/../threads/async.h:63:22: error: expected primary-expression before ‘=’ token
/home/my_path/dlib-19.2/dlib/bsp/../sockets/../threads/async.h:63:24: error: expected primary-expression before ‘decltype’
/home/my_path/dlib-19.2/dlib/bsp/../sockets/../threads/async.h:63:24: error: expected ‘;’ before ‘decltype’
/home/my_path/dlib-19.2/dlib/bsp/../sockets/../threads/async.h:64:37: error: ‘bind_t’ was not declared in this scope
make[2]: [dlib_build/CMakeFiles/dlib.dir/bsp/bsp.cpp.o] Error 1
make[1]: [dlib_build/CMakeFiles/dlib.dir/all] Error 2
make: *** [all] Error 2
The problem was my c++ compiler: the default gcc 4.6 in ubuntu 12.04 has c++11 support, but it has to be enabled at the command line when calling it. I tried editing /.bashrc to automatically do this, but it didn't work. The solution for me was to install gcc/g++ 4.8 (and use update-alternatives to keep the old installation usable), as described here
http://mortenvp.com/installing-a-newer-gccg-on-ubuntu-12-04-lts/

c++ compiles in Ubuntu but not in centOS

I have a bunch of code which compiles in Ubuntu using GCC 4.8.4.
When I transfer to centOS and compile it there the following errors occur:
[ 0%] Building CXX object src/chrono/CMakeFiles/ChronoEngine.dir/core/ChClassRegister.cpp.o
In file included from /home/com/medyn/chrono/chrono_ver1/Chrono_source_Old/src/chrono/core/ChClassRegister.cpp:21:
/home/com/medyn/chrono/chrono_ver1/Chrono_source_Old/src/chrono/core/ChClassRegister.h: In destructor 'chrono::ChClassFactory::~ChClassFactory()':
/home/com/medyn/chrono/chrono_ver1/Chrono_source_Old/src/chrono/core/ChClassRegister.h:225: error: expected initializer before ':' token
/home/com/medyn/chrono/chrono_ver1/Chrono_source_Old/src/chrono/core/ChClassRegister.h:228: error: could not convert '((chrono::ChLog*)chrono::GetLog())->chrono::ChLog::<anonymous>.chrono::ChStreamOutAscii::operator<<(((const char*)"Delete ChClassFactory \012"))' to 'bool'
/home/com/medyn/chrono/chrono_ver1/Chrono_source_Old/src/chrono/core/ChClassRegister.h:229: error: expected primary-expression before '}' token
/home/com/medyn/chrono/chrono_ver1/Chrono_source_Old/src/chrono/core/ChClassRegister.h:229: error: expected ')' before '}' token
/home/com/medyn/chrono/chrono_ver1/Chrono_source_Old/src/chrono/core/ChClassRegister.h:229: error: expected primary-expression before '}' token
/home/com/medyn/chrono/chrono_ver1/Chrono_source_Old/src/chrono/core/ChClassRegister.h:229: error: expected ';' before '}' token
make[2]: *** [src/chrono/CMakeFiles/ChronoEngine.dir/core/ChClassRegister.cpp.o] Error 1
make[1]: *** [src/chrono/CMakeFiles/ChronoEngine.dir/all] Error 2
make: *** [all] Error 2
These errors are for both GCC 4.4.7 and GCC 4.8.5.
The lines of code for which it gives the error are:
~ChClassFactory () {
for(const auto & it : class_map ) {
GetLog() << " registered: " << it.first << "\n";
}
GetLog() << "Delete ChClassFactory \n";
}
And the files included at the top of this script are:
#include <stdio.h>
#include <string>
#include <typeinfo>
#include "core/ChLog.h"
#include "core/ChRunTimeType.h"
#include <unordered_map>
I have checked that all of the include files exists and I have made another script to test if I can use them, and I can.
The reason why I don't stay with Ubuntu is because the Supercomputer I have to use is running centOS.
Does anyone have a solution for this problem?
Please let my know if you need additional information.
Regards,
Anders
Edit
With the GCC 4.8.5 version the program provided by NathanOliver compiles and run.
I compile it directly from terminal using:
g++ -std=c++11 main.cpp -o main
./main
1 2 3 4 5
And it runs with -std=c++0x.
Somehow I cant use -std=c++14.
It gives the following error:
g++: error: unrecognized command line option '-std=c++14'
Edit
So to get back to the main problem. My Makefile I have, have the following line:
//Flags used by the compiler during all build types.
CMAKE_CXX_FLAGS:STRING=-std=c++0x
So I can't see why the program should not run?

Installing red carpet -v '3.3.3'

I currently have Redcarpet 3.1.2, using OS X El Capitan 10.11.2
I am trying to run 'bundle exec jekyll serve' but it seems that I had to run a bundle install. This is where the install errors-out
Installing redcarpet 3.3.3 (was 3.3.2) with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/TLuu/Documents/Sides/theresaluu.github.io/vendor/bundle/gems/redcarpet-3.3.3/ext/redcarpet
/Users/TLuu/.rbenv/versions/2.0.0-p247/bin/ruby -r ./siteconf20160101-37132-138gbyg.rb extconf.rb
creating Makefile
current directory: /Users/TLuu/Documents/Sides/theresaluu.github.io/vendor/bundle/gems/redcarpet-3.3.3/ext/redcarpet
make "DESTDIR=" clean
current directory: /Users/TLuu/Documents/Sides/theresaluu.github.io/vendor/bundle/gems/redcarpet-3.3.3/ext/redcarpet
make "DESTDIR="
compiling autolink.c
couldn't understand kern.osversion `15.2.0'
In file included from autolink.c:23:
buffer.h:29:20: error: stdint.h: No such file or directory
In file included from autolink.c:23:
buffer.h:47: error: expected specifier-qualifier-list before ‘uint8_t’
In file included from autolink.c:24:
autolink.h:37: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
autolink.h:41: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.h:45: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.h:49: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.c:26:20: error: string.h: No such file or directory
autolink.c:27:20: error: stdlib.h: No such file or directory
autolink.c:28:19: error: stdio.h: No such file or directory
autolink.c:29:19: error: ctype.h: No such file or directory
autolink.c:36: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
autolink.c:58: error: expected ‘)’ before ‘*’ token
autolink.c:142: error: expected ‘)’ before ‘*’ token
autolink.c:171: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.c: In function ‘sd_autolink__www’:
autolink.c:178: error: ‘data’ undeclared (first use in this function)
autolink.c:178: error: (Each undeclared identifier is reported only once
autolink.c:178: error: for each function it appears in.)
autolink.c:181: warning: incompatible implicit declaration of built-in function ‘strlen’
autolink.c: At top level:
autolink.c:207: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.c: In function ‘sd_autolink__email’:
autolink.c:216: error: ‘uint8_t’ undeclared (first use in this function)
autolink.c:216: error: expected ‘;’ before ‘c’
autolink.c:218: error: ‘c’ undeclared (first use in this function)
autolink.c:221: warning: incompatible implicit declaration of built-in function ‘strchr’
autolink.c:231: error: expected ‘;’ before ‘c’
autolink.c:247: error: ‘data’ undeclared (first use in this function)
autolink.c: At top level:
autolink.c:262: error: expected declaration specifiers or ‘...’ before ‘uint8_t’
autolink.c: In function ‘sd_autolink__url’:
autolink.c:269: error: ‘data’ undeclared (first use in this function)
autolink.c:278: warning: incompatible implicit declaration of built-in function ‘strlen’
make: *** [autolink.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/TLuu/Documents/Sides/theresaluu.github.io/vendor/bundle/gems/redcarpet-3.3.3 for inspection.
Results logged to /Users/TLuu/Documents/Sides/theresaluu.github.io/vendor/bundle/extensions/x86_64-darwin-12/2.0.0-static/redcarpet-3.3.3/gem_make.out
An error occurred while installing redcarpet (3.3.3), and Bundler cannot continue.
Make sure that `gem install redcarpet -v '3.3.3'` succeeds before bundling.
I suspect that this is a problem the arose from the last OS X update (Dec 15, 2015).

MySQL Connect/C++ 64 bit build error

I am using Netbeans and MacoSX and installed 64bit connector. On building I am getting following errors:
/usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
/usr/bin/make -f nbproject/Makefile-Debug.mk dist/Debug/GNU-MacOSX/inventory
mkdir -p build/Debug/GNU-MacOSX
rm -f build/Debug/GNU-MacOSX/addproduct.o.d
g++ -c -g -Iinclude -Iinclude -MMD -MP -MF build/Debug/GNU-MacOSX/addproduct.o.d -o build/Debug/GNU-MacOSX/addproduct.o addproduct.cpp
from addproduct.cpp:10:
In file included from include/mysql_connection.h:30,
include/cppconn/connection.h:31:29: warning: boost/variant.hpp: No such file or directory
In file included from addproduct.cpp:10:
include/mysql_connection.h:31:32: warning: boost/shared_ptr.hpp: No such file or directory
from addproduct.cpp:10:
In file included from include/mysql_connection.h:30,
include/cppconn/connection.h:41: error: 'boost' has not been declared
include/cppconn/connection.h:41: error: expected initializer before '<' token
include/cppconn/connection.h:43: error: 'ConnectPropertyVal' was not declared in this scope
include/cppconn/connection.h:43: error: template argument 2 is invalid
include/cppconn/connection.h:43: error: template argument 4 is invalid
include/cppconn/connection.h:43: error: invalid type in declaration before ';' token
In file included from addproduct.cpp:10:
include/mysql_connection.h:75: error: 'ConnectPropertyVal' is not a member of 'sql'
include/mysql_connection.h:75: error: 'ConnectPropertyVal' is not a member of 'sql'
include/mysql_connection.h:75: error: template argument 2 is invalid
include/mysql_connection.h:75: error: template argument 4 is invalid
include/mysql_connection.h:157: error: 'ConnectPropertyVal' is not a member of 'sql'
include/mysql_connection.h:157: error: 'ConnectPropertyVal' is not a member of 'sql'
include/mysql_connection.h:157: error: template argument 2 is invalid
include/mysql_connection.h:157: error: template argument 4 is invalid
include/mysql_connection.h:160: error: 'boost' has not been declared
include/mysql_connection.h:160: error: ISO C++ forbids declaration of 'shared_ptr' with no type
include/mysql_connection.h:160: error: expected ';' before '<' token
make[2]: *** [build/Debug/GNU-MacOSX/addproduct.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 538ms)
In Netbeans I am linking libmysqlcppconn.dylib only.
What files am I missing?
Why is it asking for BOOST? and which Boost Libs do I need to install?
mysql_connection.h includes #include <boost/shared_ptr.hpp>, you could either use latest versions of boost or modify below lines mysql_connection.h to use std::shared_ptr instead:
update
#include <boost/shared_ptr.hpp>
boost::shared_ptr< NativeAPI::NativeConnectionWrapper > proxy;
to
#include <memory>
std::shared_ptr< NativeAPI::NativeConnectionWrapper > proxy;
Have you read the documentation entitled "21.4.2. Installing MySQL Connector/C++ from Source"? Read the entire page carefully, then look for links specific to MacOSX...

Errors When Compiling C++ Application (Apache Thrift)

I'm wanting to do some developing with the C++ program, Apache Thrift, where I will be changing some of the source code and trying to contribute some code to the open source community. To do this, I need to be able to build and install Apache Thrift from source, but I'm getting some errors when I'm trying to build it.
I've searched on Google, but I can't find any answers that fix the problem I've been having. I'm running OSX Mountain Lion 10.8.2 and I think I've installed all of the requirements listed at http://thrift.apache.org/docs/install/.
I think the real problem is when I run make (scroll down if you want to see that info now), but just in case, I'm going to mention everything.
When I run ./bootstrap.sh in the thrift folder as instructed at http://thrift.apache.org/docs/BuildingFromSource/, I get a few warnings at the top of the output, but I don't think if they are a problem as I've seen them in "successful builds." Here are the warnings:
configure.in:3: warning: prefer named diversions
configure.in:3: warning: prefer named diversions
configure.ac: warning: missing AC_CHECK_HEADERS([wchar.h]) wanted by: lib/py/compat/win32/stdint.h:52
If it's needed, here is the entire output of the ./bootstrap.sh command:
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
configure.in:3: warning: prefer named diversions
configure.in:3: warning: prefer named diversions
configure.ac: warning: missing AC_CHECK_HEADERS([wchar.h]) wanted by: lib/py/compat/win32/stdint.h:52
configure.ac:103: installing './config.guess'
configure.ac:103: installing './config.sub'
configure.ac:26: installing './install-sh'
configure.ac:26: installing './missing'
compiler/cpp/Makefile.am: installing './depcomp'
configure.ac: installing './ylwrap'
lib/cpp/test/Makefile.am:178: warning: variable 'concurrency_test_SOURCES' is defined but no program or
lib/cpp/test/Makefile.am:178: library has 'concurrency_test' as canonical name (possible typo)
lib/cpp/test/Makefile.am:187: warning: variable 'processor_test_SOURCES' is defined but no program or
lib/cpp/test/Makefile.am:187: library has 'processor_test' as canonical name (possible typo)
lib/cpp/test/Makefile.am:195: warning: variable 'processor_test_LDADD' is defined but no program or
lib/cpp/test/Makefile.am:195: library has 'processor_test' as canonical name (possible typo)
lib/cpp/test/Makefile.am:184: warning: variable 'concurrency_test_LDADD' is defined but no program or
lib/cpp/test/Makefile.am:184: library has 'concurrency_test' as canonical name (possible typo)
Next, I run ./configure which seems to work successfully. When I tried to put the output in my post, I ran out of characters, so in case it's needed, I put the entire output into a Google Doc.
Next I try running make which logs a bunch of errors. I think the culprit is probably this first error:
thriftl.ll:51:21: error: thrifty.h: No such file or directory
I don't know how to fix that error though. Just in case, here is the entire output of the make command:
make all-recursive
Making all in compiler/cpp
make all-am
\
\
/bin/sh ../../ylwrap `test -f 'src/thrifty.yy' || echo './'`src/thrifty.yy y.tab.c thrifty.cc y.tab.h `echo thrifty.cc | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/` y.output thrifty.output -- bison -y -d
thrifty.hh is unchanged
g++ -DHAVE_CONFIG_H -I. -I../.. -I./src -Wall -Wno-sign-compare -Wno-unused -g -O2 -MT libparse_a-thrifty.o -MD -MP -MF .deps/libparse_a-thrifty.Tpo -c -o libparse_a-thrifty.o `test -f 'thrifty.cc' || echo './'`thrifty.cc
mv -f .deps/libparse_a-thrifty.Tpo .deps/libparse_a-thrifty.Po
\
\
/bin/sh ../../ylwrap `test -f 'src/thriftl.ll' || echo './'`src/thriftl.ll lex.yy.c thriftl.cc -- flex
g++ -DHAVE_CONFIG_H -I. -I../.. -I./src -Wall -Wno-sign-compare -Wno-unused -g -O2 -MT libparse_a-thriftl.o -MD -MP -MF .deps/libparse_a-thriftl.Tpo -c -o libparse_a-thriftl.o `test -f 'thriftl.cc' || echo './'`thriftl.cc
thriftl.ll:51:21: error: thrifty.h: No such file or directory
thriftl.ll: In function ‘int yylex()’:
thriftl.ll:114: error: ‘yylval’ was not declared in this scope
thriftl.ll:114: error: ‘tok_int_constant’ was not declared in this scope
thriftl.ll:115: error: ‘yylval’ was not declared in this scope
thriftl.ll:115: error: ‘tok_int_constant’ was not declared in this scope
thriftl.ll:117: error: ‘tok_namespace’ was not declared in this scope
thriftl.ll:118: error: ‘tok_cpp_namespace’ was not declared in this scope
thriftl.ll:119: error: ‘tok_cpp_include’ was not declared in this scope
thriftl.ll:120: error: ‘tok_cpp_type’ was not declared in this scope
thriftl.ll:121: error: ‘tok_java_package’ was not declared in this scope
thriftl.ll:122: error: ‘tok_cocoa_prefix’ was not declared in this scope
thriftl.ll:123: error: ‘tok_csharp_namespace’ was not declared in this scope
thriftl.ll:124: error: ‘tok_delphi_namespace’ was not declared in this scope
thriftl.ll:125: error: ‘tok_php_namespace’ was not declared in this scope
thriftl.ll:126: error: ‘tok_py_module’ was not declared in this scope
thriftl.ll:127: error: ‘tok_perl_package’ was not declared in this scope
thriftl.ll:128: error: ‘tok_ruby_namespace’ was not declared in this scope
thriftl.ll:129: error: ‘tok_smalltalk_category’ was not declared in this scope
thriftl.ll:130: error: ‘tok_smalltalk_prefix’ was not declared in this scope
thriftl.ll:131: error: ‘tok_xsd_all’ was not declared in this scope
thriftl.ll:132: error: ‘tok_xsd_optional’ was not declared in this scope
thriftl.ll:133: error: ‘tok_xsd_nillable’ was not declared in this scope
thriftl.ll:134: error: ‘tok_xsd_namespace’ was not declared in this scope
thriftl.ll:135: error: ‘tok_xsd_attrs’ was not declared in this scope
thriftl.ll:136: error: ‘tok_include’ was not declared in this scope
thriftl.ll:137: error: ‘tok_void’ was not declared in this scope
thriftl.ll:138: error: ‘tok_bool’ was not declared in this scope
thriftl.ll:139: error: ‘tok_byte’ was not declared in this scope
thriftl.ll:140: error: ‘tok_i16’ was not declared in this scope
thriftl.ll:141: error: ‘tok_i32’ was not declared in this scope
thriftl.ll:142: error: ‘tok_i64’ was not declared in this scope
thriftl.ll:143: error: ‘tok_double’ was not declared in this scope
thriftl.ll:144: error: ‘tok_string’ was not declared in this scope
thriftl.ll:145: error: ‘tok_binary’ was not declared in this scope
thriftl.ll:146: error: ‘tok_slist’ was not declared in this scope
thriftl.ll:147: error: ‘tok_senum’ was not declared in this scope
thriftl.ll:148: error: ‘tok_map’ was not declared in this scope
thriftl.ll:149: error: ‘tok_list’ was not declared in this scope
thriftl.ll:150: error: ‘tok_set’ was not declared in this scope
thriftl.ll:151: error: ‘tok_oneway’ was not declared in this scope
thriftl.ll:152: error: ‘tok_typedef’ was not declared in this scope
thriftl.ll:153: error: ‘tok_struct’ was not declared in this scope
thriftl.ll:154: error: ‘tok_union’ was not declared in this scope
thriftl.ll:155: error: ‘tok_xception’ was not declared in this scope
thriftl.ll:156: error: ‘tok_extends’ was not declared in this scope
thriftl.ll:157: error: ‘tok_throws’ was not declared in this scope
thriftl.ll:158: error: ‘tok_service’ was not declared in this scope
thriftl.ll:159: error: ‘tok_enum’ was not declared in this scope
thriftl.ll:160: error: ‘tok_const’ was not declared in this scope
thriftl.ll:161: error: ‘tok_required’ was not declared in this scope
thriftl.ll:162: error: ‘tok_optional’ was not declared in this scope
thriftl.ll:165: error: ‘tok_oneway’ was not declared in this scope
thriftl.ll:275: error: ‘yylval’ was not declared in this scope
thriftl.ll:279: error: ‘tok_int_constant’ was not declared in this scope
thriftl.ll:284: error: ‘yylval’ was not declared in this scope
thriftl.ll:288: error: ‘tok_int_constant’ was not declared in this scope
thriftl.ll:292: error: ‘yylval’ was not declared in this scope
thriftl.ll:293: error: ‘tok_dub_constant’ was not declared in this scope
thriftl.ll:297: error: ‘yylval’ was not declared in this scope
thriftl.ll:298: error: ‘tok_identifier’ was not declared in this scope
thriftl.ll:302: error: ‘yylval’ was not declared in this scope
thriftl.ll:303: error: ‘tok_st_identifier’ was not declared in this scope
thriftl.ll:347: error: ‘yylval’ was not declared in this scope
thriftl.ll:348: error: ‘tok_literal’ was not declared in this scope
make[3]: *** [libparse_a-thriftl.o] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
And, although I doubt it's needed since I think the error is in make, one last output -- sudo make install:
Making install in compiler/cpp
make install-am
g++ -DHAVE_CONFIG_H -I. -I../.. -I./src -Wall -Wno-sign-compare -Wno-unused -g -O2 -MT libparse_a-thriftl.o -MD -MP -MF .deps/libparse_a-thriftl.Tpo -c -o libparse_a-thriftl.o `test -f 'thriftl.cc' || echo './'`thriftl.cc
thriftl.ll:51:21: error: thrifty.h: No such file or directory
thriftl.ll: In function ‘int yylex()’:
thriftl.ll:114: error: ‘yylval’ was not declared in this scope
thriftl.ll:114: error: ‘tok_int_constant’ was not declared in this scope
thriftl.ll:115: error: ‘yylval’ was not declared in this scope
thriftl.ll:115: error: ‘tok_int_constant’ was not declared in this scope
thriftl.ll:117: error: ‘tok_namespace’ was not declared in this scope
thriftl.ll:118: error: ‘tok_cpp_namespace’ was not declared in this scope
thriftl.ll:119: error: ‘tok_cpp_include’ was not declared in this scope
thriftl.ll:120: error: ‘tok_cpp_type’ was not declared in this scope
thriftl.ll:121: error: ‘tok_java_package’ was not declared in this scope
thriftl.ll:122: error: ‘tok_cocoa_prefix’ was not declared in this scope
thriftl.ll:123: error: ‘tok_csharp_namespace’ was not declared in this scope
thriftl.ll:124: error: ‘tok_delphi_namespace’ was not declared in this scope
thriftl.ll:125: error: ‘tok_php_namespace’ was not declared in this scope
thriftl.ll:126: error: ‘tok_py_module’ was not declared in this scope
thriftl.ll:127: error: ‘tok_perl_package’ was not declared in this scope
thriftl.ll:128: error: ‘tok_ruby_namespace’ was not declared in this scope
thriftl.ll:129: error: ‘tok_smalltalk_category’ was not declared in this scope
thriftl.ll:130: error: ‘tok_smalltalk_prefix’ was not declared in this scope
thriftl.ll:131: error: ‘tok_xsd_all’ was not declared in this scope
thriftl.ll:132: error: ‘tok_xsd_optional’ was not declared in this scope
thriftl.ll:133: error: ‘tok_xsd_nillable’ was not declared in this scope
thriftl.ll:134: error: ‘tok_xsd_namespace’ was not declared in this scope
thriftl.ll:135: error: ‘tok_xsd_attrs’ was not declared in this scope
thriftl.ll:136: error: ‘tok_include’ was not declared in this scope
thriftl.ll:137: error: ‘tok_void’ was not declared in this scope
thriftl.ll:138: error: ‘tok_bool’ was not declared in this scope
thriftl.ll:139: error: ‘tok_byte’ was not declared in this scope
thriftl.ll:140: error: ‘tok_i16’ was not declared in this scope
thriftl.ll:141: error: ‘tok_i32’ was not declared in this scope
thriftl.ll:142: error: ‘tok_i64’ was not declared in this scope
thriftl.ll:143: error: ‘tok_double’ was not declared in this scope
thriftl.ll:144: error: ‘tok_string’ was not declared in this scope
thriftl.ll:145: error: ‘tok_binary’ was not declared in this scope
thriftl.ll:146: error: ‘tok_slist’ was not declared in this scope
thriftl.ll:147: error: ‘tok_senum’ was not declared in this scope
thriftl.ll:148: error: ‘tok_map’ was not declared in this scope
thriftl.ll:149: error: ‘tok_list’ was not declared in this scope
thriftl.ll:150: error: ‘tok_set’ was not declared in this scope
thriftl.ll:151: error: ‘tok_oneway’ was not declared in this scope
thriftl.ll:152: error: ‘tok_typedef’ was not declared in this scope
thriftl.ll:153: error: ‘tok_struct’ was not declared in this scope
thriftl.ll:154: error: ‘tok_union’ was not declared in this scope
thriftl.ll:155: error: ‘tok_xception’ was not declared in this scope
thriftl.ll:156: error: ‘tok_extends’ was not declared in this scope
thriftl.ll:157: error: ‘tok_throws’ was not declared in this scope
thriftl.ll:158: error: ‘tok_service’ was not declared in this scope
thriftl.ll:159: error: ‘tok_enum’ was not declared in this scope
thriftl.ll:160: error: ‘tok_const’ was not declared in this scope
thriftl.ll:161: error: ‘tok_required’ was not declared in this scope
thriftl.ll:162: error: ‘tok_optional’ was not declared in this scope
thriftl.ll:165: error: ‘tok_oneway’ was not declared in this scope
thriftl.ll:275: error: ‘yylval’ was not declared in this scope
thriftl.ll:279: error: ‘tok_int_constant’ was not declared in this scope
thriftl.ll:284: error: ‘yylval’ was not declared in this scope
thriftl.ll:288: error: ‘tok_int_constant’ was not declared in this scope
thriftl.ll:292: error: ‘yylval’ was not declared in this scope
thriftl.ll:293: error: ‘tok_dub_constant’ was not declared in this scope
thriftl.ll:297: error: ‘yylval’ was not declared in this scope
thriftl.ll:298: error: ‘tok_identifier’ was not declared in this scope
thriftl.ll:302: error: ‘yylval’ was not declared in this scope
thriftl.ll:303: error: ‘tok_st_identifier’ was not declared in this scope
thriftl.ll:347: error: ‘yylval’ was not declared in this scope
thriftl.ll:348: error: ‘tok_literal’ was not declared in this scope
make[2]: *** [libparse_a-thriftl.o] Error 1
make[1]: *** [install] Error 2
make: *** [install-recursive] Error 1
I've tried Googling many of these errors, but I'm not skilled in C++, and I can't find any help.
What do I need to do to fix these errors?
I believe your'e experiencing the bug described here: https://issues.apache.org/jira/browse/THRIFT-1614.
You probably have automake-1.12 (which is what you'd get with brew install automake), which creates a thrifty.hh file rather than the included thrifty.h. The workaround given in the bug-report is to manually change the include in thriftl.cc to be thrifty.hh. You can also try downgrading automake, if you're using brew this should help.
This problem occurs because automake generates the file "thrifty.hh" rather than "thrifty.h". So there are 2 ways to resolve this problem.
1) Downgrade automake to 1.11.5, then it's fixed;
2) Edit the file "thriftl.cc", search and replace "thrifty.h" with "thrifty.hh", then compile it again.