Author Topic: Anyone interrested in CB Projects that compiles wxWidgets samples with wx-config  (Read 10314 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6677
    • My Best Post
I have spent several hours working on making simple CB Projects that compile wxWidgets samples using wx-config-win for under windows.
It uses MinGW GCC as the normal project compiler.

If yes, does anyone know of a good file share site for me to upload the CB Projects and related support files.

Once, I get it to work good enough I plan to upload to version control site.

For people who wonder about wx-config-win https://code.google.com/p/wx-config-win/
I am using a higher patched version of wx-config-win from the CodeLite project.

Tim S.


 
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12127
    • Travis build status
...does anyone know of a good file share site for me to upload the CB Projects and related support files.
github.com or similar.

Once, I get it to work good enough I plan to upload to version control site.
There is no point in postponing this step:)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5247
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
I have spent several hours working on making simple CB Projects that compile wxWidgets samples using wx-config-win for under windows.
It uses MinGW GCC as the normal project compiler.
Yes, many interests, I even asked such question several years ago when I as a beginner of wxWidgets.
See: question on wxwidget sample projects, and where to find more
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6677
    • My Best Post
https://github.com/stahta01/cb_projects_for_wxWidgets

I tried an hg site first; but, could NOT figure out how to upload; so, tried github.

Still need to do a real readme/directions.

Edit: Does anyone know if I need to set permissions for someone other than me to do the download of the Zip Archive?

Tim S.

« Last Edit: January 04, 2014, 04:14:49 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Edit: Does anyone know if I need to set permissions for someone other than me to do the download of the Zip Archive?
No special permissions needed, as you can see here: https://github.com/jenslody

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5247
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
What is the steps to use this tool to build wx sample?
I can download the zip file from github, and extract to E:\code\wx\wxWidgets-3.0.0
Then, I can build the wx-config.exe, but where should I put the wx-config.exe? It is currently under:
E:\code\wx\wxWidgets-3.0.0\wx-config-win

When I open the samples.workspace (under E:\code\wx\wxWidgets-3.0.0\samples) , build any project certainly get failed.
What's the next step?

Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6677
    • My Best Post
What is the steps to use this tool to build wx sample?
I can download the zip file from github, and extract to E:\code\wx\wxWidgets-3.0.0
Then, I can build the wx-config.exe, but where should I put the wx-config.exe? It is currently under:
E:\code\wx\wxWidgets-3.0.0\wx-config-win

When I open the samples.workspace (under E:\code\wx\wxWidgets-3.0.0\samples) , build any project certainly get failed.
What's the next step?

Thanks.

Put it in you system path or add it to your Compiler path.
Note: You need to re-start CB for either option.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5247
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
...
Then, I can build the wx-config.exe, but where should I put the wx-config.exe? It is currently under:
E:\code\wx\wxWidgets-3.0.0\wx-config-win

When I open the samples.workspace (under E:\code\wx\wxWidgets-3.0.0\samples) , build any project certainly get failed.
What's the next step?

Thanks.

Put it in you system path or add it to your Compiler path.
Note: You need to re-start CB for either option.

Tim S.

Hi, Tim, it still doesn't work.

I put the exe under: E:\code\common_bin

When I try to build minimal sample, I get those:

Code: [Select]
[100.0%] Running target pre-build steps
cmd /c echo \lib\
\lib\

-------------- Build: win_gcc in minimal (compiler: GNU GCC Compiler)---------------

[ 50.0%] g++.exe wx-config Error: wxWidgets hasn't been found installed at 'E:\code'.  -c minimal.cpp -o .objs\win_gcc\minimal.o
g++.exe: error: wx-config: No such file or directory
g++.exe: error: Error:: Invalid argument
g++.exe: error: wxWidgets: No such file or directory
g++.exe: error: hasn't: No such file or directory
g++.exe: error: been: No such file or directory
g++.exe: error: found: No such file or directory
g++.exe: error: installed: No such file or directory
g++.exe: error: at: No such file or directory
g++.exe: error: 'E:\code'.: Invalid argument
Process terminated with status 1 (0 minute(s), 0 second(s))
7 error(s), 0 warning(s) (0 minute(s), 0 second(s))

It looks like it try to search the parent folder of where I put the exe? (E:\code\common_bin)


EDIT:
If I put this wx-config.exe file under the folder: E:\code\wx\wxWidgets-3.0.0\lib, I get different build error
Code: [Select]
[100.0%] Running target pre-build steps
cmd /c echo \lib\
\lib\

