Author Topic: wx-config not effect  (Read 2641 times)

Offline wieniawski

  • Single posting newcomer
  • *
  • Posts: 2
wx-config not effect
« on: March 14, 2023, 01:10:00 pm »
hi,

I am trying to setup a demo project of wxWidgets using CB.
in wx wiki https://wiki.wxwidgets.org/CodeBlocks_Setup_Guide, it shows how to set wx-config in CB. And my result is as attachment
However, while I am building, the log is
g++ -Wall -g -I../../../../../opt/wxWidgets/include/wx-3.0 -c /home/schoenberg/work/wxWidgets/demo/demoApp.cpp -o obj/Debug/demoApp.o

It seems that the build setting is not effect.

Is there anyone knows why?

thx

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1591
Re: wx-config not effect
« Reply #1 on: March 14, 2023, 03:17:00 pm »
Is wx-config in your path?

I would put those commands in the "Other compiler options" and "Other linker options", respectively, not as flags.

You can create a wxiWidgets project using the wizard and then modify it as needed.

Offline wieniawski

  • Single posting newcomer
  • *
  • Posts: 2
Re: wx-config not effect
« Reply #2 on: March 15, 2023, 03:08:05 am »
wx-config is in my path.

I also tried 'Other complier options' and 'other linker options', still without success.

The build log shows that the flags doesnot effect, where I should see the flags in g++'s option, but there is none.

The build log is shown as below

-------------- Build: Debug in demo (compiler: GNU GCC Compiler)---------------

g++ -Wall -g -I../../../../../opt/wxWidgets/include/wx-3.0 -c /home/schoenberg/work/wxWidgets/demo/demoApp.cpp -o obj/Debug/demoApp.o
In file included from ../../../../../opt/wxWidgets/include/wx-3.0/wx/defs.h:27:0,
                 from ../../../../../opt/wxWidgets/include/wx-3.0/wx/event.h:14,
                 from ../../../../../opt/wxWidgets/include/wx-3.0/wx/app.h:19,
                 from /home/schoenberg/work/wxWidgets/demo/demoApp.h:13,
                 from /home/schoenberg/work/wxWidgets/demo/demoApp.cpp:10:
../../../../../opt/wxWidgets/include/wx-3.0/wx/platform.h:183:10: fatal error: wx/setup.h: 没有那个文件或目录
 #include "wx/setup.h"
          ^~~~~~~~~~~~
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))
 


Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5930
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: wx-config not effect
« Reply #3 on: March 15, 2023, 05:27:16 am »
Hi, I think you "wx-config.exe" does not work correctly.

Can you open windows command line window, and type the command

Code
wx-config.exe --cflags

and see what is the output of the command.

I guess that it can't find the location of wx library.

You can try some other parameter of the argument, such as "--prefix" option to tell the command that where your wx library locates.
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: 5930
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: wx-config not effect
« Reply #4 on: March 15, 2023, 07:58:09 am »
About the image in your first post, I don't see the two options in my C::B. Do you use a special C::B?
For me, I usually add such kinds of command in the "Other compiler options".
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: 7607
    • My Best Post
Re: wx-config not effect
« Reply #5 on: March 16, 2023, 11:51:12 am »
To wieniawski: Please post your Operating System (OS) name?

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