Compiling Error on OpenSuse 11.3

Get help with installing and running the Cafu Engine here. This forum is also for general questions and discussion of all aspects regarding the Cafu Engine.
Post Reply
volto
Posts: 12
Joined: 2011-01-19, 19:06
Location: Germany (NDS)

Compiling Error on OpenSuse 11.3

Post by volto » 2011-01-19, 19:27

Hi all together,
i have a OpenSuse 11.3 System installet all needed Development Packages are installes (I Hope)

The Error i recive is

Code: Select all

CaWE/FontWizard/FontWizard.cpp: In constructor FontWizardT::FontWizardT(wxWindow*)':
CaWE/FontWizard/FontWizard.cpp:34:116: error: cannot call constructor wxBitmap::wxBitmap' directly
CaWE/FontWizard/FontWizard.cpp:34:116: error:   for a function-style cast, remove the redundant '::wxBitmap'
The wxGTK-devel Package are in version 2.8.10.1

i Hope The informations Help to Clear my compiling problems...

MfG volto
User avatar
Carsten
Site Admin
Posts: 2160
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Compiling Error on OpenSuse 11.3

Post by Carsten » 2011-01-20, 01:10

Hi volto,
welcome to the Cafu forums! :welcome:
volto wrote:

Code: Select all

CaWE/FontWizard/FontWizard.cpp: In constructor FontWizardT::FontWizardT(wxWindow*)':
CaWE/FontWizard/FontWizard.cpp:34:116: error: cannot call constructor wxBitmap::wxBitmap' directly
CaWE/FontWizard/FontWizard.cpp:34:116: error:   for a function-style cast, remove the redundant '::wxBitmap'
This is interesting. The error message seems to be correct and to the point, but I'm surprised that no other compiler has detected this so far, or said the other way round, that all compilers that we normally use seem to accept this without further notice.

Have you tried if it works when you do what the message suggests, i.e. replace

Code: Select all

wxBitmap::wxBitmap("CaWE/res/FontWizard.png", wxBITMAP_TYPE_PNG)
with

Code: Select all

wxBitmap("CaWE/res/FontWizard.png", wxBITMAP_TYPE_PNG)
?

Please let me know what compiler you use, I'd be very interested?
And of course if it works with the above change, and if there are more places like this?
The wxGTK-devel Package are in version 2.8.10.1
Cafu comes with its own (v 2.9.1+) copy of wxWidgets, so the wxGTK-devel package is not used at all.

Thanks for reporting this, I hope the above solution helps.
Btw., if you use Subversion, you can also run svn update - I've just committed the above change into the repository as well. :up:
Best regards,
Carsten
volto
Posts: 12
Joined: 2011-01-19, 19:06
Location: Germany (NDS)

Re: Compiling Error on OpenSuse 11.3

Post by volto » 2011-01-20, 09:05

Thanks for this Solution Carsten. After the svn update is this Error message not more reported i use out of the g++ Compiler out the OpenSuse Repos the g++ -v Message turns out like this.

Code: Select all

# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i586-suse-linux/4.5/lto-wrapper
Target: i586-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.5 --enable-ssp --disable-libssp --disable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --program-suffix=-4.5 --enable-linux-futex --without-system-libunwind --enable-gold --with-plugin-ld=/usr/bin/gold --with-arch-32=i586 --with-tune=generic --build=i586-suse-linux
Thread model: posix
gcc version 4.5.0 20100604 [gcc-4_5-branch revision 160292] (SUSE Linux) 

At this point i shut have to lern more over the Error Messages of the Compilers


MfG volto
At the next Compiling Round i have there Errors hope that i can find a Solution but a Message is it value

Code: Select all

