Opened 11 years ago

Closed 9 years ago

Last modified 9 years ago

#5906 closed defect (fixed)

Unable to compile SVN 19076 with Ubuntu 8.10

Reported by: david.berry@… Owned by: danielk
Priority: minor Milestone: 0.24
Component: MythTV - General Version: Master Head
Severity: low Keywords:
Cc: Ticket locked: no

Description (last modified by Nigel)

Hi

Clean download of SVN. Compiles fine on Ubuntu 8.04.

Fails to compile on Ubuntu 8.10 - details are:

Linux mythmaster01 2.6.27-7-server #1 SMP Tue Nov 4 20:16:57 UTC 2008 x86_64 GNU/Linux

>gcc --version
gcc (Ubuntu 4.3.2-1ubuntu11) 4.3.2

> sudo dpkg -l | grep qt3
libqt3-headers                        3:3.3.8- b-5ubuntu1                    Qt3 header files

libqt3-mt                             3:3.3.8-b-5ubuntu1                    Qt GUI Library (Threaded runtime version), V

libqt3-mt-dev                         3:3.3.8-b-5ubuntu1                    Qt development files (Threaded)

libqt3-mt-mysql                       3:3.3.8-b-5ubuntu1                    MySQL database driver for Qt3 (Threaded)

libqt4-qt3support                     4.4.3-0ubuntu1                        Qt 3 compatibility library for Qt 4

qt3-dev-tools                         3:3.3.8-b-5ubuntu1                    Qt3 development tools

This would appear to be the latest version of the libqt3-headers.

configure line is: ( for a backend server only )
./configure --prefix=/usr --disable-joystick-menu --disable-lirc --disable-ivtv --disable-firewire --disable-dbox2 --disable-hdhomerun --disable-audio-oss --disable-audio-alsa --disable-audio-arts --disable-audio-jack --disable-iptv --disable-v4l --disable-x11

ccache g++ -c -pipe -g -march=k8 -fomit-frame-pointer -O3 -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -Wno-non-virtual-dtor -D__STDC_CONSTANT_MACROS -I/usr/include/freetype2 -D_REENTRANT -DPIC -fPIC  -DMMX -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DUSING_H264TOOLS -DUSING_FRONTEND -DUSING_FFMPEG_THREADS -DUSING_DVB -DUSING_BACKEND -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I/usr/include -I/usr/include -I../.. -I.. -I. -I../libmyth -I../libavcodec -I../libavutil -I../libmythmpeg2 -Idvbdev -Impeg -Iiptv -I../libmythlivemedia/BasicUsageEnvironment/include -I../libmythlivemedia/groupsock/include -I../libmythlivemedia/liveMedia/include -I../libmythlivemedia/UsageEnvironment/include -I/usr/include/qt3 -o progfind.o progfind.cpp
In file included from ../libmythui/mythuitype.h:6,
                 from ../libmythui/mythmainwindow.h:13,
                 from ../libmyth/mythdialogs.h:52,
                 from vsync.cpp:36:
