Author Topic: Unrecognized command line option '--cxxflags'  (Read 6005 times)

Offline ValeV

  • Multiple posting newcomer
  • *
  • Posts: 23
Unrecognized command line option '--cxxflags'
« on: January 16, 2019, 10:14:00 am »
Hi all,

I am using wxwidgets and CB for the first time, so please be patient with me. I installed CB, then mingw compiler, than wxwidgets 3.1.2 and build wxwidgets (command from http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef). Here (https://wiki.wxwidgets.org/CodeBlocks_Setup_Guide), under Setting up CB it says to add and use some flags. I followed the tutorial and then created Hello world application. When I build and run the project, I get error Unrecognized command line option '--cxxflags'. While if I build and run project with flags turned off, the project builds and runs just fine.

My settings for: Project -> build options -> search directories:
-compiler: $(#wx)\include
-linker: (nothing)
-recource compiler: $(#wx)\include


Is it important to have the flags ON? How do I fix the problem? BTW, why are there (at least) 2 different guides to set up wxwidgets? (I pasted links to both)

If you need any additional details let me know.
« Last Edit: January 16, 2019, 10:17:48 am by ValeV »

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1632
Re: Unrecognized command line option '--cxxflags'
« Reply #1 on: January 16, 2019, 01:20:09 pm »
Do you have the backticks around the command?. It should be
Code
`wx-config --cxxflags`

If you do, please post a full rebuild log:

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Offline ValeV

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: Unrecognized command line option '--cxxflags'
« Reply #2 on: January 16, 2019, 01:41:45 pm »
Do you have the backticks around the command?. It should be
Code
`wx-config --cxxflags`

If you do, please post a full rebuild log:

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

You are right, I didn't have backticks. It works now, thank you.

Can you help me understand why we do this? Why we use wxwidgets compiler and linker arguments?

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1632
Re: Unrecognized command line option '--cxxflags'
« Reply #3 on: January 16, 2019, 03:06:50 pm »
Quote
Can you help me understand why we do this? Why we use wxwidgets compiler and linker arguments?

You only need to do that with projects involving wxWidgets. In fact, even in those projects you can remove all references to wx-config, but then you need to specify search directories and library locations for wxWidgets.