ExtLibs/lua/build/linux2/g++/release/liblua.a(loslib.o): In function `os_tmpname':
loslib.c:(.text+0x16): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
build/linux2/g++/release/CaWE/Camera.o: In function `CameraT::SetLookAtPos(Vector3T<float> const&)':
Camera.cpp:(.text+0x434): undefined reference to `cf::math::AnglesT<float>::PI'
Camera.cpp:(.text+0x509): undefined reference to `cf::math::AnglesT<float>::PI'
build/linux2/g++/release/CaWE/DialogEditSurfaceProps.o: In function `EditSurfacePropsDialogT::SetSurfaceInfo(MapFaceT const*, SurfaceInfoT&, EditorMaterialI**, EditSurfacePropsDialogT::RightMBClickModeT, EditSurfacePropsDialogT::ApplySettingT, ViewWindow3DT*) const':
DialogEditSurfaceProps.cpp:(.text+0x136d): undefined reference to `cf::math::AnglesT<float>::PI'
build/linux2/g++/release/CaWE/Generic3DWindow.o: In function `Generic3DWindowT::ProcessInput(float)':
Generic3DWindow.cpp:(.text+0x1012): undefined reference to `cf::math::AnglesT<float>::PI'
build/linux2/g++/release/CaWE/MapBrush.o: In function `ComputeEllipse(BoundingBox3T<float> const&, unsigned long)':
MapBrush.cpp:(.text+0x2232): undefined reference to `cf::math::AnglesT<double>::PI'
build/linux2/g++/release/CaWE/MapBrush.o: In function `MapBrushT::CreateSphere(BoundingBox3T<float> const&, unsigned long, EditorMaterialI*)':
MapBrush.cpp:(.text+0x9b9e): undefined reference to `cf::math::AnglesT<double>::PI'
build/linux2/g++/release/CaWE/TrafoBox.o: In function `TrafoBoxT::UpdateTrafo(ViewWindow2DT const&, wxPoint const&, bool)':
TrafoBox.cpp:(.text+0x13c8): undefined reference to `cf::math::AnglesT<float>::PI'
TrafoBox.cpp:(.text+0x1494): undefined reference to `cf::math::AnglesT<float>::PI'
build/linux2/g++/release/CaWE/GuiEditor/ToolSelection.o: In function `GuiEditor::ToolSelectionT::OnLMouseDown(GuiEditor::RenderWindowT*, wxMouseEvent&)':
ToolSelection.cpp:(.text+0x423): undefined reference to `cf::math::AnglesT<float>::PI'
build/linux2/g++/release/CaWE/GuiEditor/ToolSelection.o: In function `GuiEditor::ToolSelectionT::OnMouseMove(GuiEditor::RenderWindowT*, wxMouseEvent&)':
ToolSelection.cpp:(.text+0x116c): undefined reference to `cf::math::AnglesT<float>::PI'
Libs/build/linux2/g++/release/libcfsLib.a(Matrix3x3.o): In function `cf::math::Matrix3x3T<float>::Matrix3x3T(cf::math::AnglesT<float> const&)':
Matrix3x3.cpp:(.text._ZN2cf4math10Matrix3x3TIfEC2ERKNS0_7AnglesTIfEE[_ZN2cf4math10Matrix3x3TIfEC5ERKNS0_7AnglesTIfEE]+0x17): undefined reference to `cf::math::AnglesT<float>::PI'
Libs/build/linux2/g++/release/libcfsLib.a(Matrix3x3.o):Matrix3x3.cpp:(.text._ZN2cf4math10Matrix3x3TIfE16GetRotateXMatrixEf[cf::math::Matrix3x3T<float>::GetRotateXMatrix(float)]+0x17): more undefined references to `cf::math::AnglesT<float>::PI' follow
Libs/build/linux2/g++/release/libcfsLib.a(Matrix3x3.o): In function `cf::math::Matrix3x3T<double>::Matrix3x3T(cf::math::AnglesT<double> const&)':
Matrix3x3.cpp:(.text._ZN2cf4math10Matrix3x3TIdEC2ERKNS0_7AnglesTIdEE[_ZN2cf4math10Matrix3x3TIdEC5ERKNS0_7AnglesTIdEE]+0x17): undefined reference to `cf::math::AnglesT<double>::PI'
Libs/build/linux2/g++/release/libcfsLib.a(Matrix3x3.o): In function `cf::math::Matrix3x3T<double>::GetRotateXMatrix(double)':
Matrix3x3.cpp:(.text._ZN2cf4math10Matrix3x3TIdE16GetRotateXMatrixEd[cf::math::Matrix3x3T<double>::GetRotateXMatrix(double)]+0x31): undefined reference to `cf::math::AnglesT<double>::PI'
Libs/build/linux2/g++/release/libcfsLib.a(Matrix3x3.o): In function `cf::math::Matrix3x3T<double>::GetRotateYMatrix(double)':
Matrix3x3.cpp:(.text._ZN2cf4math10Matrix3x3TIdE16GetRotateYMatrixEd[cf::math::Matrix3x3T<double>::GetRotateYMatrix(double)]+0x32): undefined reference to `cf::math::AnglesT<double>::PI'
Libs/build/linux2/g++/release/libcfsLib.a(Matrix3x3.o): In function `cf::math::Matrix3x3T<double>::GetRotateZMatrix(double)':
Matrix3x3.cpp:(.text._ZN2cf4math10Matrix3x3TIdE16GetRotateZMatrixEd[cf::math::Matrix3x3T<double>::GetRotateZMatrix(double)]+0x32): undefined reference to `cf::math::AnglesT<double>::PI'
Libs/build/linux2/g++/release/libcfsLib.a(Matrix3x3.o): In function `cf::math::Matrix3x3T<double>::GetRotateMatrix(double, Vector3T<double> const&)':
Matrix3x3.cpp:(.text._ZN2cf4math10Matrix3x3TIdE15GetRotateMatrixEdRK8Vector3TIdE[cf::math::Matrix3x3T<double>::GetRotateMatrix(double, Vector3T<double> const&)]+0x1c): undefined reference to `cf::math::AnglesT<double>::PI'
Libs/build/linux2/g++/release/libcfsLib.a(Matrix3x3.o):Matrix3x3.cpp:(.text._ZN2cf4math10Matrix3x3TIdE20GetFromAngles_COMPATERKNS0_7AnglesTIdEE[cf::math::Matrix3x3T<double>::GetFromAngles_COMPAT(cf::math::AnglesT<double> const&)]+0x17): more undefined references to `cf::math::AnglesT<double>::PI' follow
collect2: ld returned 1 exit status
scons: *** [build/linux2/g++/release/CaWE/CaWE] Error 1
scons: building terminated because of errors.

User avatar
Carsten
Site Admin
Posts: 2160
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Compiling Error on OpenSuse 11.3

Post by Carsten » 2011-01-20, 12:24

These are linker errors, but I somehow suspect it's an optimization-related compiler bug, possibly this one.

Does building the debug variant succeed?

By default, SCons builds both the debug and the release variants, but you can build debug only
  • if you edit the CompilerSetup.py file and replace "dr" with "r":

    Code: Select all

    buildVariants="d";
  • or if you run SCons with the bv parameter, e.g.

    Code: Select all

    scons bv=d
If building the debug variants fails as well, please post the error messages again, including the last (possibly lengthy!) preceeding compiler call. (If in doubt, please use http://pastebin.com/ ) :up:
Best regards,
Carsten
volto
Posts: 12
Joined: 2011-01-19, 19:06
Location: Germany (NDS)

Re: Compiling Error on OpenSuse 11.3

Post by volto » 2011-01-20, 19:44

No The debug sequence

Code: Select all

scons bv=d
ends too with a Error i have placed on a Extern Website (Not http://pastebin.com/ then i dont have the Control over the Elements i posted)
http://wiki-de.mattmedia-net.de/fileadm ... Error.html
User avatar
Carsten
Site Admin
Posts: 2160
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Compiling Error on OpenSuse 11.3

Post by Carsten » 2011-01-21, 00:19

Ok, thanks for posting the details!
Could you please svn update and try again?

I've just committed a change that I believe should fix the issue (as before, I cannot reproduce this here), please let us know if it works. :-)

Btw., I'll be out of office tomorrow (Friday) and Saturday, but I'll continue to look into this as soon as I'm back on Sunday morning. :cheesy:
Best regards,
Carsten
volto
Posts: 12
Joined: 2011-01-19, 19:06
Location: Germany (NDS)

Re: Compiling Error on OpenSuse 11.3

Post by volto » 2011-01-21, 07:30

Thanks this last Change was the crux of the matter
both Variants ist now Compiled at My System what vor informations is need to reproduce or Analyse the Source of the Different Compiling results?

MfG volto
User avatar
Carsten
Site Admin
Posts: 2160
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Compiling Error on OpenSuse 11.3

Post by Carsten » 2011-01-23, 11:53

volto wrote:Thanks this last Change was the crux of the matter
both Variants ist now Compiled at My System
That's great to hear, thanks!!
what vor informations is need to reproduce or Analyse the Source of the Different Compiling results?
Uhh, sorry, I don't quite understand this question...
The debug build is without optimizations and with debug symbols, I always use it during development.
The release build is with optimizations and no debug symbols, this one is shipped to end users.
Best regards,
Carsten
volto
Posts: 12
Joined: 2011-01-19, 19:06
Location: Germany (NDS)

Re: Compiling Error on OpenSuse 11.3

Post by volto » 2011-01-23, 12:24

Hi the debug Symbols use the Most Programmers too.
but i meen the Information over my System or the Comiler,.... to this stadium that are Errors like the Definition of PI in a Class less Template or was the Class override Template?

I think this Errors shut posiblie visible on other Systems to but why there are not to reproduce on your system?
User avatar
Carsten
Site Admin
Posts: 2160
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Compiling Error on OpenSuse 11.3

Post by Carsten » 2011-01-23, 13:03

volto wrote:I think this Errors shut posiblie visible on other Systems to but why there are not to reproduce on your system?
Well, I don't know.
The previous code compiled and linked with Visual C++ 2005, 2008 and 2010, and g++ <= 4.4. On the other hand, it was probably a border case of the C++ standard that the stricter g++ 4.5 uncovered.
Best regards,
Carsten
crazzykid
Posts: 1
Joined: 2011-06-02, 17:48

Re: Compiling Error on OpenSuse 11.3

Post by crazzykid » 2011-06-02, 18:15

Had the same problem with Ubuntu 11.04 64bit and downloading
http://www.cafu.de/files/Cafu-src-r210.tar.gz

Code: Select all

CaWE/FontWizard/FontWizard.cpp: In constructor FontWizardT::FontWizardT(wxWindow*)':
CaWE/FontWizard/FontWizard.cpp:34:116: error: cannot call constructor wxBitmap::wxBitmap' directly
CaWE/FontWizard/FontWizard.cpp:34:116: error:   for a function-style cast, remove the redundant '::wxBitmap'
Did exactly what it said and removed the ::wxBitmap and it compiled! :cheesy:
User avatar
Carsten
Site Admin
Posts: 2160
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Compiling Error on OpenSuse 11.3

Post by Carsten » 2011-06-03, 12:05

Hi crazzykid,
welcome to the Cafu forums! :welcome:

and thanks for your feed-back.
Please note that on Ubuntu 11.04, you should use Cafu r307 or newer: due to a bug in Compiz, the main windows of the programs may not open otherwise.

I'll upload a new source code archive soon, but in the meanwhile or alternatively you can also checkout the source code from the SVN repository directly. :up:
Best regards,
Carsten
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest