Errors When Compiling C++ Application (Apache Thrift) - c++

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.

Related

Error building openCV - dumpOpenCLDevice() method error

I have been trying to build opencv for over a week now using the instructions at
http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html and http://miloq.blogspot.com/2012/12/install-opencv-ubuntu-linux.html however every time I get to the 'make' step, I get an error:
In file included from /home/sello/opencv-2.4.9/modules/nonfree/perf/perf_main.cpp:28:0:
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp: In function ‘void dumpOpenCLDevice()’:
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:88:9: error: ‘PlatformsInfo’ is not a member of ‘cv::ocl’
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:88:32: error: expected ‘;’ before ‘platforms’
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:89:9: error: ‘getOpenCLPlatforms’ is not a member of ‘cv::ocl’
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:89:37: error: ‘platforms’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:95:19: error: ‘DevicesInfo’ in namespace ‘cv::ocl’ does not name a type
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:96:39: error: ‘devices’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:98:23: error: ‘DeviceInfo’ in namespace ‘cv::ocl’ does not name a type
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:99:33: error: ‘current_device’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:99:62: error: ‘CVCL_DEVICE_TYPE_CPU’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:100:71: error: ‘CVCL_DEVICE_TYPE_GPU’ was not declared in this scope
In file included from /home/sello/opencv-2.4.9/modules/nonfree/perf/perf_main.cpp:28:0:
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:108:15: error: ‘DeviceInfo’ in namespace ‘cv::ocl’ does not name a type
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:110:9: error: ‘deviceInfo’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:111:9: error: ‘deviceInfo’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:113:25: error: ‘deviceInfo’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:113:50: error: ‘CVCL_DEVICE_TYPE_CPU’ was not declared in this scope
/home/sello/opencv-2.4.9/modules/ocl/include/opencv2/ocl/private/opencl_dumpinfo.hpp:114:61: error: ‘CVCL_DEVICE_TYPE_GPU’ was not declared in this scope
make[2]: *** [modules/nonfree/CMakeFiles/opencv_perf_nonfree.dir/perf/perf_main.cpp.o] Error 1
make[1]: *** [modules/nonfree/CMakeFiles/opencv_perf_nonfree.dir/all] Error 2
make: *** [all] Error 2
The process works well for a while and then stops at 79% with the above error. I thought the problem might be caused by the fact that I did not have the OpenCL library installed. I installed it as shown at www.amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/07/AMD_APP_SDK_Installation_Notes.pdf and still no luck. I am running ubuntu 12.04 and OpenCV 2.4.9. The installed version of AMD APP SDK is 2.8.1.0. Please help. I am at my wits end here.
I experienced the same problem and solved it for me by compiling OpenCV without modules needing GPU functionality using the following cmake command in the release folder:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_OPENCL=OFF -D WITH_CUDA=OFF -D BUILD_opencv_gpu=OFF -D BUILD_opencv_nonfree=OFF -D BUILD_opencv_stitching=OFF -D BUILD_opencv_superres=OFF ..
The following modules are then deactivated: gpu, nonfree, stitching, superres

How can I understand these dreadful errors when building gcc-4.8.2?

