User forums > General (but related to Code::Blocks)

codeblocks cbp projects for wx samples

<< < (2/5) > >>

AndrewCot:
My thought, which may be wrong or off topic or just plain not feasible/workable follows:

Instead of getting the users to build a monolithic wxWidgets on Windows would it not be easier to use the MSYS2 wxWidgets 3.2.0 package? This would then mean that the C::B project files would use the wx-config and therefore the resulting files would be very similar on Windows & Linux & Mac. It wouild also hopefully make it less confusing for the newbies as Linux and MAC use the wxWidgets packages instead of having to build wxWidgets. The resulting project file(s) should in theory be easy to make cross platform once you get it working on one OS.
You can have one project file work on Linux and MAC if you use a global variable to configure the call to wx-config as it is different for them, but the way wx-config works is the same for what I have done so far (I have a common set of project files that build C::B on Linux and MAC by changing a global variable.)

ollydbg:

--- Quote from: AndrewCot on September 15, 2022, 01:38:04 am ---My thought, which may be wrong or off topic or just plain not feasible/workable follows:

Instead of getting the users to build a monolithic wxWidgets on Windows would it not be easier to use the MSYS2 wxWidgets 3.2.0 package? This would then mean that the C::B project files would use the wx-config and therefore the resulting files would be very similar on Windows & Linux & Mac. It wouild also hopefully make it less confusing for the newbies as Linux and MAC use the wxWidgets packages instead of having to build wxWidgets. The resulting project file(s) should in theory be easy to make cross platform once you get it working on one OS.
You can have one project file work on Linux and MAC if you use a global variable to configure the call to wx-config as it is different for them, but the way wx-config works is the same for what I have done so far (I have a common set of project files that build C::B on Linux and MAC by changing a global variable.)

--- End quote ---

I agree with you. Using the prebuild wxWidgets library supplied by MSYS2 is better than selfbuild wx library.

But how can we use wx-config under Windows(MSYS2)?

You mean under C::B, we have to use the sh.exe to call the wx-config script under msys2?
Or, we can use "wx-config-msys2.exe" which is designed by eranif, this executable can directly be called without the sh.exe.

Which method do you suggest?

I don't know how easy to create such sample cbp files for each wx samples.

AndrewCot:
I have created some MSYS2 specific project files that use the wx-config and found it's not easy in that like you found out if you forget to remove the additional path it causes problems.

I did not think of eranif's wx-config-msys2.exe. If it works then it would remove the need for the additional path and would probably the best solution if it works. I should try it with the MSYS2 C::B project files I created for some testing I did.


I have created a bunch of project files for plugins that do not have any for Linux. I pick an existing one and remove the file list and save it as a "template" and then copy it into the directory I want it in. I add the files and update it  via Notepad++ as it is quicker than using C::B. Once I have it done I then open it in C::B and fix the build issues due to missing stuff or changes for the new directory, which I then feed into the template for the next project.

ollydbg:

--- Quote from: AndrewCot on September 15, 2022, 04:51:24 am ---I have created some MSYS2 specific project files that use the wx-config and found it's not easy in that like you found out if you forget to remove the additional path it causes problems.

I did not think of eranif's wx-config-msys2.exe. If it works then it would remove the need for the additional path and would probably the best solution if it works. I should try it with the MSYS2 C::B project files I created for some testing I did.

--- End quote ---
eranif's wx-config-msys2.exe works correctly. I use it for some of my personal wx based projects.
What you need to do is adding something like:

--- Code: ---`wx-config-msys2 --libs all --prefix=$(TARGET_COMPILER_DIR)`
or
`wx-config-msys2 --cflags --prefix=$(TARGET_COMPILER_DIR)`

--- End code ---
In the compiler or linker options.




--- Quote ---I have created a bunch of project files for plugins that do not have any for Linux. I pick an existing one and remove the file list and save it as a "template" and then copy it into the directory I want it in. I add the files and update it  via Notepad++ as it is quicker than using C::B. Once I have it done I then open it in C::B and fix the build issues due to missing stuff or changes for the new directory, which I then feed into the template for the next project.

--- End quote ---

Yes, this is a workaround. I also did the similar things, especially I would like to test some wx sample code. I'm not satisfied with this method. Especially for wx and C::B beginner.

ollydbg:
Today, I see someone post a wx-config.bat script in the wxWidgets forum, see here:
MSYS2 wx-config from command prompt (CMD) workaround / fix

If we don't need to put the "usr/bin" to the PATH, this may be a good method. I will try it.

EDIT:

It looks this method works, but not under Win7, see my reply here: Post

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version