Author Topic: Compilation issues due to wxMEDIACTRLPLAYERCONTROLS_* in r6414  (Read 18112 times)

Offline Mephistopheles

  • Multiple posting newcomer
  • *
  • Posts: 16
Hi guys,

as you might know or not I've been providing codeblocks packages for Fedora, Mandriva and openSUSE since some while but the latest build (r6414) fails due to some wxMEDIACTRLPLAYERCONTROLS_* issues. It works with Fedora 12 & 13 and openSUSE 11.3+ but the rest is suddenly broken which I don't entirely understand since the wxWidgets version should be enough (2.8.10).

Could you therefore please be so kind to have a look at https://build.opensuse.org/package/show?package=codeblocks&project=devel%3Atools%3Aide and check the build logs?

Also bellow is what our automated code checks currently find in your code, could you also please be so kind to have a look at those as well to ensure there aren't any issues:

Quote
I: A function overflows or underflows an array access. This could be a real error,
   but occasionaly this condition is also misdetected due to loop unrolling or strange pointer
   handling. So this is warning only, please review.
W: codeblocks arraysubscript ../../../../src/include/scripting/sqplus/sqplus.h:326
W: codeblocks arraysubscript ../../../src/include/scripting/sqplus/sqplus.h:326
W: codeblocks arraysubscript ../../src/include/scripting/sqplus/sqplus.h:326

I: Program causes undefined operation
   (likely same variable used twiceand post/pre incremented in the same expression).
   e.g. x = x++; Split it in two operations.
W: codeblocks sequence-point ./../editsnippetframe.cpp:642
W: codeblocks sequence-point cbkeybinder.cpp:406
W: codeblocks sequence-point editsnippetframe.cpp:642

I: Program is likely to break with new gcc. Try -fno-strict-aliasing.
W: codeblocks strict-aliasing-punning ../../../../src/include/scripting/sqplus/sqplus.h:420, 1801
W: codeblocks strict-aliasing-punning sqcompiler.cpp:654, 700
W: codeblocks strict-aliasing-punning sqstdblob.cpp:160, 168
W: codeblocks strict-aliasing-punning sqvm.cpp:739
W: codeblocks strict-aliasing-punning src/pdfrijndael.cpp:1088, 1096,  1109, 1110, 1111, 1112, 1118, 1119, 1120, 1121, 1182, 1235, 1236, 1237,  1238, 1243, 1244, 1245, 1246, 1251, 1252, 1253, 1254, 1264, 1265, 1266,  1267, 1273, 1274, 1275, 1276, 1345, 1356, 1396, 1407, 1430, 1435, 1443,  1450, 1469, 1471, 1473, 1475, 1484, 1485, 1486, 1487, 1488, 1489, 1490,  1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502,  1503, 1506, 1507, 1508, 1509, 1511, 1512, 1513, 1514, 1515, 1516, 1517,  1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1528, 1529, 1530,  1531, 1548, 1549, 1550, 1551, 1559, 1560, 1561, 1562, 1564, 1565, 1566,  1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578,  1579, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592,  1593, 1594, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1604, 1605, 1606,  1607, 1624, 1625, 1626, 1627

