[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] errors with g++-4.5 not with g++-4.4



Axel Freyn wrote:
Hi Hugo,
On Sat, Mar 12, 2011 at 11:17:19AM -0600, Hugo Vanwoerkom wrote:
Hi,

I am looking for your opinion as to whose bug this is.

I have a C++ project ( http://gpc-qt.sourceforge.net/ ) that consists of more than 103 C++ sourcefiles (1000's of lines of code) that get copiled into a single executable.

Suddenly using the g++-4.5 compiler it produces an error in the link phase:

...
grafrs.cpp:(.text+0x355d): undefined reference to `mutrec'
...

But when I use the g++-4.4 compiler everything compiles and links without error, like it has for years with previous C++ compilers.

Do I file a bug with the g++-4.5 package?

I would first assume an error in this project -- and not in g++-4.5 :-)

However, before writing a bug, it would be very usefull if you succeed
to reduce the test case: I'm almost sure that none of the g++-developers
will be happy with a bug report stating "somehow those 1000's lines of
code don't compile correctly" -- I would expect a much faster help if
you could reduce the problem and reduce it to a few hundred (or even a
few tenth) of lines of code...
Is that possible?

I just had a VERY quick look at the code: It seems that "mutrec" is
defined in "aa.cpp". Do you link aa.cpp and grafrs.cpp together?


Thanks Axel. It is stranger yet:
1. mutrec is defined in aa.cpp
2. It is used as extern in mc.cpp, grafrs.cpp and setfile.cpp
3. But g++-4.5 only finds undefined referenes in mc.cpp and grafrs.cpp, *not* in setfile.cpp
4. Yet the extern for mutrec is defined in all three the same way.
5. And previous compilers have found no errors.
6. The whole bunch is linked together via aa.pro that is used in 'qmake-qt4 -o Makefile aa.pro' to create a makefile for make.

I have not found an errors when I create small testcases.
This happens both in 686 and amd64. Up todate Sid.

Hugo


Reply to: