Recent Posts

Pages: [1] 2 3 4 5 6 ... 10
1
Plugins development / Re: Code completion using LSP and clangd
« Last post by kakas on Today at 08:17:02 am »
hey @Pecan
sorry to bother you again but I have encounter an unusual behavior.
I was trying to use a large single file libraryhttps://github.com/mackron/miniaudio.
It has a single headerfile: miniaudio.h <--- 62k lines

when I try to open the header file or search for declaration through the main.c, whole code blocks freezes for solid 1-2 mins, weanwhile the mouse gradually becomes unresponsive until it's completely frozen and the screen turns black. Throws an error that Clangd_Cliet has stopped at the end.

I not sure if it's because my laptop isn't powerful enough. because the plugin usually worked smooth with other large libraries.

Apart from this single instance the plugin works fine and it has been very helpful.
2
Hi.
Alternatively, you can manually copy libstdc++-6.dll, libgcc_s_seh-1.dll and libwinpthread-1.dll to your application's directory.
I located these 3 files in the MinGW compiler set and added them alongside the WX dll(s) in the application's directory.  This works fine (giving standalone operation), thank you.

As for the former approach of using envvars, I have already a DevC++ ide utilising the envvars.  So I am trusting that CB (and WX widgets) is atleast self containing in its operation ( after installation ).

With respect to understanding the operation of these libraries, I am correct with saying they are dynamic (due to the need to be available) as opposed to static (where I expect the library to be read and embedded in the application).

Regards JC.......
 
3
Plugins development / Re: Code completion using LSP and clangd
« Last post by Pecan on Today at 01:18:54 am »

It is only active when an editor has been activated. It shows the classes and the functions that the editors cursor is positioned within. I.e., the cursor must have clicked in an
editor at least once (activate) to fill in the choice boxes.

What's happening in your video is that you never activated the editor by clicking into it. So the choice boxes were never populated.


Thank you for your answer but....

...it seems that the issue is still the same even if I'm clicking the editor.

Hereafter another video in which it should be very clear that I'm activating (clicking) the editor but the "left choice" still disapperar.

If I'm so quick (very quick) to select something in the "right choice" before the "left choice" is blanked .... then the "left choice" is no longer disappearing. But it's difficult...I need to be very quick. Basically I need to wait for the parsing completion before using the plugin.

https://drive.google.com/file/d/1ntVkrxRg9YccNJBByNuHaBKE-SgX3Xwn/view?usp=sharing

I just watched the video again.
I see that you're not clicking either inside a class or a function.
Do this, after the clicked file has parsed, click inside a function, not at the top of an editor file.
Tell me if you still get the bug.

If you get the bug, send me the Code::Blocks Debug log as specified in the previous messgage.

Thanks
4
Plugins development / Re: Code completion using LSP and clangd
« Last post by Pecan on Today at 01:03:08 am »

It is only active when an editor has been activated. It shows the classes and the functions that the editors cursor is positioned within. I.e., the cursor must have clicked in an
editor at least once (activate) to fill in the choice boxes.

What's happening in your video is that you never activated the editor by clicking into it. So the choice boxes were never populated.


Thank you for your answer but....

...it seems that the issue is still the same even if I'm clicking the editor.

Hereafter another video in which it should be very clear that I'm activating (clicking) the editor but the "left choice" still disapperar.

If I'm so quick (very quick) to select something in the "right choice" before the "left choice" is blanked .... then the "left choice" is no longer disappearing. But it's difficult...I need to be very quick. Basically I need to wait for the parsing completion before using the plugin.

https://drive.google.com/file/d/1ntVkrxRg9YccNJBByNuHaBKE-SgX3Xwn/view?usp=sharing

I cannot reproduce this. So would you start CB with the -d or /d parameter so that the Code::Blocks Debug log is produced.

Before you load your project be sure that the "CodeBlocks Debut" log tab is focused.

Do as you have done to cause the bug, then right-click the Code::Blocks Debug tab and choose copy "contents to clipboard", Paste it into a message here between code tags (the # icon above a forum reply box).

Thanks for your patience with this.
It's really peculiar.

BTW: after the new file is parsed and clicked into, can you even perform a Mainmenu/Search/goto function, (Ctrl-Shift-G for me.)
It tells me if if the bug is in the plugin interface to the editor code or the toobar code.
5
Plugins development / Re: Code completion using LSP and clangd
« Last post by MaxGaspa on Yesterday at 11:28:29 pm »

It is only active when an editor has been activated. It shows the classes and the functions that the editors cursor is positioned within. I.e., the cursor must have clicked in an
editor at least once (activate) to fill in the choice boxes.

What's happening in your video is that you never activated the editor by clicking into it. So the choice boxes were never populated.


Thank you for your answer but....

...it seems that the issue is still the same even if I'm clicking the editor.

Hereafter another video in which it should be very clear that I'm activating (clicking) the editor but the "left choice" still disapperar.

If I'm so quick (very quick) to select something in the "right choice" before the "left choice" is blanked .... then the "left choice" is no longer disappearing. But it's difficult...I need to be very quick. Basically I need to wait for the parsing completion before using the plugin.

https://drive.google.com/file/d/1ntVkrxRg9YccNJBByNuHaBKE-SgX3Xwn/view?usp=sharing
6
Plugins development / Re: Code completion using LSP and clangd
« Last post by Pecan on Yesterday at 07:09:19 pm »
Hi,

I'm writing to submit a (passible) bug report of the Code Completion plugin (LSP and Clangd).

When I load a project the plugin starts to parse all the project's files. I observe the log of parsing in the Code::Blocks  panel of the Logs window. In the meantime  I open a file, Application.cpp for example,  and  I select "Application:" to use the plugin (see image attached)...but...as soon as a new file is parsed the selection disappears....so I can't use the code completion till the full parsing of the projects. As soon as a new file parsing is completed the selection becomes blank.

Is this behavior expected?

Windows 10 , latest nightly , latest Mys2 clang 18.1.3-1

Thanks for the video. It cleared up (in my head) what box you were trying to point out.

That box is called the Clangd_client (or CodeCompletion) toolbar.

It is only active when an editor has been activated. It shows the classes and the functions that the editors cursor is positioned within. I.e., the cursor must have clicked in an
editor at least once (activate) to fill in the choice boxes.

The left hand side (the one you were clicking in) displays the classes in an active editor file, and the right hand choice box shows all functions within the class.

You can cause the editor to position on a class/function by clicking in the left hand choice box to choose the class, then click in the right choice box and choosing what function to position to.

What's happening in your video is that you never activated the editor by clicking into it. So the choice boxes were never populated.

Regards

7
Help / Re: Code::Blocks can not locate QTCore folder on MAC OS LION
« Last post by vithor on Yesterday at 05:24:36 pm »
Quote
You have to adjust the wizard (right click on it and select edit).

Could you be more explicit ? I must to edit wizard script ? 

Code
// Qt4 project wizard
//
////////////////////////////////////////////////////////////////////////////////

// globals
QtPathDefault    <- _T("$(#qt4)");
QtPathDefaultInc <- _T("$(#qt4.include)");
QtPathDefaultLib <- _T("$(#qt4.lib)");
QtPath <- _T("");

function BeginWizard()
{
    local intro_msg = _T("Welcome to the new Trolltech Qt4 project wizard!\n" +
                         "This wizard will guide you to create a new Qt4 project\n" +
                         "using the Trolltech Qt4 cross-platform GUI toolkit\n\n" +
                         "When you're ready to proceed, please click \"Next\"...");

    local qtpath_msg = _T("Please select the location of Trolltech Qt4 on your computer.\n" +
                          "This is the top-level folder where Qt4 was installed.\n" +
                          "To help you, this folder must contain the subfolders\n" +
                          "\"include\" and \"lib\".");

    Wizard.AddInfoPage(_T("QtIntro"), intro_msg);
    Wizard.AddProjectPathPage();
    Wizard.AddGenericSelectPathPage(_T("QtPath"), qtpath_msg, _T("Qt's location:"), QtPathDefault);
    Wizard.AddCompilerPage(_T(""), _T("gcc*"), true, true);
}

////////////////////////////////////////////////////////////////////////////////
// Qt's path page
////////////////////////////////////////////////////////////////////////////////

function OnLeave_QtPath(fwd)
{
    if (fwd)
    {
        local dir         = Wizard.GetTextControlValue(_T("txtFolder")); // txtFolder is the text control in GenericSelectPathPage
        local dir_nomacro = VerifyDirectory(dir);

        if (dir_nomacro.IsEmpty())
            return false;

        // verify include dependencies
        local dir_nomacro_inc = GetCompilerIncludeDir(dir, QtPathDefault, QtPathDefaultInc);
        if (dir_nomacro_inc.IsEmpty())
            return false;
        if (PLATFORM == PLATFORM_MSW
            && !VerifyFile(dir_nomacro_inc + wxFILE_SEP_PATH + _T("QtGui"), _T("QApplication"), _T("Qt's include")))
            return false;

        // verify library dependencies
        local dir_nomacro_lib = GetCompilerLibDir(dir, QtPathDefault, QtPathDefaultLib);
        if (dir_nomacro_lib.IsEmpty())
            return false;
        if (PLATFORM == PLATFORM_MSW && !VerifyLibFile(dir_nomacro_lib, _T("QtCore4"), _T("Qt's")))
            return false;
        else if (PLATFORM != PLATFORM_MSW && !VerifyLibFile(dir_nomacro_lib, _T("QtCore"), _T("Qt's")))
            return false;


        QtPath = dir; // Remember the original selection.

        local is_macro = _T("");

        // try to resolve the include directory as macro
        is_macro = GetCompilerIncludeMacro(dir, QtPathDefault, QtPathDefaultInc);
        if (is_macro.IsEmpty())
        {
            // not possible -> use the real inc path we had computed instead
            QtPathDefaultInc = dir_nomacro_inc;
        }

        // try to resolve the library directory as macro
        is_macro = GetCompilerLibMacro(dir, QtPathDefault, QtPathDefaultLib);
        if (is_macro.IsEmpty())
        {
            // not possible -> use the real lib path we had computed instead
            QtPathDefaultLib = dir_nomacro_lib;
        }
    }
    return true;
}

// return the files this project contains
function GetFilesDir()
{
    return _T("qt4/files");
}

// setup the already created project
function SetupProject(project)
{
    project.AddIncludeDir(QtPathDefaultInc);
    project.AddIncludeDir(QtPathDefaultInc + wxFILE_SEP_PATH + _T("QtGui"));

    project.AddLibDir(QtPathDefaultLib);

    // add link libraries
    if (PLATFORM == PLATFORM_MSW)
    {
        project.AddLinkLib(_T("QtCore4"));
        project.AddLinkLib(_T("QtGui4"));
    }
    else
    {
        project.AddLinkLib(_T("QtCore"));
        project.AddLinkLib(_T("QtGui"));
    }

    // enable compiler warnings (project-wide)
    WarningsOn(project, Wizard.GetCompilerID());

    // Debug
    local target = project.GetBuildTarget(Wizard.GetDebugName());
    if (!IsNull(target))
    {
        target.SetTargetType(ttConsoleOnly); // ttConsoleOnly: console for debugging
        target.SetOutputFilename(Wizard.GetDebugOutputDir() + Wizard.GetProjectName() + DOT_EXT_EXECUTABLE);
        // enable generation of debugging symbols for target
        DebugSymbolsOn(target, Wizard.GetCompilerID());
    }

    // Release
    target = project.GetBuildTarget(Wizard.GetReleaseName());
    if (!IsNull(target))
    {
        target.SetTargetType(ttExecutable); // ttExecutable: no console
        target.SetOutputFilename(Wizard.GetReleaseOutputDir() + Wizard.GetProjectName() + DOT_EXT_EXECUTABLE);
        // enable optimizations for target
        OptimizationsOn(target, Wizard.GetCompilerID());
    }

    return true;
}



you can define the base folder normally, then in the wizard, edit the part where it recognize qtcore , see in the lib folder and locate the name of the .a file and make the changes, that worked for me
8
Quote
cc1plus.exe: warning: ./wx_pch.h.gch/Debug_wx_pch_h_gch: not used because `__NO_INLINE__' not defined [-Winvalid-pch]

I know its an old post, but thats what I found googling the issue. As the root cause is so stupid I do not want to spent much time on it again when I am going to run into it next time.

Root Cause:
There is nothing CB can do about it, its a GCC problem.
The warning happens when -Winvalid-pch is configured to warn about PCH issues. Since all PCHs could be in the same folder, GCC puts the BuildTarget name into them to keep them apart, e.g. "xxxReleasexxxx" or "xxxDebugxxxx". Compiling "Debug" will be fine. But when you compile "Release" gcc looks into the folder for 'gch'' files and first finds the "Debug" version. Since this is not the correct one it prints the warning. Only then it looks for the next file and finds the correct "Release" version. So it continues to compile with no further warnings. The code will run fine.
The result is a flood useless warnings for any Release build, but none for the Debug build. Maybe there is an architectural reason why they can not look for other fiiles first and then throw the warning, but so we get yet another confusing gcc warning.

There are two wys to sove this
1. Put the PCH files into separate folders. Only the middle C::B option will do that
2. The alternative is to not use -Winvalid-pch compiler switch



9
First you should exactly know where the compiler you're using is, and where the corresponding wxWidgets' dlls are. Check in the PATH envvar if there's another compiler path in it, and make sure that you removed other compilers and added the bin path of the compiler you're using(I see It's gcc) into it.
Then everything will be fine.
Alternatively, you can manually copy libstdc++-6.dll, libgcc_s_seh-1.dll and libwinpthread-1.dll to your application's directory.
10
Hi.  The project runs OK with CB and executes OK (with green arrow). 
However when I double click the *.exe, the error is;
   wxmsw32ud_gcc_custom.dll not found.

When I load the file into the same folder, then a new error is;
   The entry point could not be located.

How do you package the *.exe for standalone usage???

Regards JC....
Pages: [1] 2 3 4 5 6 ... 10