-------------- Build: win_gcc in minimal (compiler: GNU GCC Compiler)---------------

[ 50.0%] g++.exe   -c minimal.cpp -o .objs\win_gcc\minimal.o
minimal.cpp:21:23: fatal error: wx/wxprec.h: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))

Do I need to specify some custom variables?

EDIT2:
See
Code: [Select]
[100.0%] Running target pre-build steps
cmd /c echo \lib\
\lib\
It looks like I set wrong path?

EDIT3:
Code: [Select]
cmd /c echo $(WXWIN)\lib\$(WXCFG)I just do not know where I can define those variables? Global variable does not work. They should have some expression like $(#WXWIN).

« Last Edit: January 09, 2014, 02:28:16 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6677
    • My Best Post

Do I need to specify some custom variables?

EDIT2:
See
Code: [Select]
[100.0%] Running target pre-build steps
cmd /c echo \lib\
\lib\
It looks like I set wrong path?

EDIT3:
Code: [Select]
cmd /c echo $(WXWIN)\lib\$(WXCFG)I just do not know where I can define those variables? Global variable does not work. They should have some expression like $(#WXWIN).



I set WXCFG in CB Environmental Variable; but, I always need to remember to click an "set now" and restart CB for the effects to happen.
I set WXWIN in the OS Environmental Variable normally. It the same as the wxWidgets base directory.

Did the readme not exist in the wx-config-win folder?
Looks like it should https://github.com/stahta01/cb_projects_for_wxWidgets/blob/master/wx-config-win/README.txt

Common value for WXCFG is gcc_lib/mswu or gcc_dll/mswu

This $(WXWIN)\lib\$(WXCFG) should be the folder that holds wx/setup.h

Tim S.


« Last Edit: January 09, 2014, 03:46:31 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5247
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
OK, Thanks for the help, I can correctly set these two environment variables by using the Environment variable plugin, see the image shot below:




But still has some build errors below.

Code: [Select]
[100.0%] Running target pre-build steps
cmd /c echo E:\code\wx\wxWidgets-3.0.0\lib\gcc_dll/mswu
E:\code\wx\wxWidgets-3.0.0\lib\gcc_dll/mswu

-------------- Build: win_gcc in minimal (compiler: GNU GCC Compiler)---------------

[ 50.0%] g++.exe   -c minimal.cpp -o .objs\win_gcc\minimal.o
minimal.cpp:21:23: fatal error: wx/wxprec.h: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5247
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Hi, Tim, I found that I have to restart C::B after I put the wx-config.exe in PATH.

When restart C::B, it works fine now, here is the build log. Sorry for the noise.

Code: [Select]
[100.0%] Running target pre-build steps
cmd /c echo E:\code\wx\wxWidgets-3.0.0\lib\gcc_dll/mswu
E:\code\wx\wxWidgets-3.0.0\lib\gcc_dll/mswu

-------------- Build: win_gcc in minimal (compiler: GNU GCC Compiler)---------------

[ 50.0%] g++.exe -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IE:/code/wx/wxWidgets-3.0.0/lib/gcc_dll/mswu -IE:/code/wx/wxWidgets-3.0.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport  -c minimal.cpp -o .objs\win_gcc\minimal.o
[100.0%] g++.exe -LE:\code\wx\wxWidgets-3.0.0\lib\gcc_dll/mswu -o bin\win_gcc\minimal.exe .objs\win_gcc\minimal.o   -mthreads -LE:/code/wx/wxWidgets-3.0.0/lib/gcc_dll -lwxmsw30u -lwxscintilla -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregexu -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32    -mwindows
Output file is bin\win_gcc\minimal.exe with size 267.65 KB
Process terminated with status 0 (0 minute(s), 5 second(s))
0 error(s), 0 warning(s) (0 minute(s), 5 second(s))
 

-------------- Run: win_gcc in minimal (compiler: GNU GCC Compiler)---------------

Checking for existence: E:\code\wx\wxWidgets-3.0.0\samples\minimal\bin\win_gcc\minimal.exe
Executing: "E:\code\wx\wxWidgets-3.0.0\samples\minimal\bin\win_gcc\minimal.exe"  (in E:\code\wx\wxWidgets-3.0.0\samples\minimal\.)
Process terminated with status 0 (0 minute(s), 1 second(s))

Nice!
« Last Edit: August 18, 2016, 04:42:16 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.