Link to home
Start Free TrialLog in
Avatar of Fireman54
Fireman54

asked on

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
Avatar of ravenpl
ravenpl
Flag of Poland image

And what's the error while compiling?
It's common, that each next version of gcc is more strict on c++ standads(syntax).
Avatar of Fireman54
Fireman54

ASKER

[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
> 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.
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.

ASKER CERTIFIED SOLUTION
Avatar of ravenpl
ravenpl
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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,
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++ ?
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++
Ravenpl... Thank you very much, it worked perfectly.

Glad I could help