Recent Posts

Pages: 1 2 3 4 [5] 6 7 8 9 10
41
Try the link as it does not work for me.
42
Help / Re: Wizard script and variables expansion
« Last post by oBFusCATed on July 19, 2021, 09:17:01 pm »
Where does it crash (backtrace/callstack)?
What version are you using?
What is the exact wizard script and steps to reproduce?
43
@oBFusCATed There are 6 forum posts after 2010 that reference TDM I have listed below. I also looked at the tickets and there is noting about TDM  "it is broken and produces failing code" that I could find.
https://forums.codeblocks.org/index.php/topic,23642.0.html

44
Using Code::Blocks / Re: Mixing C and C++ code linker option
« Last post by stefanofranzoni on July 19, 2021, 04:09:56 pm »
Tim, thanks for your reply.

My version of Codeblocks is 20.03.

Your suggestion solves my problem.

I noticed however that it is not necessary to add "Use C ++ compiler" in the linker options when using Codeblocks as administrator ie running "sudo Codeblocks".

The problem is reproducible with two simple files, one in C and the other in C ++.

Stefano
45
Help / Wizard script and variables expansion
« Last post by ValeV on July 19, 2021, 03:31:33 pm »
Hello,

I am creating new wizard script for generating C header files. I want to add date to the top of the file (where [DATE] is in the code below). I tried to use variable expansion $(TODAY), but CodeBlocks crashes on creating new such header file.

wizard.script:
Code
////////////////////////////////////////////////////////////////////////////////
//
// Code::Blocks new file wizard script
//
// Project: C/C++ header file
//
////////////////////////////////////////////////////////////////////////////////

header_contents <- @"/**************************************************************************//**
 * \file
 *
 * \brief
 *
 * \author
 *
 * \version
 *
 * \date [DATE]
 *
 *
 ******************************************************************************/

#ifndef IG_[GUARD]
#define IG_[GUARD]

/*========================== function prototypes =================================*/



#endif // IG_[GUARD]
";

function BeginWizard()
{
    // this is the text that will appear in the start (intro) page
    local intro_msg = _T("Welcome to the new C/C++ header file wizard!\n" +
                         "This wizard will guide you to create a new C/C++ header file.\n\n" +
                         "When you 're ready to proceed, please click \"Next\"...");

    // add builtin pages
    //Wizard.AddInfoPage(_T("HFileIntro"), intro_msg); // intro
    Wizard.AddFilePathPage(true); // select filename (header guard required for header files)

    Wizard.SetFilePathSelectionFilter(_T("C/C++ header files (*.h;*.hpp;*.hxx;*.hh)|*.h;*.hpp;*.hxx;*.hh"));
}

function CreateFiles()
{
    local fname = Wizard.GetFileName();
    local ed    = GetEditorManager();
    if (IsNull(ed))
    {
        ShowError(_T("The wizard could not locate the editor manager."));
    }

    local ed_new = ed.New(fname);
    if (IsNull(ed_new))
    {
        ShowError(_T("The wizard could not create a new file.\n" +
                     "Maybe the target folder is write-protected?"));
    }
    else
    {
        // succeeded -> add header guard
        local guard = Wizard.GetFileHeaderGuard();
        local text = _T(header_contents);
        local auto_text = ed_new.GetText();

        text.Replace(_T("[DATE]"), "$(TODAY)");

        text.Replace(_T("[GUARD]"), guard);
        //text.Replace(_T("AUTO_GENERATED_CONTENTS"), auto_text);
        ed_new.SetText(text);

        // succeeded -> add file to project if needed
        if (Wizard.GetFileAddToProject())
        {
            AddFileToTargets(Wizard, fname);
        }
    }
    return fname;
}

Is there a different way for inserting current date?

Thanks!
46
Using Code::Blocks / Re: Mixing C and C++ code linker option
« Last post by stahta01 on July 19, 2021, 03:25:02 pm »
CB Version info is needed; the option below is less than 3 years old IIRC.

CB Version SVN 12452

Project -> Build Options
Tab: Linker Settings
Linker Executable: "Auto Detect" likely needs changed to "Use C++ Compiler"

Tim S.

47
Using Code::Blocks / Mixing C and C++ code linker option
« Last post by stefanofranzoni on July 19, 2021, 03:17:10 pm »
My project contains C code and uses an external library written in C++.
The linker is normally g++ but on an Ubuntu 20.04 installation he automatic linker choice is gcc and it generates many errors.
I don't find an option to force the linker to g++ while keeping the compiler to gcc.

Thanks in advance
Stefano Franzoni
48
General (but related to Code::Blocks) / Re: Welcome Newcomers - PLEASE READ!!!
« Last post by Sprog on July 19, 2021, 07:49:45 am »
I am Here
49
@stahta01

Either of following sites.
https://jmeubank.github.io/tdm-gcc/download/
https://sourceforge.net/projects/tdm-gcc/files/v10.3.0-tdm64-1/

The https://sourceforge.net/projects/tdm-gcc/ page has the following:
TDM-GCC is now hosted on Github at https://jmeubank.github.io/tdm-gcc/.

Wikipedia TDM link to the two sites above on their TDM page:
https://en.wikipedia.org/wiki/TDM-GCC
50
@oBFusCATed There are 6 forum posts after 2010 that reference TDM I have listed below. I also looked at the tickets and there is noting about TDM  "it is broken and produces failing code" that I could find.

2019: Topic: Error getting 32 bits aplication with CB, TDM and wxWidgets 
2018: gfortran TDM 5.1 problem
2017: Debugging with TDM GCC 32bit + CodeBlocks- can't find member variables
2017: multilib mingw-w64 TDM compiler
2015: TDM mingw 5.1 breaks XMLResourceHandler?
2012: problems with 32-bit executables in TDM mingw64 installation

In the 2015 post @stahta01 posted that -o3 often results in bad code. This is a GCC issue and not a specific TDM issue.
In the 2018 post there was a GCC bug report is referenced. Yet another GCC issue that is not specific TDM.

As such I cannot find any references to justify not including TDM as the two issues are GCC issues that would affect all of the compilers based on affected GCC source code.
Pages: 1 2 3 4 [5] 6 7 8 9 10