Thanks a lot :)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Compilation issues due to wxMEDIACTRLPLAYERCONTROLS_* in r6414
« Reply #1 on: July 24, 2010, 10:06:32 am »
I will look into it.
Thanks for reporting.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Compilation issues due to wxMEDIACTRLPLAYERCONTROLS_* in r6414
« Reply #2 on: July 24, 2010, 10:46:55 am »
on my OpenSuse11.2 64 bit I have the same issue (surprising it works for you in OpenSuse 11.3 64 bit).
These are the compiler errors output :
Code
/bin/sh ../../../../../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../../../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../../../../../src/include -I../../../../../../src/sdk/wxscintilla/include -I../../../../../../src/sdk/wxpropgrid/include -DWXMAKINGDLL_PROPGRID -DwxPG_USE_WXMODULE=0 -Ulinux -Uunix  -O2 -ffast-math -DCB_AUTOCONF -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT wxsmediactrl.lo -MD -MP -MF .deps/wxsmediactrl.Tpo -c -o wxsmediactrl.lo `test -f './wxsmediactrl.cpp' || echo './'`./wxsmediactrl.cpp                                               
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../../../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../../../../../src/include -I../../../../../../src/sdk/wxscintilla/include -I../../../../../../src/sdk/wxpropgrid/include -DWXMAKINGDLL_PROPGRID -DwxPG_USE_WXMODULE=0 -Ulinux -Uunix -O2 -ffast-math -DCB_AUTOCONF -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT wxsmediactrl.lo -MD -MP -MF .deps/wxsmediactrl.Tpo -c ./wxsmediactrl.cpp  -fPIC -DPIC -o .libs/wxsmediactrl.o                                                                                                                   
./wxsmediactrl.cpp: In constructor ‘wxsMediaCtrl::wxsMediaCtrl(wxsItemResData*)’:                                                             
./wxsmediactrl.cpp:55: error: ‘wxMEDIACTRLPLAYERCONTROLS_DEFAULT’ was not declared in this scope                                             
./wxsmediactrl.cpp: In member function ‘virtual void wxsMediaCtrl::OnBuildCreatingCode()’:                                                   
./wxsmediactrl.cpp:104: error: ‘wxMEDIACTRLPLAYERCONTROLS_NONE’ was not declared in this scope                                               
./wxsmediactrl.cpp:107: error: ‘wxMEDIACTRLPLAYERCONTROLS_STEP’ was not declared in this scope
./wxsmediactrl.cpp:110: error: ‘wxMEDIACTRLPLAYERCONTROLS_VOLUME’ was not declared in this scope
./wxsmediactrl.cpp:113: error: ‘wxMEDIACTRLPLAYERCONTROLS_DEFAULT’ was not declared in this scope
./wxsmediactrl.cpp: In member function ‘virtual wxObject* wxsMediaCtrl::OnBuildPreview(wxWindow*, long int)’:
./wxsmediactrl.cpp:148: error: ‘wxMediaCtrl’ was not declared in this scope
./wxsmediactrl.cpp:148: error: ‘preview’ was not declared in this scope
./wxsmediactrl.cpp:148: error: expected type-specifier before ‘wxMediaCtrl’
./wxsmediactrl.cpp:148: error: expected ‘;’ before ‘wxMediaCtrl’
./wxsmediactrl.cpp:164: error: ‘wxMEDIACTRLPLAYERCONTROLS_NONE’ was not declared in this scope
./wxsmediactrl.cpp:167: error: ‘wxMEDIACTRLPLAYERCONTROLS_STEP’ was not declared in this scope
./wxsmediactrl.cpp:170: error: ‘wxMEDIACTRLPLAYERCONTROLS_VOLUME’ was not declared in this scope
./wxsmediactrl.cpp:173: error: ‘wxMEDIACTRLPLAYERCONTROLS_DEFAULT’ was not declared in this scope
./wxsmediactrl.cpp: In member function ‘virtual void wxsMediaCtrl::OnEnumWidgetProperties(long int)’:
./wxsmediactrl.cpp:196: error: ‘wxMEDIACTRLPLAYERCONTROLS_NONE’ was not declared in this scope
./wxsmediactrl.cpp:197: error: ‘wxMEDIACTRLPLAYERCONTROLS_STEP’ was not declared in this scope
./wxsmediactrl.cpp:198: error: ‘wxMEDIACTRLPLAYERCONTROLS_VOLUME’ was not declared in this scope
./wxsmediactrl.cpp:199: error:

"wxMEDIACTRLPLAYERCONTROLS_NONE" and others [enum wxMediaCtrlPlayerControls] are declared in wx/mediactrl.h, which is being included.
At first glance the only thing that could prohibit this [looking inside that header file] :
Code
#if wxUSE_MEDIACTRL

// ----------------------------------------------------------------------------
// Includes
// ----------------------------------------------------------------------------

#include "wx/control.h"
#include "wx/uri.h"

// ============================================================================
// Declarations
// ============================================================================

// ----------------------------------------------------------------------------
//
// Enumerations
//
// ----------------------------------------------------------------------------

enum wxMediaState
{
    wxMEDIASTATE_STOPPED,
    wxMEDIASTATE_PAUSED,
    wxMEDIASTATE_PLAYING
};

enum wxMediaCtrlPlayerControls
{
    wxMEDIACTRLPLAYERCONTROLS_NONE           =   0,
    //Step controls like fastfoward, step one frame etc.
    wxMEDIACTRLPLAYERCONTROLS_STEP           =   1 << 0,
    //Volume controls like the speaker icon, volume slider, etc.
    wxMEDIACTRLPLAYERCONTROLS_VOLUME         =   1 << 1,
    wxMEDIACTRLPLAYERCONTROLS_DEFAULT        =
                    wxMEDIACTRLPLAYERCONTROLS_STEP |
                    wxMEDIACTRLPLAYERCONTROLS_VOLUME
};

...

is :
Code
#if wxUSE_MEDIACTRL
And indeed it is NOT defined at the moment wxsmediactrl.cpp is being build (added the following snippet to that cpp file).
Code
#if wxUSE_MEDIACTRL
//
#else
# error no wxUSE_MEDIACTRL
#endif

-->
Code
./wxsmediactrl.cpp:30:3: error: #error no wxUSE_MEDIACTRL
./wxsmediactrl.cpp: In constructor ‘wxsMediaCtrl::wxsMediaCtrl(wxsItemResData*)’:
./wxsmediactrl.cpp:60: error: ‘wxMEDIACTRLPLAYERCONTROLS_DEFAULT’ was not declared in this scope
...

so we need to look into that direction.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Compilation issues due to wxMEDIACTRLPLAYERCONTROLS_* in r6414
« Reply #3 on: July 24, 2010, 11:09:10 am »
info : on my OpenSuse 11.3 32 bit it builds ok.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Compilation issues due to wxMEDIACTRLPLAYERCONTROLS_* in r6414
« Reply #4 on: July 24, 2010, 11:15:44 am »
This patch works for me:
Code
Index: src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsmediactrl.h
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsmediactrl.h (Revision 6414)
+++ src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsmediactrl.h (Arbeitskopie)
@@ -20,8 +20,11 @@
 #ifndef WXMEDIACTRL_H
 #define WXMEDIACTRL_H
 
+#if wxUSE_MEDIACTRL
+
 #include "../wxswidget.h"
 
+
 /** \brief Class for wxMediaCtrl widget */
 class wxsMediaCtrl: public wxsWidget
 {
@@ -45,4 +48,6 @@
 
 };
 
+#endif // wxUSE_MEDIACTRL
+
 #endif // WXMEDIACTRL_H
Index: src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsmediactrl.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsmediactrl.cpp (Revision 6414)
+++ src/plugins/contrib/wxSmith/wxwidgets/defitems/wxsmediactrl.cpp (Arbeitskopie)
@@ -22,6 +22,9 @@
 */
 
 #include "wxsmediactrl.h"
+
+#if wxUSE_MEDIACTRL
+
 #include "wx/mediactrl.h"
 
 
@@ -205,3 +208,4 @@
  WXS_ENUM(wxsMediaCtrl, m_iVolume,  _("Volume"), _T("volume"), VolumeLevels, VolumeNames, 5)
 }
 
+#endif // wxUSE_MEDIACTRL

I think we should do this for all items that might be undefined, to avoid further errors.

EDIT:

