• [MODULE] Another question with compile errors
    4 replies, posted
When I'm compiling my module in visual studio I get the following compiling errors: [CODE] Error 5 error C2059: syntax error : ')' C:\Users\Computer\Documents\compiler\source\sourcesdk-minimal\public\tier1\tier1\KeyValues.cpp 1767 1 tier1 Error 10 error C2059: syntax error : ')' C:\Users\Computer\Documents\compiler\source\sourcesdk-minimal\public\tier1\tier1\KeyValues.cpp 1784 1 tier1 Error 1 error C2143: syntax error : missing ')' before '{' C:\Users\Computer\Documents\compiler\source\sourcesdk-minimal\public\tier1\tier1\KeyValues.cpp 1767 1 tier1 Error 6 error C2143: syntax error : missing ')' before '{' C:\Users\Computer\Documents\compiler\source\sourcesdk-minimal\public\tier1\tier1\KeyValues.cpp 1784 1 tier1 Error 3 error C2143: syntax error : missing ';' before '{' C:\Users\Computer\Documents\compiler\source\sourcesdk-minimal\public\tier1\tier1\KeyValues.cpp 1767 1 tier1 Error 8 error C2143: syntax error : missing ';' before '{' C:\Users\Computer\Documents\compiler\source\sourcesdk-minimal\public\tier1\tier1\KeyValues.cpp 1784 1 tier1 Error 4 error C2143: syntax error : missing ';' before '}' C:\Users\CaComputersey\Documents\compiler\source\sourcesdk-minimal\public\tier1\tier1\KeyValues.cpp 1767 1 tier1 Error 9 error C2143: syntax error : missing ';' before '}' C:\Users\Computer\Documents\compiler\source\sourcesdk-minimal\public\tier1\tier1\KeyValues.cpp 1784 1 tier1 Error 2 error C2660: 'CUtlQueue<T>::Insert' : function does not take 0 arguments C:\Users\Computer\Documents\compiler\source\sourcesdk-minimal\public\tier1\tier1\KeyValues.cpp 1767 1 tier1 Error 7 error C2660: 'CUtlQueue<T>::Insert' : function does not take 0 arguments C:\Users\Computer\Documents\compiler\source\sourcesdk-minimal\public\tier1\tier1\KeyValues.cpp 1784 1 tier1 [/CODE] Relevant lines [CODE] void KeyValues::CopyKeyValuesFromRecursive( const KeyValues& rootSrc ) { // This code used to be recursive, which was more elegant. Unfortunately, it also blew the stack for large // KeyValues. So now we have the iterative version which is uglier but doesn't blow the stack. // This uses breadth-first traversal. struct CopyStruct { KeyValues* dst; const KeyValues* src; }; char tmp[256]; KeyValues* localDst = NULL; CUtlQueue<CopyStruct> nodeQ; nodeQ.Insert({ this, &rootSrc }); // Error #1 is here while ( nodeQ.Count() > 0 ) { CopyStruct cs = nodeQ.RemoveAtHead(); // Process all the siblings of the current node. If anyone has a child, add it to the queue. while (cs.src) { Assert( (cs.src != NULL) == (cs.dst != NULL) ); // Copy the node contents cs.dst->CopyKeyValue( *cs.src, sizeof(tmp), tmp ); // Add children to the queue to process later. if (cs.src->m_pSub) { cs.dst->m_pSub = localDst = new KeyValues( NULL ); nodeQ.Insert({ localDst, cs.src->m_pSub }); // Error #2 is here } // Process siblings until we hit the end of the line. if (cs.src->m_pPeer) { cs.dst->m_pPeer = new KeyValues( NULL ); } else { cs.dst->m_pPeer = NULL; } // Advance to the next peer. cs.src = cs.src->m_pPeer; cs.dst = cs.dst->m_pPeer; } } }[/CODE]
I don't believe you can declare arrays implicitly like that into a method call.
[QUOTE=Handsome Matt;52086237]you're not giving very much info, what compiler r u using for example[/QUOTE] Visual Studio 2010 [QUOTE=code_gs;52086196]I don't believe you can declare arrays implicitly like that into a method call.[/QUOTE] This is a default file in the valve's sourcesdk files. Am I maybe missing something?
Your repo is outdated. This is in the latest commit as a solution for older compilers. [CODE]#if _MSC_VER < 1800 CopyStruct temp = { this, &rootSrc }; nodeQ.Insert( temp ); #else nodeQ.Insert({ this, &rootSrc }); #endif[/CODE]
Sorry, you need to Log In to post a reply to this thread.