Author Topic: Backtick won't expand  (Read 5676 times)

Offline yop

  • Regular
  • ***
  • Posts: 387
Backtick won't expand
« on: February 12, 2006, 06:53:30 pm »
How can this happen:

g++ -Wall -g `wx-config --cflags` -fmessage-length=0 -fexceptions  -I- -I. -I/home/yop/Workbench/codeblocks/trunk/src/sdk -I/home/yop/Workbench/codeblocks/trunk/src/sdk/tinyxml -I/home/yop/Workbench/codeblocks/trunk/src/sdk/wxscintilla/include -Isrc -I/usr/include  -c src/qtworkbench.cpp -o objs/src/qtworkbench.o
src/qtworkbench.cpp:13:27: wx/xrc/xmlres.h: No such file or directory
...and all shorts of wx[whatever]: No such file or directory

I have copy pasted the project build options from Code::Blocks project where backticking wx-config --cflags works fine in the project's compiler options, but I can't make it work with my project. If I manually add to my compiler options what wx-config --cflags outputs then I can build without any problems. The most bizzare thing is that wx-config --libs backtick works fine :?
Life would be so much easier if we could just look at the source code.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Backtick won't expand
« Reply #1 on: February 12, 2006, 07:35:57 pm »
Linux or windows?
Be patient!
This bug will be fixed soon...

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: Backtick won't expand
« Reply #2 on: February 12, 2006, 07:52:28 pm »
Linux (I thought backticks and wx-config didn't work on widows but I'm not much of a windows user so I might have misunderstood).
Life would be so much easier if we could just look at the source code.

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: Backtick won't expand
« Reply #3 on: February 13, 2006, 02:33:56 pm »
Linux (I thought backticks and wx-config didn't work on widows but I'm not much of a windows user so I might have misunderstood).
Backticks works on C::B on windows (from some SVN revs ago). Not a native thing of course, but doesn't requieres cygwin or anything :D).

High likely that wx-config will work only on cygwin, but you can make a little batch file replacing the functionality of the bourne shell script if you don't want cygwin only for that.

Of course, on linux you don't need to do anything. :D

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: Backtick won't expand
« Reply #4 on: February 13, 2006, 04:23:10 pm »
Of course, on linux you don't need to do anything. :D
Yeap that's what I also thought but as you can see I'm having this problem on linux oddly enough
Life would be so much easier if we could just look at the source code.

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: Backtick won't expand
« Reply #5 on: February 13, 2006, 04:26:32 pm »
Of course, on linux you don't need to do anything. :D
Yeap that's what I also thought but as you can see I'm having this problem on linux oddly enough

Are you sure it's a backticks problem, and not a Environmental Variable problem? (wx-config not finding paths when running from C::B?)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Backtick won't expand
« Reply #6 on: February 13, 2006, 04:40:26 pm »
I only just saw that there is no error regarding wx-config at all, but it is about a generated header file. So maybe the problem is not about running wx-config?

Have you checked whether that file is really not created at all (i.e. wx-config does not run or does not run properly), or maybe it is created, just not where the compiler expects it?

Have you tried the "explicitely add currently compiling dir" compiler option? It is a dim hope, but hey, it doesn't cost to try it ;)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: Backtick won't expand
« Reply #7 on: February 13, 2006, 06:02:34 pm »
Are you sure it's a backticks problem, and not a Environmental Variable problem? (wx-config not finding paths when running from C::B?)
I only just saw that there is no error regarding wx-config at all, but it is about a generated header file. So maybe the problem is not about running wx-config?

Have you checked whether that file is really not created at all (i.e. wx-config does not run or does not run properly), or maybe it is created, just not where the compiler expects it?
But adding manually the wx-config --cflags output manually to the compilers options (using cb project options dialog) eliminates all of my problems. The exact project that I'm having problems with is this one. In the project from that link I've taken out the manually added options and just left the `wx-config -cflags` thingy in the compiler options. wx/xrc/xmlres.h is a generated file? I'll look into this as I didn't even think of this one.
Have you tried the "explicitely add currently compiling dir" compiler option? It is a dim hope, but hey, it doesn't cost to try it ;)
No but I've added it to the compiler directories so it's the same thing.
I know that there is absolutely no possibility that backticks don't work (you use them in the cb project and I can compile it without any problems and in my project wx-widgets --libs works fine) but I just can't find out what I am doing wrong :?
« Last Edit: February 13, 2006, 06:04:12 pm by yop »
Life would be so much easier if we could just look at the source code.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Backtick won't expand
« Reply #8 on: February 18, 2006, 09:20:55 pm »
I finally found the reason for this.
It's because of some PCH settings. Until I fix this once and for all, go to "Project->Properties" and select the first option for PCH mode.
I hope this isn't inconvenient for you...
Be patient!
This bug will be fixed soon...

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: Backtick won't expand
« Reply #9 on: February 19, 2006, 12:11:23 am »
Not at all, thank you  :)
Life would be so much easier if we could just look at the source code.