LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 06-10-2009, 10:04 AM   #1
zhr
LQ Newbie
 
Registered: Jun 2009
Posts: 5

Rep: Reputation: 0
Errors as trying to install a project


Hi,

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?

Best Wishes, Zahra
 
Old 06-10-2009, 11:39 AM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
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?

Just a couple of thoughts.
cheers,
jdk
 
Old 06-10-2009, 02:36 PM   #3
zhr
LQ Newbie
 
Registered: Jun 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Hi jdk

At first, thank you for your immediate reply.

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.

Cheers,
Zahra
 
Old 06-10-2009, 10:55 PM   #4
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
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
 
Old 06-11-2009, 01:22 AM   #5
zhr
LQ Newbie
 
Registered: Jun 2009
Posts: 5

Original Poster
Rep: Reputation: 0
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?

BR,
Zahra
 
Old 06-11-2009, 03:32 AM   #6
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
You find configure.log in the same folder that you find configure. It is created when you run configure.
cheers,
jdk
 
Old 06-12-2009, 10:21 AM   #7
zhr
LQ Newbie
 
Registered: Jun 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Hi,
I found the file, as I have been checking it for any errors, I come to these:

Code:
...

conftest.cc: In function 'int main()': conftest.cc:15: error: 'exit' was not declared in this scope configure:2425: $? = 1 | /* confdefs.h.  */ 

...

configure:2374: g++ -c -g -O2  conftest.cc >&5 conftest.cc:11: error: 'void std::exit(int)' should have been declared inside 'std' configure:2380: $? = 1 configure: failed program was: | /* confdefs.h.  */ 

...

configure:2374: g++ -c -g -O2  conftest.cc >&5 conftest.cc:11: error: 'void std::exit(int)' should have been declared inside 'std' In file included from conftest.cc:12: /usr/include/stdlib.h:531: error: declaration of 'void std::exit(int) throw ()' throws different exceptions conftest.cc:11: error: from previous declaration 'void std::exit(int)' configure:2380: $? = 1 configure: failed program was: | /* confdefs.h.  */

...

configure:3320: result: none needed configure:3338: gcc -c -g -O2  conftest.c >&5 conftest.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me' configure:3344: $? = 1 configure: failed program was: | #ifndef __cplusplus |   choke me | #endif 

....

configure:4306: gcc -E  conftest.c conftest.c:14:28: error: ac_nonexistent.h: No such file or directory configure:4312: $? = 1 configure: failed program was: | /* confdefs.h.  */ 

...

configure:4381: $? = 0 configure:4413: gcc -E  conftest.c conftest.c:14:28: error: ac_nonexistent.h: No such file or directory configure:4419: $? = 1 configure: failed program was: | /* confdefs.h.  */
...

It seems the failure may be due to confdefs.h...I think. Seriously, I do not know what to do next.

Best Wishes, Zahra

Last edited by zhr; 06-12-2009 at 10:25 AM.
 
Old 06-12-2009, 10:36 AM   #8
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
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
 
Old 06-13-2009, 02:54 PM   #9
rtaft
Member
 
Registered: Aug 2003
Posts: 85

Rep: Reputation: 15
Have you contacted the authors of the library? That code is 6 years old, perhaps it is not compatible with the current STL.
 
Old 06-13-2009, 03:35 PM   #10
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
as rtaft stated it is old code. do you have the lagacy gcc installed ( gcc34 )
Code:
yum groupinstall "Legacy Software Development"
how did you install gcc ? like this ?
Code:
yum groupinstall "Development Tools" "Development Libraries" "GNOME Software Development" "KDE Software Development"
these two "GNOME Software Development" "KDE Software Development" might not be needed .

if you do have gcc34 installed just export it to configure
Code:
export CC=gcc34 
./configure --prefix=/usr ( then your other options )
 
Old 06-17-2009, 01:58 AM   #11
zhr
LQ Newbie
 
Registered: Jun 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Thank you for your answer and sorry to be late,

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?

Best Wishes, Zahra
 
Old 06-17-2009, 02:50 AM   #12
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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

but most of the time it is just a matter of adding something like this to the .cpp or .h files
" #include <climits>" or change " #include <stream.h> 'to this " #include <iostream> "
see the gcc porting guides
4.4
http://gcc.gnu.org/gcc-4.4/porting_to.html
4.3
http://gcc.gnu.org/gcc-4.3/porting_to.html
----------
http://gcc.gnu.org/gcc-4.2/
http://gcc.gnu.org/gcc-4.1/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
New Application Download and Install Project galbotrix007 Linux - Software 1 07-23-2007 03:27 PM
C based project attempting to change over to C++ (Many Errors (Normal)) Need Help! RDS Programming 2 06-21-2007 11:09 PM
Errors while making new project :-Anjuta ciden Linux - Software 0 02-17-2007 10:23 AM
Kdevelop : Error with INSTALL after Build Project michellembrodeur Linux - Software 0 02-10-2007 10:40 AM
MR Project on KDE and where to install icons bungle_42 Linux - Software 0 10-20-2004 02:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration