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