Menu β–Ύ β–΄

#1661 templates not working properly after 13855

Undefined
fixed
nobody
template (4)
Bug_Report
2026-10-25
2026-10-21
OktayO
No

Hi everyone,
On windows 10 or 11.
Last working release was SVN 13855, since then the issue persists.

I'm having an issue with custom project templates in Code::Blocks. This happens with language types (C, C++, and ASM).
When creating a new project from a saved user template, Code::Blocks creates folders instead of the actual source files (e.g., a folder named main.cpp or main.asm).
Because of this, it throws an error message saying that not all files could be copied.
I have attached two screenshots showing the issue and the error message.
Is this a known bug, and how can I fix this so templates save and extract files correctly?

I have postet this in the forum but no reply yet:
https://forums.codeblocks.org/index.php/topic,26379.15.html

Thanks for your help!


1 Attachments

Discussion

  • OktayO

    OktayO - 2026-10-21

    correcting link

     
  • Terry Pascar

    Terry Pascar - 2026-10-22

    Can confirm this. Happened while trying to save a user template created on 25.03 on a nightly rev 14050 (launched via CBLauncher).
    Don't know why this happens but i can confirm it.

     
    πŸ‘
    1
  • Miguel Gimenez

    Miguel Gimenez - 2026-10-22
    • status: open --> fixed
     
  • Miguel Gimenez

    Miguel Gimenez - 2026-10-22

    This is due to _T() removal, adding a char to a const char* does not concatenate them and wxFILE_SEP_PATH is a char. This affects other parts of the program still undetected.

    All instances should be fixed in [r14057].

     
    πŸ‘
    1

    Related

    Commit: [r14057]

    • Terry Pascar

      Terry Pascar - 2026-10-22

      Thanks!
      One question: Does this mean that we should add wxString to every string and not leave it as "" anymore? i thought via work logged in commits that _T() was removed and only "" was left

       

      Last edit: Terry Pascar 2026-10-22
    • OktayO

      OktayO - 2026-10-22

      thank you very much.
      When will we be able to download the latest compiled nightly version?

       
  • Miguel Gimenez

    Miguel Gimenez - 2026-10-22

    The removal was mostly valid, but expression like 'X'+"text" will not evaluate as "Xtest", they need to be changed to 'X'+_T("test") or 'X'+wxString("test").

     
  • OktayO

    OktayO - 2026-10-24

    Issue seems still to be there, if I did not do much mistakes while compiling 14057:

     
  • OktayO

    OktayO - 2026-10-24

    update: meanwhile I figured out where the real problem is:

    file sdk/templatemanager.cpp

    line 180. Same requires to be done for the Saveusertemplate:

    replace this

     if (!CreateDirRecursively(dst))
                Manager::Get()->GetLogManager()->DebugLog("Failed creating directory for " + dst);
    

    with

    wxFileName dstName(dst);
    
    if (!CreateDirRecursively(dstName.GetPath()))
    {
    Manager::Get()->GetLogManager()->DebugLog(
        _T("Failed creating directory for ") + dstName.GetPath());
    }
    

    as I am not really familiar with SVN & Co, would be greate if someone could check my findings and implement permanently please?

    Thanks
    OktayO

     
    • Terry Pascar

      Terry Pascar - 2026-10-25

      I invite you to create a ticket here, assign the ticket to type "Patch" and submit the diff file from https://forums.codeblocks.org/index.php/topic,26405.msg179277/topicseen.html#msg179277

       
  • OktayO

    OktayO - 2026-10-25

    Alright, thanks, this has been done and can be found here:
    ticket #1663

     

Log in to post a comment.