Recent Posts

Pages: 1 2 3 4 5 [6] 7 8 9 10
51
Help / Re: Windows 10, msys2 and GTK
« Last post by tumanovalex on September 17, 2022, 04:57:00 pm »
Maybe I need to post this question in another forum topic? For example, in Using Code::Blocks? I really need to configure Code::Blocks to create GTK applications, and in this topic the answer is no.
52
Help / Re: Windows 10, msys2 and GTK
« Last post by tumanovalex on September 17, 2022, 04:48:58 pm »
I tried to set up the project. Previously, there were the following libraries in the project settings in Linker settings->Link libraries:
      <Linker>
         <Add library="gtk-win32-3.0" />
         <Add library="gobject-2.0" />
         <Add library="glib-2.0" />
      </Linker>
I didn't find these libraries in msys2. Please tell me which libraries from msys2 need to be connected.
53
Plugins development / Re: Code completion using LSP and clangd
« Last post by ollydbg on September 17, 2022, 02:45:36 pm »
Is there a better method for inserting a entry into a map?

I'm not fully understand the code logic, but do you really need a map? When a key is added, it's  value is always "true".

I mean a std::set<cbEditor*> is better than std::map<cbEditor*,bool> ?
54
Plugins development / Re: Code completion using LSP and clangd
« Last post by ollydbg on September 17, 2022, 02:40:14 pm »
I'm tweaking wx sample workspace, see here: codeblocks cbp projects for wx samples

While, after switch from one cbp to other cbp for many times, I got many clangd.exe process running, see the image shot below, is it correct?

Thanks.
55
General (but related to Code::Blocks) / Re: codeblocks cbp projects for wx samples
« Last post by ollydbg on September 17, 2022, 12:27:44 pm »
Now, I see there are about 100 sample folders in the wx, and most of the samples can be built and run by opening the cbp(or the toplevel samples.workspace) and C::B now.

 :)

56
General (but related to Code::Blocks) / Re: codeblocks cbp projects for wx samples
« Last post by ollydbg on September 17, 2022, 06:00:51 am »
I have never seen or used the "execution_dir". As such I would delete it, unless it is really required. You can comment it out for the time being (<!-- Option execution_dir="../minimal" -->).

In the C::B plugin build project files some did not have an entry for the "working_dir", but where it did exist it was set to the same directory as the "output" where I looked. I would either remove it or set it to $(TARGET_OUTPUT_DIR) so that you do not have to update two lines in the project file going forward if you change the output directory.


Some other changes could be:
1. As they are sample apps I would change the compiler options to enable debugging and no optimisation (-g -O0 -ggdb) plus remove the linker "-s" option.
2. Add a "<Option default_target="TBA" />"
3. Remove the target "<Option compiler="gcc" />" option so that there is only one at the project level

I have not done this or tried this, but you could add a <ExtraCommands> before to check that the $(#WX_CONFIG) is defined and if not the use the script expansion facility to pop up a message dialog to indicate that they have to set the global variable. See https://wiki.codeblocks.org/index.php/Variable_expansion for the script expansion info/example.



BTW I should update my project files to change the working_dir to $(TARGET_OUTPUT_DIR). I will update my bulk CBP app to make the change in the next day or two.

Thanks for the suggestion, I will do what I believe is simple and make some find/replace operation.  ;)
57
General (but related to Code::Blocks) / Re: codeblocks cbp projects for wx samples
« Last post by AndrewCot on September 17, 2022, 05:38:26 am »
I have never seen or used the "execution_dir". As such I would delete it, unless it is really required. You can comment it out for the time being (<!-- Option execution_dir="../minimal" -->).

In the C::B plugin build project files some did not have an entry for the "working_dir", but where it did exist it was set to the same directory as the "output" where I looked. I would either remove it or set it to $(TARGET_OUTPUT_DIR) so that you do not have to update two lines in the project file going forward if you change the output directory.


Some other changes could be:
1. As they are sample apps I would change the compiler options to enable debugging and no optimisation (-g -O0 -ggdb) plus remove the linker "-s" option.
2. Add a "<Option default_target="TBA" />"
3. Remove the target "<Option compiler="gcc" />" option so that there is only one at the project level

I have not done this or tried this, but you could add a <ExtraCommands> before to check that the $(#WX_CONFIG) is defined and if not the use the script expansion facility to pop up a message dialog to indicate that they have to set the global variable. See https://wiki.codeblocks.org/index.php/Variable_expansion for the script expansion info/example.



BTW I should update my project files to change the working_dir to $(TARGET_OUTPUT_DIR). I will update my bulk CBP app to make the change in the next day or two.
58
General (but related to Code::Blocks) / Re: codeblocks cbp projects for wx samples
« Last post by ollydbg on September 17, 2022, 04:39:46 am »
What is the messagebox that is shown?

See the screen shot as attachment.

I guess the executing working dir is wrong.

About this issue, currently, there are two folders setting, for example, the caret.cbp file has such content:

Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="caret" />
<Option execution_dir="../minimal" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="win_gcc">
<Option output="bin/$(TARGET_NAME)/$(PROJECT_NAME)" prefix_auto="1" extension_auto="1" />
<Option working_dir="../../caret" />
<Option object_output=".objs/$(TARGET_NAME)" />
<Option type="0" />
<Option compiler="gcc" />
<Option projectLinkerOptionsRelation="2" />
<Compiler>
<Add option="-O2" />
<Add option="`$(#WX_CONFIG) --cflags`" />
</Compiler>
<Linker>
<Add option="-s" />
<Add option="`$(#WX_CONFIG) --libs base,core,adv`" />
</Linker>
</Target>
</Build>
<VirtualTargets>
<Add alias="All" targets="win_gcc;" />
</VirtualTargets>
<Unit filename="caret.cpp" />
<Extensions />
</Project>
</CodeBlocks_project_file>

What do you think about the correct value of "execution_dir" and "working_dir"?

The current dir where the cbp file locates? So, the value could be "../caret"?  or just "./" ?

EDIT

I choose the later one, I just use the notepad++'s search/replace feature

search this(with regex enabled)

Code
working_dir="(.*)"
and replace by this:
Code
working_dir="./"

I have pushed my changes to my repo.
59
General (but related to Code::Blocks) / Re: codeblocks cbp projects for wx samples
« Last post by AndrewCot on September 17, 2022, 04:11:17 am »
Attach file.
60
General (but related to Code::Blocks) / Re: codeblocks cbp projects for wx samples
« Last post by ollydbg on September 17, 2022, 03:36:13 am »
Good work. 

Sounds like the find/replace on CBP files could be similar to what I needed and I had to create a quick simple app for my find replace as the project options manager plugin did not do what I wanted. Attached is the source and project file for my find replace app. The app changes the windows path delimiter \ to unix / for certain lines in the project files as it then makes the files similar. You may not be able to use the app for all of the required changes, but for some you will be able modify it for what you want.
I have also used Agent ransack to search the CBP files and then open them in Notepad++ using the context menu option in the Agent Ransack file list context menu, then within Notepad++I can then perform a find replace on all of the openned files.


I now using find/replace tool in Notepad++ to tweak all the cbp files, and it looks the result cbp works correctly.
I can open the samples.workspace file, and active a single cbp project, and build that project.
I have push all my changes to my git repo now.

asmwarrior/cb_projects_for_wxWidgets: Code::Blocks projects for building wxWidgets sample code

BTW: where is your Attached file? I guess your forgot it.  :)
Pages: 1 2 3 4 5 [6] 7 8 9 10