Quantcast
Channel: Civilization Fanatics' Forums
Viewing all articles
Browse latest Browse all 12856

Compiling Planetfall dll problem

$
0
0
Recently, I've decided to modify the SDK code for the Planetfall mod to fix an unintended feature (pillaging bases under Council Membership) but I've run into some problems trying to compile the code.

The thing is, to my understanding, the code was intended to be compiled using Visual C++ 2005, but I'm using Visual C++ 2008. This has led to several compliance errors. I've addressed most of them, but the last five I cannot figure out how to fix.

This problem occurs in PlanetValueEventHandler.cpp.

Code:
Spoiler:
Code:

void PlanetValueEventHandler::unregisterPlanetEvent(std::string szRegistrationName)
{
        FloweringCounterRegistrationIterator iterator;

        if (m_lookup.count(szRegistrationName) == 0)
        {
                throw "Name not found to unregister";
        }

        iterator = getIteratorForRegistration(szRegistrationName);

        if (iterator != NULL)
        {
                m_registrationMap.erase(iterator);
                m_lookup.erase(szRegistrationName);
        }
}



Error:
Spoiler:
1>.\PlanetValueEventHandler.cpp(74) : error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'FloweringCounterRegistrationIterator' (or there is no acceptable conversion)
1> C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\guiddef.h(197): could be 'int operator !=(const GUID &,const GUID &)'
1> C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xtree(314): or 'bool std::_Tree<_Traits>::const_iterator::operator !=(const std::_Tree<_Traits>::const_iterator &) const'
1> with
1> [
1> _Traits=std::_Tmap_traits<int,PlanetEventRegistrat ionStruct,std::less<int>,std::allocator<std::pair< const int,PlanetEventRegistrationStruct>>,true>
1> ]
1> while trying to match the argument list '(FloweringCounterRegistrationIterator, int)'

That occurs in three other similar instances.


This is the other error.
Code:
Spoiler:
Code:

FloweringCounterRegistrationIterator PlanetValueEventHandler::getIteratorForRegistration(std::string szRegistrationName)
{
        FloweringCounterRegistrationIterator lowerBound, upperBound, iterator;

        if (m_lookup.count(szRegistrationName) == 0)
        {
                throw "Name not found";
        }
       
        // Find the range that it will be hiding in.
        int iFloweringCounter = m_lookup.find(szRegistrationName)->second;

        // Iterate through all the events for that planet value's range. When we find what we're looking for, return it.
        lowerBound = m_registrationMap.lower_bound(iFloweringCounter);
        upperBound = m_registrationMap.upper_bound(iFloweringCounter);
        for (iterator = lowerBound; iterator != upperBound; ++iterator)
        {
                if (iterator->second.m_szRegistrationName == szRegistrationName)
                {
                        break;
                }
        }

        if (iterator == upperBound)
        {
                return NULL;
        }

        return iterator;
}



Error:
Spoiler:
1>.\PlanetValueEventHandler.cpp(112) : error C2664: 'std::_Tree<_Traits>::iterator::iterator(const std::_Tree<_Traits>::iterator &)' : cannot convert parameter 1 from 'int' to 'const std::_Tree<_Traits>::iterator &'
1> with
1> [
1> _Traits=std::_Tmap_traits<int,PlanetEventRegistrat ionStruct,std::less<int>,std::allocator<std::pair< const int,PlanetEventRegistrationStruct>>,true>
1> ]
1> Reason: cannot convert from 'int' to 'const std::_Tree<_Traits>::iterator'
1> with
1> [
1> _Traits=std::_Tmap_traits<int,PlanetEventRegistrat ionStruct,std::less<int>,std::allocator<std::pair< const int,PlanetEventRegistrationStruct>>,true>
1> ]
1> No constructor could take the source type, or constructor overload resolution was ambiguous


Any help would be appreciated.

Viewing all articles
Browse latest Browse all 12856

Trending Articles