I am trying to install the gcc-4.8.2 compiler on a remote Debian 7 system, to which I have no root privileges, but only a ssh access. I figured out that the simplest way would be to compile the compiler from source.
I am following this short installation manual from the GCC webpage.
Basically I did the most simple installation, which is summarized at the bottom of the page:
tar xzf gcc-4.8.2.tar.gz
cd gcc-4.8.2
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.8.2/configure --prefix=$HOME/gcc-4.8.2 --enable-languages=c++
make
with the small exception that I did not run the ./contrib/download_prerequisites script on the remote machine because of firewall restrictions. Instead I ran it on my local machine, then compressed the entire folder back into gcc-4.8.2.tar.gz and scp'd it to the remote machine. There I re-created the symbolic links to the prerequisite libraries (gmp,...) and ran make. After several seconds I receive incredible errors:
In file included from ./tm.h:19:0,
from ../../gcc-4.8.2/gcc/c/c-lang.c:24:
./options.h:4078:2: error: #error too many masks for ix86_isa_flags
In file included from ../../gcc-4.8.2/gcc/tree.h:26:0,
from ../../gcc-4.8.2/gcc/c/c-lang.c:25:
../../gcc-4.8.2/gcc/statistics.h:25:2: error: #error GATHER_STATISTICS must be defined
In file included from ../../gcc-4.8.2/gcc/system.h:268:0,
from ../../gcc-4.8.2/gcc/c/c-lang.c:22:
../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if
../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if
../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if
../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if
../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if
../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if
../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if
../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if
../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if
../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if
../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if
../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if
In file included from ../../gcc-4.8.2/gcc/tree.h:29:0,
from ../../gcc-4.8.2/gcc/c/c-lang.c:25:
../../gcc-4.8.2/gcc/real.h:103:9: error: #error "REAL_WIDTH > 6 not supported"
In file included from ../../gcc-4.8.2/gcc/c-family/c-common.h:24:0,
from ../../gcc-4.8.2/gcc/c/c-tree.h:23,
from ../../gcc-4.8.2/gcc/c/c-lang.c:26:
../../gcc-4.8.2/gcc/../libcpp/include/cpplib.h:265:3: error: #error "Cannot find a least-32-bit signed integer type"
In file included from ../../gcc-4.8.2/gcc/c/c-lang.c:22:0:
../../gcc-4.8.2/gcc/system.h:500:34: error: declaration of C function ‘const char* strsignal(int)’ conflicts with
In file included from /usr/include/c++/4.7/cstring:44:0,
from ../../gcc-4.8.2/gcc/system.h:205,
from ../../gcc-4.8.2/gcc/c/c-lang.c:22:
/usr/include/string.h:566:14: error: previous declaration ‘char* strsignal(int)’ here
In file included from ../../gcc-4.8.2/gcc/system.h:645:0,
from ../../gcc-4.8.2/gcc/c/c-lang.c:22:
../../gcc-4.8.2/gcc/../include/libiberty.h:110:36: error: new declaration ‘char* basename(const char*)’
In file included from /usr/include/c++/4.7/cstring:44:0,
from ../../gcc-4.8.2/gcc/system.h:205,
from ../../gcc-4.8.2/gcc/c/c-lang.c:22:
/usr/include/string.h:603:28: error: ambiguates old declaration ‘const char* basename(const char*)’
In file included from ../../gcc-4.8.2/gcc/tree.h:27:0,
from ../../gcc-4.8.2/gcc/c/c-lang.c:25:
../../gcc-4.8.2/gcc/vec.h: In static member function ‘static void va_heap::reserve(vec<T, va_heap, vl_embed>*&, unsigned int, bool)’:
../../gcc-4.8.2/gcc/vec.h:295:7: error: ‘GATHER_STATISTICS’ was not declared in this scope
../../gcc-4.8.2/gcc/vec.h:303:7: error: ‘GATHER_STATISTICS’ was not declared in this scope
../../gcc-4.8.2/gcc/vec.h: In static member function ‘static void va_heap::release(vec<T, va_heap, vl_embed>*&)’:
../../gcc-4.8.2/gcc/vec.h:317:7: error: ‘GATHER_STATISTICS’ was not declared in this scope
In file included from ../../gcc-4.8.2/gcc/tree.h:29:0,
from ../../gcc-4.8.2/gcc/c/c-lang.c:25:
../../gcc-4.8.2/gcc/real.h: At global scope:
../../gcc-4.8.2/gcc/real.h:51:21: error: ‘SIZEOF_LONG’ was not declared in this scope
../../gcc-4.8.2/gcc/real.h:51:21: error: ‘SIZEOF_LONG’ was not declared in this scope
../../gcc-4.8.2/gcc/real.h:76:31: error: ‘SIZEOF_LONG’ was not declared in this scope
../../gcc-4.8.2/gcc/real.h:76:31: error: ‘SIZEOF_LONG’ was not declared in this scope
../../gcc-4.8.2/gcc/real.h:76:31: error: ‘SIZEOF_LONG’ was not declared in this scope
../../gcc-4.8.2/gcc/real.h:76:31: error: ‘SIZEOF_LONG’ was not declared in this scope
In file included from ../../gcc-4.8.2/gcc/c-family/c-common.h:24:0,
from ../../gcc-4.8.2/gcc/c/c-tree.h:23,
from ../../gcc-4.8.2/gcc/c/c-lang.c:26:
../../gcc-4.8.2/gcc/../libcpp/include/cpplib.h:267:35: error: expected initializer before ‘cppchar_t’
../../gcc-4.8.2/gcc/../libcpp/include/cpplib.h:268:9: error: ‘CPPCHAR_SIGNED_T’ does not name a type
../../gcc-4.8.2/gcc/../libcpp/include/cpplib.h:777:8: error: ‘cppchar_t’ does not name a type
../../gcc-4.8.2/gcc/../libcpp/include/cpplib.h:788:8: error: ‘cppchar_t’ does not name a type
../../gcc-4.8.2/gcc/../libcpp/include/cpplib.h:966:8: error: ‘cppchar_t’ does not name a type
make[3]: *** [c/c-lang.o] Error 1
make[3]: Leaving directory `/home/mdrozdik/gccbuild/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/home/mdrozdik/gccbuild'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/mdrozdik/gccbuild'
make: *** [all] Error 2
I am compiling with gcc 4.7.2-5 on Debian.
On the local machine there is Ubuntu 13.10 with gcc 4.7.3 and the build seems fine so far (still running).
Please, what could be the cause of these errors?
EDIT:
I checked the /home/mdrozdik/gccbuild/libcpp/config.log file. It is very longm but in two places there are these errors:
configure:3086: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3097: $? = 4
configure:3086: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3097: $? = 4
But the log continues for several pages nevertheless.
I had a similar problem (gcc 4.8.3) and this solved it: g++ 4.7.1 compilation error : conflicting types for ‘strsignal’
The solution was to unset a bunch of C compiler flags (CPATH, etc.)
https://stackoverflow.com/users/1224886/tsbertalan reported this worked for him (and it's what I used):
unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE

Error while building FastCGI in a server running ubuntu

I want to interface FCGI with my C++ code in a server that runs ubuntu. I didn't find ubuntu under the list of tested platforms in the FCGI website, but I tried building it anyway.
./configure seems to work okay. But, when I run make, I get 2 errors, as pasted below:
fcgio.cpp: In destructor 'virtual fcgi_streambuf::~fcgi_streambuf()':
fcgio.cpp:50: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::overflow(int)':
fcgio.cpp:70: error: 'EOF' was not declared in this scope
fcgio.cpp:75: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::sync()':
fcgio.cpp:86: error: 'EOF' was not declared in this scope
fcgio.cpp:87: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::underflow()':
fcgio.cpp:113: error: 'EOF' was not declared in this scope
make[2]: *** [fcgio.lo] Error 1
make[2]: Leaving directory '/home/giridhar/fcgi-2.4.1-SNAP-0910052249/libfcgi'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/giridhar/fcgi-2.4.1-SNAP-0910052249'
make: *** [all] Error 2
Help in fixing this issue would be greatly appreciated.
I noticed that EOF is a C macro and it requires stdio.h which wasn't included in the fcgio.cpp file.
Adding a #include <stdio.h> to the fcgio.cpp file solves the problem, and now FCGI builds fine on Ubuntu.

fcgio.cpp:50: error: 'EOF' was not declared in this scope

I am attempting to build fastcgi on a Linux Ubuntu 10.x machine.
I run the following commands:
./configure
make
and I get the following error:
fcgio.cpp: In destructor 'virtual fcgi_streambuf::~fcgi_streambuf()':
fcgio.cpp:50: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::overflow(int)':
fcgio.cpp:70: error: 'EOF' was not declared in this scope
fcgio.cpp:75: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::sync()':
fcgio.cpp:86: error: 'EOF' was not declared in this scope
fcgio.cpp:87: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::underflow()':
fcgio.cpp:107: error: 'EOF' was not declared in this scope
make[2]: *** [fcgio.lo] Error 1
make[2]: Leaving directory `/somepath/fcgi-2.4.0/libfcgi'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/somepath/fcgi-2.4.0'
make: *** [all] Error 2
I notice that others have had the same problem and have asked this question in various fora etc - however, I have not as yet, seen an answer to this question/problem.
Has anyone ever managed to build fastcgi on Linux?
How do I fix this problem?
EOF is a C macro and seems that you do not have it defined in fcgio.cpp or that something has undefined it. I would first try to add #include <stdio.h> to start of fcgio.cpp.
I had the same problem on Ubuntu 11.10 Linux 64bit. Following most of #paercebal's advice I created the following patch which resolved the problem:
--- include/fcgio.h 2012-01-23 15:23:51.136063795 +0000
+++ include/fcgio.h 2012-01-23 15:22:19.057221383 +0000
## -31,6 +31,7 ##
#define FCGIO_H
#include <iostream>
+#include <stdio.h>
#include "fcgiapp.h"