/usr/include/qt3/qimage.h: In member function ‘bool QImageTextKeyLang::operator<(const QImageTextKeyLang&) const’:
/usr/include/qt3/qimage.h:61: warning: suggest parentheses around && within ||
vsync.cpp: In static member function ‘static VideoSync* VideoSync::BestMethod(VideoOutput*, uint, uint, bool)’:
vsync.cpp:79: error: ‘getenv’ was not declared in this scope
vsync.cpp: At global scope:
vsync.cpp:266: warning: deprecated conversion from string constant to ‘char*’
vsync.cpp:358: warning: deprecated conversion from string constant to ‘char*’
vsync.cpp: In member function ‘virtual void RTCVideoSync::WaitForFrame(int)’:
vsync.cpp:760: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result
vsync.cpp: In member function ‘virtual void BusyWaitVideoSync::WaitForFrame(int)’:
vsync.cpp:812: error: call of overloaded ‘abs(int)’ is ambiguous
/usr/include/c++/4.3/cmath:99: note: candidates are: double std::abs(double)
/usr/include/c++/4.3/cmath:103: note:                 float std::abs(float)
/usr/include/c++/4.3/cmath:107: note:                 long double std::abs(long double)
make[2]: *** [vsync.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ../libmyth/mythwidgets.h:21,
                 from ../libmyth/mythconfigdialogs.h:14,
                 from ../libmyth/settings.h:5,
                 from recordingprofile.h:5,
                 from NuppelVideoPlayer.h:15,
                 from videooutbase.cpp:7:
/usr/include/qt3/qimage.h: In member function ‘bool QImageTextKeyLang::operator<(const QImageTextKeyLang&) const’:
/usr/include/qt3/qimage.h:61: warning: suggest parentheses around && within ||
videooutbase.cpp: In member function ‘virtual QRect VideoOutput::GetVisibleOSDBounds(float&, float&, float) const’:
videooutbase.cpp:752: error: call of overloaded ‘abs(int)’ is ambiguous
/usr/include/c++/4.3/cmath:99: note: candidates are: double std::abs(double)
/usr/include/c++/4.3/cmath:103: note:                 float std::abs(float)
/usr/include/c++/4.3/cmath:107: note:                 long double std::abs(long double)
videooutbase.cpp:752: error: call of overloaded ‘abs(int)’ is ambiguous
/usr/include/c++/4.3/cmath:99: note: candidates are: double std::abs(double)
/usr/include/c++/4.3/cmath:103: note:                 float std::abs(float)
/usr/include/c++/4.3/cmath:107: note:                 long double std::abs(long double)
videooutbase.cpp: In member function ‘void VideoOutput::ApplyDBScaleAndMove()’:
videooutbase.cpp:838: error: call of overloaded ‘abs(int&)’ is ambiguous
/usr/include/c++/4.3/cmath:99: note: candidates are: double std::abs(double)
/usr/include/c++/4.3/cmath:103: note:                 float std::abs(float)
/usr/include/c++/4.3/cmath:107: note:                 long double std::abs(long double)
videooutbase.cpp:870: error: call of overloaded ‘abs(int&)’ is ambiguous
/usr/include/c++/4.3/cmath:99: note: candidates are: double std::abs(double)
/usr/include/c++/4.3/cmath:103: note:                 float std::abs(float)
/usr/include/c++/4.3/cmath:107: note:                 long double std::abs(long double)
videooutbase.cpp:892: error: call of overloaded ‘abs(int&)’ is ambiguous
/usr/include/c++/4.3/cmath:99: note: candidates are: double std::abs(double)
/usr/include/c++/4.3/cmath:103: note:                 float std::abs(float)
/usr/include/c++/4.3/cmath:107: note:                 long double std::abs(long double)
videooutbase.cpp:917: error: call of overloaded ‘abs(int&)’ is ambiguous
/usr/include/c++/4.3/cmath:99: note: candidates are: double std::abs(double)
/usr/include/c++/4.3/cmath:103: note:                 float std::abs(float)
/usr/include/c++/4.3/cmath:107: note:                 long double std::abs(long double)
videooutbase.cpp: In member function ‘void VideoOutput::ApplySnapToVideoRect()’:
videooutbase.cpp:1032: error: call of overloaded ‘abs(int)’ is ambiguous
/usr/include/c++/4.3/cmath:99: note: candidates are: double std::abs(double)
/usr/include/c++/4.3/cmath:103: note:                 float std::abs(float)
/usr/include/c++/4.3/cmath:107: note:                 long double std::abs(long double)
videooutbase.cpp:1048: error: call of overloaded ‘abs(int)’ is ambiguous
/usr/include/c++/4.3/cmath:99: note: candidates are: double std::abs(double)
/usr/include/c++/4.3/cmath:103: note:                 float std::abs(float)
/usr/include/c++/4.3/cmath:107: note:                 long double std::abs(long double)
make[2]: *** [videooutbase.o] Error 1
In file included from ../libmyth/mythwidgets.h:21,
                 from ../libmyth/uitypes.h:19,
                 from progfind.h:18,
                 from progfind.cpp:24:
/usr/include/qt3/qimage.h: In member function ‘bool QImageTextKeyLang::operator<(const QImageTextKeyLang&) const’:
/usr/include/qt3/qimage.h:61: warning: suggest parentheses around && within ||
In file included from guidegrid.cpp:10:
/usr/include/qt3/qimage.h: In member function ‘bool QImageTextKeyLang::operator<(const QImageTextKeyLang&) const’:
/usr/include/qt3/qimage.h:61: warning: suggest parentheses around && within ||
make[2]: Leaving directory `/mnt/storage01/srcCode/mythtv_SVN_2/release-0-21-fixes/mythtv/libs/libmythtv'
make[1]: *** [sub-libmythtv] Error 2
make[1]: Leaving directory `/mnt/storage01/srcCode/mythtv_SVN_2/release-0-21-fixes/mythtv/libs'
make: *** [sub-libs] Error 2

Change History (11)

comment:1 Changed 11 years ago by Nigel

Description: modified (diff)
Version: unknown0.21-fixes

David, can you clarify the version of the source code? (e.g. svn info mnt/storage01/srcCode/mythtv_SVN_2/release-0-21-fixes/mythtv)
I only ask, because 19706 is an SVN trunk revision number, which would be Qt4 only.
I don't have a Ubuntu 8 build machine handy, so would remote access to your compile machine, or the output of a few 'g++ -E' commands, be possible?

comment:2 in reply to:  1 Changed 11 years ago by anonymous

Replying to nigel:

David, can you clarify the version of the source code? (e.g. svn info mnt/storage01/srcCode/mythtv_SVN_2/release-0-21-fixes/mythtv)
I only ask, because 19706 is an SVN trunk revision number, which would be Qt4 only.
I don't have a Ubuntu 8 build machine handy, so would remote access to your compile machine, or the output of a few 'g++ -E' commands, be possible?

Hi

svn info

Path: .

URL: http://svn.mythtv.org/svn/branches/release-0-21-fixes/mythtv

Repository Root: http://svn.mythtv.org/svn Repository UUID: 7dbf422c-18fa-0310-86e9-fd20926502f2

Revision: 19080

Node Kind: directory

Schedule: normal

Last Changed Author: stuartm

Last Changed Rev: 19046

Last Changed Date: 2008-11-11 06:10:04 +1100 (Tue, 11 Nov 2008)

Also just did another update:

$ svn update

At revision 19089.

dberry@mythmaster01:/mnt/storage01/srcCode/mythtv_SVN_2/release-0-21-fixes$ svn info

Path: .

URL: http://svn.mythtv.org/svn/branches/release-0-21-fixes

Repository Root: http://svn.mythtv.org/svn

Repository UUID: 7dbf422c-18fa-0310-86e9-fd20926502f2

Revision: 19089

Node Kind: directory

Schedule: normal

Last Changed Author: stuartm

Last Changed Rev: 19046

Last Changed Date: 2008-11-11 06:10:04 +1100 (Tue, 11 Nov 2008)

Happy to run any command you need.

Thanks

comment:3 Changed 11 years ago by kamikaze@…

Hello

Could someone help with this issue? I'd like to recompile mythlcdserver patched by me to get work correctly with cvs version of lcdproc (new screen priorities).

I tried to recompile version 0.21+fixes of mythtv and got similar error (call of overloaded abs(int) is ambiguous). I'm newbie in compiling under Linux but I think it could be something wrong in compiler options. I'm using mythbuntu 8.10.

BTW: Compiling lcdproc from sources worked like a charm.

Any help is appreciated.

comment:4 Changed 11 years ago by kamikaze@…

Dear all

The solution is simple - just downgrade gcc to 4.2. Works for me, should work for you.

comment:5 Changed 11 years ago by danielk

Resolution: invalid
Status: newclosed

cmath should define int abs(int) in ANSI C, so the bug would be in your system libs not in MythTV.

This also works for me on intrepid with "gcc (Ubuntu 4.3.2-1ubuntu11) 4.3.2", try doing an "apt-get update; apt-get upgrade" to get the latest and greatest.

comment:6 Changed 10 years ago by jeffbowman@…

Resolution: invalid
Status: closednew

I apologize for reopening a two-year-old bug, but the resolution contains invalid information. This issue is still visible in the current trunk release. (I did not try compiling with my toolchain, but you can tell just by looking.)

I had trouble compiling due to this error in mythtv-0.21 on an ARM GCC-4.3 installation (on a Sheevaplug). As it turns out, <cmath> does NOT define int abs(int); <cstdlib> does. Apparently most versions of gcc are smart enough to figure this out, but some are not. (The suggested workaround didn't work for me, either.)

For mythTV 0.21, I had to fix this in both "videooutbase.cpp" and "vsync.cpp" by adding the line "#include <cstdlib>" at the very top of the file. You may have to edit other files as well, if you have different config settings.

It's beyond me how this works for everyone except a few, but in any case, pulling in <cstdlib> will allow your code to be properly C-compliant. :)

comment:7 Changed 10 years ago by robertm

Component: mythtvMythTV - General
Owner: changed from Isaac Richards to danielk
Severity: highlow
Status: newassigned
Version: 0.21-fixesTrunk Head

comment:8 Changed 10 years ago by jeffbowman@…

You may enjoy this search on Google Code Search. The files are often a few versions out, but it's quick and easy. You can do so with grep as well, but removing the results that properly include <cstdlib> is a bit more difficult.

comment:9 Changed 9 years ago by danielk

Resolution: fixed
Status: assignedclosed

(In [24790]) Fixes #5906. Implement our own abs for integers in vsync.cpp. This isn't particularly efficient, but it isn't called very often this is cross-platform.

comment:10 Changed 9 years ago by danielk

(In [24791]) Fixes #5906. Bah! fix this properly. Thanks to Jeff Bowman for pointing out the missing header include.

comment:11 Changed 9 years ago by stuartm

Milestone: unknown0.24
Note: See TracTickets for help on using tickets.