News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Codeblocks doesn't save project

Started by bugmenot, January 29, 2007, 02:24:59 PM

Previous topic - Next topic

bugmenot

Hi,

I use Codeblocks SVN 3547.

If I create a project, close Codeblocks and try to reopen it, all options are gone and all project files too.
The project is also renamed as "". I tried every save option, changed file permissions (linux) to rw for everyone...


</Build>
                <Compiler>
                        <Add />
                        <Add />
                </Compiler>
                <Linker>
                        <Add />
                </Linker>
                <Unit />
                <Unit />


It seems that codeblocks doesn't write the cbp file properly,

Can you help me please?

Biplab

I confirm this. It's screwing up new projects.  :(
Be a part of the solution, not a part of the problem.

tiwag

confirm that bug too (CB rev 3547),
my last backup (CB rev 3540) saves the projects well.

Biplab

Even R3545 worked fine for me. After upgrading to R3547 the problem started.
Be a part of the solution, not a part of the problem.

mandrav

r3547 seems to cause the problem. Thomas, can you double check your changes in r3547?
Be patient!
This bug will be fixed soon...

killerbot

#5
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 !!!

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)));
}


This should be :

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();
}



and
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)));
}


should be changed into :


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();
}

killerbot

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

killerbot

#7
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) :
<?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>

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

#8
aha found it :
<Extensions ="">

should be :
<Extensions>

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

EDIT :
fixed and committed

bugmenot