Qt::What needs to be included in the configuration to use dbus?

I'm using stripped down as much as possible configuration of Qt but now I need to use the dbus and can't figure out what I need to include to be able to use it? There doesnt seem to be anything obvious to me using the qconfig tool. The errors I get at the moment when making are:
qdbus_symbols.cpp:53: error: expected initializer before ‘*’ token
qdbus_symbols.cpp: In function ‘void qdbus_unloadLibDBus()’:
qdbus_symbols.cpp:57: error: ‘qdbus_libdbus’ was not declared in this scope
qdbus_symbols.cpp: In function ‘bool qdbus_loadLibDBus()’:
qdbus_symbols.cpp:67: error: ‘QLibrary’ was not declared in this scope
qdbus_symbols.cpp:67: error: ‘lib’ was not declared in this scope
qdbus_symbols.cpp:67: error: ‘qdbus_libdbus’ was not declared in this scope
qdbus_symbols.cpp:71: error: expected type-specifier before ‘QLibrary’
qdbus_symbols.cpp:71: error: expected ‘;’ before ‘QLibrary’
qdbus_symbols.cpp:85: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
qdbus_symbols.cpp: In function ‘void* qdbus_resolve_conditionally(const char*)’:
qdbus_symbols.cpp:93: error: ‘qdbus_libdbus’ was not declared in this scope
qdbus_symbols.cpp: In function ‘void* qdbus_resolve_me(const char*)’:
qdbus_symbols.cpp:103: error: ‘qdbus_libdbus’ was not declared in this scope
make[1]: *** [.obj/release-static-emb-x86/qdbus_symbols.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/mark/qt-qvfb-4.5.3-static/src/dbus'
make: *** [sub-dbus-make_default-ordered] Error 2
Does anyone know a module that I must not be including which is necessary or how to find out? thanks
QT += dbus
should be enough to include the dbus option in the .pro project file, ins't it?
I need more info to give apropriate answer.