Bug 216158

Summary: Build fails - globalconfig.h incompatible with globalconfig.cpp
Product: [Frameworks and Libraries] Phonon Reporter: tropikhajma <tropikhajma>
Component: generalAssignee: Matthias Kretz <kretz>
Status: RESOLVED FIXED    
Severity: crash CC: colin
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Solaris   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description tropikhajma 2009-11-25 21:46:22 UTC
Version:           r.1054227 (using Devel)
Compiler:          Sun Studio 12 U1 
OS:                Solaris
Installed from:    Compiled sources

Building kdesupport fails in phonon with
...
[ 88%] Building CXX object phonon/phonon/experimental/CMakeFiles/phononexperimental.dir/avcapture.cpp.o                                      
"/home/hajma/Dashboards/kdesupport/srcdir/phonon/phonon/experimental/globalconfig.h", line 42: Error: Cannot return Phonon::Experimental::GlobalConfigPrivate* from a function that should return Phonon::GlobalConfigPrivate*.
"/home/hajma/Dashboards/kdesupport/srcdir/phonon/phonon/experimental/globalconfig.h", line 42: Error: Cannot return const Phonon::Experimental::GlobalConfigPrivate* from a function that should return const Phonon::GlobalConfigPrivate*.
2 Error(s) and 1 Warning(s) detected.   


this is on OpenSolaris b124 with Sun Studio 12U1
You can see the failure in the kde-dashboard at http://my.cdash.org/viewBuildError.php?buildid=39101
Comment 1 Colin Guthrie 2009-11-26 15:20:32 UTC
Hi,

I can't seem to see this error myself... I don't really know how the K_DECLARE_PRIVATE macro works... 

Also your build link in the description fails above.

All I can suggest just now is this patch:

--- a/phonon/experimental/globalconfig.h
+++ b/phonon/experimental/globalconfig.h
@@ -39,7 +39,7 @@ namespace Experimental
 
 class GlobalConfig : public Phonon::GlobalConfig
 {
-    K_DECLARE_PRIVATE(GlobalConfig)
+    K_DECLARE_PRIVATE(Phonon::GlobalConfig)
 public:
     QList<int> videoCaptureDeviceListFor(Phonon::Category category, int override = AdvancedDevicesFromSettings) const;
     int videoCaptureDeviceFor(Phonon::Category category, int override = AdvancedDevicesFromSettings) const;


All I know is that it doesn't break build for me and perhaps with the specific namespacing, it will fix your error?
Comment 2 tropikhajma 2009-11-26 17:40:31 UTC
I don't really speak C++ :-(
comparing with the phonon/globalconfig.h header file I tried this patch:
-----------
--- phonon/experimental/globalconfig.h.orig     2009-11-26 14:16:29.936936414
+0100
+++ phonon/experimental/globalconfig.h  2009-11-26 16:19:26.706567789 +0100
@@ -36,6 +36,7 @@
 {
 namespace Experimental
 {
+class GlobalConfigPrivate;

 class GlobalConfig : public Phonon::GlobalConfig
 {
-----------
which got rid of the reported error, but failed anyway with

"/home/hajma/packages/BUILD/phonon-4.3.0/i386/PHONON/4.3.0/phonon/experimental/globalconfig.cpp",
line 74: Error: The type "const Phonon::Experimental::GlobalConfigPrivate" is
incomplete.
"/home/hajma/packages/BUILD/phonon-4.3.0/i386/PHONON/4.3.0/phonon/experimental/globalconfig.cpp",
line 75: Error: The type "const Phonon::Experimental::GlobalConfigPrivate" is
incomplete.
Comment 3 Colin Guthrie 2009-11-26 17:46:20 UTC
Yeah that fix wont work... it just adds a forward declaration for the class, but doesn't define it.

Did you try my patch? Did it not work?
Comment 4 tropikhajma 2009-11-26 17:50:49 UTC
Just got my hands on the build system :-)
Yes with this patch phonon builds completely.
Thanks!
Comment 5 Colin Guthrie 2009-11-26 18:17:20 UTC
Cool. I guess I'll commit it then :)
Comment 6 Colin Guthrie 2009-11-26 18:22:07 UTC
SVN commit 1054743 by cguthrie:

experimental: Use full namespace on Phonon::GlobalConfig in Experimental::GlobalConfig

It seems some compilers (e.g. the one used on Solaris/Sun Studio 12 U1) need this to compile cleanly.

CCBUG: 216158

 M  +1 -1      globalconfig.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1054743
Comment 7 Colin Guthrie 2009-11-26 18:22:45 UTC
Marking as fixed.