gamedevforks / oolongengine

Automatically exported from code.google.com/p/oolongengine
2 stars 1 forks source link

Can't compile for iOS with LLVM GCC 4.2 due to questionable C++ #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Code like the following from Bullet can't be compiled with Apple LLVM 3.0 
because the code is probably incorrect C++ that skates by with regular GCC 
because GCC is too lenient and there are no standard C++ compilers in 
existence. There is a good chance this is already fixed in a more recent 
version of Bullet.

In btSoftBodyInternals.h

template <typename T>
static inline void          ZeroInitialize(T& value)
{
    static const T  zerodummy; <-- "Error: Default initialization of const type requires user provided default constructor."
    value=zerodummy;
}
1.
Set Xcode to use an iOS 5 target or set to use Apple LLVM 3.0 and try to 
compile oolong
2.
3.

What is the expected output? What do you see instead?
Expect compile without errors. Instead encounter dozens of errors that prevent 
compilation.

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by affluent...@gmail.com on 9 Sep 2011 at 4:04

GoogleCodeExporter commented 9 years ago
Here's the full list of everything I needed to do to get the Readblend demo 
working with bullet support with the IOS 5 SDK:

DisplayTextAPi.cpp
Change:
 m_pAPI = new () SDisplayTextAPI;

To:
 m_pAPI = new SDisplayTextAPI;

Steaming.h
Add #include "MemoryManager.h"

btSequentialImpulseConstraintSolver.cpp
Change:
if (rb1)
                        rb1->internalApplyImpulse(solverConstraint.m_contactNormal*rb1->getInvMass()*rb1->getLinearFactor(),-solverConstraint.m_angularComponentB,-solverConstraint.m_appliedImpulse);

To:
if (rb1)
                        rb1->internalApplyImpulse(solverConstraint.m_contactNormal*rb1->getInvMass()*rb1->getLinearFactor(),0-solverConstraint.m_angularComponentB,0-solverConstraint.m_appliedImpulse);

There are two similar lines later in the file with 
"-frictionConstraint1.m_appliedImpulse" and 
"-frictionConstraint2.m_appliedImpulse."  Add the "0" in front of them also.

btSoftBodyInternals.h
Change:
static inline void          ZeroInitialize(T& value)
{
    static const T  zerodummy;
    value=zerodummy;
}

To:
static inline void          ZeroInitialize(T& value)
{
    //static const T    zerodummy;
    //value=zerodummy;
    memset(&value,0,sizeof(T));
}

If you want iPad support - removed the "Main nib file base name (iPad)" line 
from ReadBlend-info.plist

I make no claims that any of this is "correct" - but it seems to work.

Original comment by r...@nothinglabs.com on 22 Oct 2011 at 3:18

GoogleCodeExporter commented 9 years ago
Thanks for collecting these fixes! I've ran into the same issues today, and 
your suggestions did the trick. Actually should be incorporated in the engine 
as soon as possible.
Btw, I do hope OOLong Engine has not been abandoned.

Original comment by nyisztor...@gmail.com on 22 Oct 2011 at 8:53

GoogleCodeExporter commented 9 years ago
Please send me an e-mail and I make you a contributor, so that you can commit 
your fixes.
- Wolf

Original comment by wolfgang...@gmail.com on 22 Oct 2011 at 4:22

GoogleCodeExporter commented 9 years ago
Just posted the fixes mentioned previously into the latest build.

Original comment by r...@nothinglabs.com on 23 Oct 2011 at 4:07