I was able to compile, but got a runtime-error about an undefined symbol (after setting additional debug-log on true in OnInit), that leads to not loading wxSmith and the dependent plugins.
« Last Edit: July 24, 2010, 11:18:14 am by jens »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Compilation issues due to wxMEDIACTRLPLAYERCONTROLS_* in r6414
« Reply #5 on: July 24, 2010, 01:04:05 pm »
If I add `wx-config --libs media` to the link options it works also (and I have wxMediaCtrl available).
debian 64-bit with wxWidgets 2.8.11 from apt.wxwidgets.org .

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Compilation issues due to wxMEDIACTRLPLAYERCONTROLS_* in r6414
« Reply #6 on: July 25, 2010, 01:13:58 pm »
Can you test the attached patch (it's for automake-system and C::B workspace) ?
I don 't know what happens if the media-lib does not exist and I have no possibility to test it at the moment.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Compilation issues due to wxMEDIACTRLPLAYERCONTROLS_* in r6414
« Reply #7 on: July 25, 2010, 09:40:55 pm »
If I add `wx-config --libs media` to the link options it works also (and I have wxMediaCtrl available).
This works very well for me on Unix, too. I've submitted this as a "hotfix" for the moment. Still need to test the automake patch of yours... but it basically does the same thing, right?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Compilation issues due to wxMEDIACTRLPLAYERCONTROLS_* in r6414
« Reply #8 on: July 26, 2010, 06:48:07 am »
If I add `wx-config --libs media` to the link options it works also (and I have wxMediaCtrl available).
This works very well for me on Unix, too. I've submitted this as a "hotfix" for the moment. Still need to test the automake patch of yours... but it basically does the same thing, right?!
Yes !
It also adds the if wxUSE_MEDIACTRL in the appropriate files for the case wxMediaCtrl is not available at all.
Lieven's first post looks like uch a case.
If the lib does not exist, it will most likely lead to linker errors.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Compilation issues due to wxMEDIACTRLPLAYERCONTROLS_* in r6414
« Reply #9 on: July 26, 2010, 07:22:26 am »
It also adds the if wxUSE_MEDIACTRL in the appropriate files for the case wxMediaCtrl is not available at all.
Lieven's first post looks like uch a case.
So it seems to compile/work just fine that way, too. However (like you) I was unable to try what happens if the lib dos not exist, because on my Linux  it does always... no matter what wx distro I use. So I assume unless you compile wx yourself setting this explicitly to "off" it it should work. And if you compiled it yourself and turned it off on purpose I guess you wouldn't wonder if compilation / linking against that lib fails.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Mephistopheles

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: Compilation issues due to wxMEDIACTRLPLAYERCONTROLS_* in r6414
« Reply #10 on: July 26, 2010, 05:05:51 pm »
Can you test the attached patch (it's for automake-system and C::B workspace) ?
I don 't know what happens if the media-lib does not exist and I have no possibility to test it at the moment.
With your patch my builds now fail with "ld: cannot find -lwx_gtk2u_media-2.8".

EDIT: FWIW, I have libwx_gtk2u_mmedia-2.8.so.0 - note the "_mmedia-" instead of "_media-".
« Last Edit: July 26, 2010, 06:08:27 pm by Mephistopheles »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Compilation issues due to wxMEDIACTRLPLAYERCONTROLS_* in r6414
« Reply #11 on: July 28, 2010, 10:56:32 am »
I just found this bug : https://bugzilla.novell.com/show_bug.cgi?id=565039.

Seems not to be fixed in all versions.

We have two possibilities:
either ignore this (and fix the automake-files to use it), the maintainers or users have to prevent wxMediaCtrl from being compiled in (if it is not available),
or (temporarily ?) abandon wxMediaCtrl.

Suggestions are welcome.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Compilation issues due to wxMEDIACTRLPLAYERCONTROLS_* in r6414
« Reply #12 on: July 28, 2010, 01:02:31 pm »
Quoting wx-2.9.1  changelog-

Quote
Also the "applet", "deprecated", "fl", "mmedia" and "plot" contrib libraries
were removed as they were unmaintained and broken since several years.
The "gizmos", "ogl", "net" and "foldbar" contribs have been moved to
wxCode (see http://wxcode.sourceforge.net/complist.php); they are now
open for futher development by volunteers.

This gives us two options.

1) Import wxMediaCtrl source to trunk and use that. However we have to deal with the situation where we need to avoid wx installed libraries.
2) We abandon wxMediaCtrl addin to wxSmith for the time being. When we move to wx-3, we import respective source from wxCode and use it.

Personally I prefer option 2.
Be a part of the solution, not a part of the problem.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Compilation issues due to wxMEDIACTRLPLAYERCONTROLS_* in r6414
« Reply #13 on: July 28, 2010, 01:33:08 pm »
mmedia is not the same as media.
The wx2.8 libs from apt.wxwdigets.org contain both of them (the wx2.6 libs from debian also have both).

The official wx2.8 from debian testing does not contain any *media* library and wxUSE_MEDIACTRL is defined as 0 and not as 1.

That means I also can not use wxMediaCtrl for my debian nightlies, or "my" users have to use the packages from apt.wxwidgets.org, even if wx2.8.10 is in debian testing.

That would break some of the packages that use wxPython and is therefore not a real good solution.

As far as I know wxMediaCtrl can not do much (or anything ?) without native backends, so I'm not sure whether we really need it in wxSmith.
At the moment it seems to bring more problems than advantages.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Compilation issues due to wxMEDIACTRLPLAYERCONTROLS_* in r6414
« Reply #14 on: July 28, 2010, 01:38:18 pm »
I would remove it for the moment. As mentioned above, currently to much problems, and for over a week now a broken build.
Let's remove it for the moment, and then carefully look at our options ...