• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 431
  • Last Modified:

Compiling Problems

First off I want to say that I'm a novice at this.

I'm trying to compile a software program and it worked perfect before with RHEL 3, gcc 3.2.3. Here's a small history.

1) When compiling in the past with gcc 3.2.3 the person that wrote the software said he wrote it using gcc 3.3 and 3.4, so he used this to be compatable with gcc 3.2.3.

perl -pi -ne 's/atomic_word\.h/atomicity.h/' ./*.h ./*.cc

2) The problem is... I'm now on RHEL 4, with gcc 3.4.5 and it's not compiling. I did run up2date -i compat-libstdc++-33 to install gcc 3.2.3 but it's not picking that up either.

I apologize for rambling here, but I want to be sure I'm explaining this properly.

Thanks,
Fireman54
0
Fireman54
Asked:
Fireman54
  • 5
  • 5
1 Solution
 
ravenplCommented:
And what's the error while compiling?
It's common, that each next version of gcc is more strict on c++ standads(syntax).
0
 
Fireman54Author Commented:
[root@domain emse]# make
make  all-recursive
make[1]: Entering directory `/root/respondatamailer/fum/emse'
Making all in src
make[2]: Entering directory `/root/respondatamailer/fum/emse/src'
source='main.cc' object='main.o' libtool=no \
depfile='.deps/main.Po' tmpdepfile='.deps/main.TPo' \
depmode=gcc3 /bin/sh ../depcomp \
g++ -DHAVE_CONFIG_H -I. -I. -I..   -I/usr/mysql/include/mysql  -O3 -fomit-frame-pointer -DHOSTNAME_CHECK='"srv9.net"' -DWEBDOMAIN='"srv9.net"' -DMAILDOMAIN='"srv9.net"' -c -o main.o `test -f 'main.cc' || echo './'`main.cc
In file included from mailq.h:12,
                 from main.cc:17:
cmd.h:13: error: explicit qualification in declaration of `void emse::cmd::list_emails(i::conn*, std::string)'
cmd.h:15: error: explicit qualification in declaration of `void emse::cmd::fini()'
make[2]: *** [main.o] Error 1
make[2]: Leaving directory `/root/respondatamailer/fum/emse/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/respondatamailer/fum/emse'
make: *** [all] Error 2
0
 
ravenplCommented:
> explicit qualification in declaration of `void emse::cmd::list_emails(i::conn*, std::string)'
You can't declare member of one namespace in another one(it was possible earlier)
Consider:
namespace B {
        int A::f();     // Declaration
}
What is declared. Is it B::A::f(), or B::f()? That's why it's forbidden.

Either compile using older gcc or ask the author of the code to fix it, or fix it by Yourself.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Fireman54Author Commented:
I have no way of getting ahold of the author. So compiling it with gcc 3.2.3 would work for me.

I don't know if you remember me from the other day when you gave me the answer... up2date -i compat-libstdc++-33 . So I have gcc 3.2.3 on my server. The problem is, I don't know how to tell this program how to grab the gcc 3.2.3 instead of the gcc 3.4.5.

0
 
ravenplCommented:
> The problem is, I don't know how to tell this program how to grab the gcc 3.2.3 instead of the gcc 3.4.5
up2date -i compat-gcc-32 compat-gcc-32-c++
then instead gcc or g++ You have to call gcc32 or g++32
0
 
Fireman54Author Commented:
Ok, I ran up2date -i compat-gcc-32 compat-gcc-32-c++

Now please tell me how to call gcc32 or g++32 when compiling. I'm real new at this (very new), I don't know where to call it from.

Thanks,
0
 
Fireman54Author Commented:
Ravenpl... gcc and g++ are both referenced in the 'configure' file. Is this where I'll be changing it, and which one... gcc or g++ ?
0
 
ravenplCommented:
If You use it with configure, try
CC=gcc32 CXX=g++32 ./configure more options
otherwise edit makefile and change gcc calls

Also, You may change the configure scipt itself (as You suggested) - change both gcc & g++
0
 
Fireman54Author Commented:
Ravenpl... Thank you very much, it worked perfectly.

0
 
ravenplCommented:
Glad I could help
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now