User forums > Using Code::Blocks

Codeblocks doesn't save project

<< < (2/2)

killerbot:
looking at the changes, the 0 arguments are lo longer passed, and have no a default value in the function.

But the problem is :
But where in the past attributes would have been added, now they are only added to a local variable, which is not used afterwards. So that's an error for sure !!! And this is the cause !!!


--- Code: ---TiXmlElement* ProjectLoader::AddElement(TiXmlElement* parent, const char* name, const char* attr, const wxString& attribute)
{
    TiXmlElement elem(name);

    if (attr)
        elem.SetAttribute(attr, cbU2C(attribute));

    //return parent->InsertEndChild(TiXmlElement(name))->ToElement();
    return static_cast<TiXmlElement*>(parent->InsertEndChild(TiXmlElement(name)));
}

--- End code ---

This should be :


--- Code: ---TiXmlElement* ProjectLoader::AddElement(TiXmlElement* parent, const char* name, const char* attr, const wxString& attribute)
{
    TiXmlElement elem(name);

    if (attr)
        elem.SetAttribute(attr, cbU2C(attribute));

   /return parent->InsertEndChild(elem)->ToElement();
}

--- End code ---


and

--- Code: ---TiXmlElement* ProjectLoader::AddElement(TiXmlElement* parent, const char* name, const char* attr, int attribute)
{
    TiXmlElement elem(name);

    if (attr)
        elem.SetAttribute(attr, attribute);

    //return parent->InsertEndChild(TiXmlElement(name))->ToElement();
    return static_cast<TiXmlElement*>(parent->InsertEndChild(TiXmlElement(name)));
}

--- End code ---

should be changed into :


--- Code: ---TiXmlElement* ProjectLoader::AddElement(TiXmlElement* parent, const char* name, const char* attr, int attribute)
{
    TiXmlElement elem(name);

    if (attr)
        elem.SetAttribute(attr, attribute);

    return parent->InsertEndChild(elem)->ToElement();
}

--- End code ---

killerbot:
@Thomas, I will commit this, in case you anted i different , feel free to change it ;-)
Done, and it works again.

killerbot:
I have the feeling not all problems are gone yet. I create a new project (tried it out on linux), project is saved (looks ok), but can't be loaded afterwards ... :-(

EDIT :
this is the project file (created new console project) :

--- Code: ---<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="DeleteMeTest" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="./DeleteMeTest" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="./DeleteMeTest" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
</Compiler>
<Unit filename="main.cpp" />
<Extensions ="">
<code_completion />
</Extensions>
</Project>
</CodeBlocks_project_file>

--- End code ---
I compared it with another project file (similar project), it looks the same (only the project name is different and as such output filename) : but CB refuses to open it, says it can't and if i want to remove it from the recent list. Properties in linux claims there are 86 words, and my other older project (that still opens ok) has 85 words. I just don't see it ...

killerbot:
aha found it :

--- Code: ---<Extensions ="">
--- End code ---

should be :

--- Code: ---<Extensions>
--- End code ---

this is probably due to all those 'default' arguments !!!

EDIT :
fixed and committed

bugmenot:
thanks guys :)

Navigation

[0] Message Index

[*] Previous page

Go to full version