Can't compile latest git version on windows

I get 2 errors with the latest tip (Wed, 10 Nov 2010 20:39:34):

-juce_Component.cpp:

[code]
void Component::exitModalState (const int returnValue)
{

void messageCallback()
{
if (target.getComponent() != 0) //adding .getComponent() seems to solve the problem
target->exitModalState (result);
}

}
{[/code]

And

[code]
void Component::postCommandMessage (const int commandId)
{

void messageCallback()
{
if (target.getComponent() != 0) //adding .getComponent() seems to solve the problem
target->handleCommandMessage (commandId);
}

}[/code]

Compiled with VS2005 on windows xp.
This doesn’t affect mac os builds.

Dont you just love those old MS compilers… :evil:

Probably a better way solution would be to add an explicit comparison operator to the SafePointer class:

bool operator== (ComponentType* component) const throw() { return comp == component; } bool operator!= (ComponentType* component) const throw() { return comp != component; }

…I’ll get that sorted out.

Jules, I just tried tha latest tip and the problem is still there.

I get:

error C2326: ‘void juce::Component::exitModalState::ExitModalStateMessage::messageCallback(void)’ : function cannot access 'juce::operator !='
error C2326: ‘void juce::Component::postCommandMessage::CustomCommandMessage::messageCallback(void)’ : function cannot access ‘juce::operator !=’

I’m using the amalgamated version, with the “Include Juce Source Code Directly (Split across several files)” option for the project.

The code I checked in yesterday contained a bunch of fixes for VC6, so I think it should also work in VC2005 - give it a go.

That’s the tip I’m talking about. Same errors.

Yeesh, so it’s a VC2005-specific problem. I guess I’ll have to dig out my old copy of VC2005 and try to work out why it’s unhappy.

Any update on this? Getting the following error when compiling the Juce lib with 1.52:

..\..\src\gui\components\windows\juce_ComponentPeer.cpp(521) : error C2326: 'void juce::ComponentPeer::handleFileDragDrop::AsyncFileDropMessage::messageCallback(void)' : function cannot access 'juce::operator !='
About to grab the latest tip, I had to set up an XP virtual machine to do this with VC2005 and I’m waiting for the GIT installer itself to download as I type this. Thanks!

EDIT: the same error happens with the latest tip. Not sure what to try now. :expressionless:

Good old VC2005, producing an error that’s utter bollocks. What a surprise. Maybe it’ll work if you move that AsyncFileDropMessage class outside of the function that it’s in? Must be some idiotic scoping bug, as it definitely compiles ok in VC6, VC2008 and every other compiler in the world. (I don’t have a working installation of VC2005 at the moment to try it myself)

I’ll try that and get back to you with the results. I’ve learned to hate VC2005 with a passion. It’s definitely not your fault, and there’s no reason why this should happen, other than the Windows platform generally being complete garbage. And you’re right about it working in all the other compilers - tested and verified that here on multiple boxes as well.

If my company has to delay the release of a Windows/RTAS version of our plugin by a couple of weeks to get this all sorted, it’s not a big deal. Thanks again!

Just loaded 1.52 to VS2005. Got the same error on 'if (target != 0)'
I have changed it to:
void messageCallback()
{
if (target = 0)
{}
else
{
dropTarget->filesDropped (files, position.getX(), position.getY());
}
}
Not really comforting… but it worked.

Cheers

if (target = 0)

…ahem… polite cough…

The smart pointer has a get() method anyway, so if the compiler’s too stupid, you could write:

if (target.get() != 0)