Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am running Fedora 10 and have been trying to compile & install a project by using the included make file, but I'm getting a bunch of errors. The make file specifies g++ 4.3.2. Here is my error(libAnomaly is a library which I am trying to compile):
Code:
../../include/libAnomaly/item.h:149: error: 'hash' is not a template
../../include/libAnomaly/item.h:150: error: explicit specialization of non-template 'std::hash'
../../include/libAnomaly/item.h:310: error: extra qualification ignored
../../include/libAnomaly/item.h:311: error: explicit specialization of non-template 'std::<anonymous struct>'
../../include/libAnomaly/item.h:311: error: an anonymous struct cannot have function members
../../include/libAnomaly/item.h:321: error: abstract declarator 'std::<anonymous struct>' used as declaration
In file included from ../../include/anomaly.h:68,
from item.cpp:21:
../../include/libAnomaly/model.h:269: error: ISO C++ forbids declaration of 'hash_map' with no type
../../include/libAnomaly/model.h:269: error: expected ';' before '<' token
In file included from ../../include/anomaly.h:75,
from item.cpp:21:
../../include/libAnomaly/profile.h: In member function 'virtual size_t Profile::EvaluationResult::hash_value() const':
../../include/libAnomaly/profile.h:184: error: 'std::hash' is not a template
../../include/libAnomaly/profile.h:186: error: no match for call to '(std::hash) (const char*)'
../../include/libAnomaly/item.h:156: note: candidates are: size_t std::hash::operator()(const Item*) const
make[2]: *** [item.lo] Error 1
make[2]: Leaving directory `/root/Desktop/Libanomaly/libanomaly-0.1/libanomaly-0.1/src/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/Desktop/Libanomaly/libanomaly-0.1/libanomaly-0.1/src'
make: *** [all-recursive] Error 1
The problem seems to be connected to hash_map, but no sure. Before running Fedora 10, I have been running fedora 8, there was g++ 4.1.2, but the errors were the same, now I'm wondering what can I do?
Hi Zahra,
Usually source code to be compiled contains an INSTALL and/or README file that alerts you to any special requirements that you might need. Have you looked at them?
Is this a "one size fits all" compilation or is there a configure script that you need to run first?
As you mentioned the source code contains an INSTALL file, but it's general to some extent, I bring the main part of this file:
Code:
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
there isn't any special suggestion, I have just followed the file, my problem starts as I "make" it, errors are represented whenever I run "make".
Due to INSTALL file I think, it is a "one size fits all" compilation.
I'm not clear about what procedure you followed.
1. Did you run configure?
2. Did it run properly with no errors?
2. Did you check the configure.log for any errors?
cheers,
jdk
1. I ran configure.
2. It ran, here is the result:
Code:
[root@localhost libanomaly-0.1]# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking for a sed that does not truncate output... /bin/sed
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking command to parse /usr/bin/nm -B output... ok
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for ranlib... ranlib
checking for strip... strip
checking for objdir... .libs
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.lo... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking whether the linker (/usr/bin/ld) supports shared libraries... yes
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether -lc should be explicitly linked in... no
creating libtool
checking for exp in -lm... yes
checking for ANSI C header files... (cached) yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating include/libAnomaly/Makefile
config.status: creating src/Makefile
config.status: creating src/lib/Makefile
config.status: creating src/appl/Makefile
config.status: executing depfiles commands
3. I checked /var/log, but I did not find configure.log file, where can I find it?
Hi Zahra,
Frankly I don't know what to do either. I surprised that configure terminated normally with all those errors. Maybe someone with more knowledge of C can tell you. At this point I can only suggest reading the documentation that comes with the program to see if you are missing any vital component. Sorry.
jdk
Nowadays I don’t have access to high speed Internet at all, that's a national limitation, it's not permanent of course, so it have taken me more than usual to follow your suggestion, but by the way I have done it, but no difference, I received same errors, I’m not expert neither in gcc nor even in Linux, but can these problems due to gcc version? I have checked the project with two versions. Any suggestion?
you might need to rewrite the code for it to build using gcc 4.?
4 was "strict" and had some changes
4.1 was MORE "strict" and had more changes changes
4.3 was EVEN MORE
and 4.4 has more changes
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.