User forums > Using Code::Blocks
User template and output filename
fili:
1. Create a new console app (using the wizard), modify it's output target, compile, test, save as a project template (mine is 1234). Works fine, outputs 1234.exe.
2. Create a new app (using the 1234 template), check it's output target, compile.
3. Altough the project name is hahaha
4. the compiled file is still 1234.exe instead of hahaha.exe
That's the problem.
(I repeat, I'm using the nightly build. In RC2 works, as I can remember. I'll check when I get home)
[attachment deleted by admin]
Baz:
@fili
That's exactly right.
I've just been experimenting with this and found something strange. I now have 2 .exe files. One with the template name and one with the project name. It seems that if you open Project -> build options, close it, and then re-compile, the proper named exe is created. Anyway, it looks like a bug to me and at least Thomas knows about it now.
Thanks all.
sethjackson:
Yeah I can confirm it. The problem is that when you save a project as a template, the output filename is hardcoded into the project file. So no matter if you change the project name the output filename is not getting updated..... I really don't have a good understanding of cbProject/how to fix this bug or I would try to fix it myself. If anyone wants to know the problem is in templatemanager.cpp NewProjectFromUserTemplate(). Well actually the best way would probably be to fix SaveUserTemplate() so that the output filename isn't hardcoded.
fili:
I don't think it's something hardcoded. It seems to be a memory leak, because if you restart C::B and create a new project using the same template, everything works. Therefore, I think that something remains in the memory after saving the template.
Navigation
[0] Message Index
[*] Previous page
Go to full version