Code::Blocks

User forums => General (but related to Code::Blocks) => Topic started by: BlueHazzard on November 08, 2012, 10:42:55 pm

Title: backtick execution broken
Post by: BlueHazzard on November 08, 2012, 10:42:55 pm
Hello,
i don't know if only i have this bug, but backtick execution isn't working for me in the actual nightly build (8484) on Windows 7.
I use the backtick execution for wx-config. Under Build Options -> Compiler Settings -> Other options i have written
Code: [Select]
`wx-config --cflags --unicode=yes --wxcfg=gcc_dll\mswud`
-posix

but the wx-config is never called as shown in the build log:
Code: [Select]
mingw32-g++.exe -std=c++0x -Wall -posix -std=gnu++0x -D__GNUWIN32__ -D__WXMSW__ -DUNICODE -g -D_GLIBCXX_DEBUG -Iinclude -Iutils\rapidxml-1.13 -I..\boost_1_50_0 -Iutils\libusbx\include\libusbx-1.0 -I XXXX -c XXXX -o XXXX

if i call wx-config in the cmd:
Code: [Select]
wx-config --cflags --unicode=yes --wxcfg=gcc_dll\mswud
-mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -Ic:\wxWidgets-2.
9.4\lib\gcc_dll\mswud -Ic:\wxWidgets-2.9.4\include -DWXUSINGDLL -Wno-ctor-dtor-p
rivacy -pipe -fmessage-length=0  -posix

So is this my fault, or is it a bug?
Title: Re: backtick execution broken
Post by: stahta01 on November 08, 2012, 10:58:21 pm
Rumor says the backticks are only used on CB start-up.
1. save project
2. close CB
3. open CB
4. load project

Did it work?

If yes, it supports the rumor.
If no, likely a bug has been added

Tim S.
EDIT: The backslash (\) might be the cause; you might try a forward slash or two backward slashes.
Title: Re: backtick execution broken
Post by: oBFusCATed on November 08, 2012, 11:04:05 pm
Rumor says the backticks are only used on CB start-up.
This is not correct. What C::B does is to cache them, so if the backtick expression has returned garbage the first time it is executed,
then its value will be garbage until C::B is restarted.
Title: Re: backtick execution broken
Post by: BlueHazzard on November 08, 2012, 11:23:28 pm
thanks for the reply.
I tried to replace the backslash with a forward slash, and restart C::B but still not working...

OT: is this caching a good idea? what if the program i'm calling in backticks changes its output?
Title: Re: backtick execution broken
Post by: jens on November 08, 2012, 11:28:52 pm
thanks for the reply.
I tried to replace the backslash with a forward slash, and restart C::B but still not working...

OT: is this caching a good idea? what if the program i'm calling in backticks changes its output?
Then you need to restart the process.

Think of a large wxWidgets project like C::B.
Without caching we would need to call wx-config for (nearly) each compiled filed and that would surely slow down compiling a lot.
Title: Re: backtick execution broken
Post by: jens on November 08, 2012, 11:32:20 pm
Is wx-config in the systems search path, and can it be called from pre- or post-build step ?
Title: Re: backtick execution broken
Post by: oBFusCATed on November 08, 2012, 11:56:16 pm
OT: is this caching a good idea? what if the program i'm calling in backticks changes its output?
Yes, but the cache should be cleared at the start of the build. I'll try to fix this in the future, but this is how it is for now.
Title: Re: backtick execution broken
Post by: BlueHazzard on November 09, 2012, 01:13:55 am
Quote
Think of a large wxWidgets project like C::B.
Without caching we would need to call wx-config for (nearly) each compiled filed and that would surely slow down compiling a lot.

i didn't thought about that...

I put the comand line in  pre-build  and it fails also....
Code: [Select]
Execution of 'wx-config.exe --cflags --unicode=yes --wxcfg=gcc_dll/mswud' in 'E:\XXXX' failed.

my wx-config is in the c:/windows/system32 folder, and this folder is in the path ;)

I copied wx-config to the root directory of c::b and now it is working...
there seems something wrong with the search path of executables.

anyway, thank you all
for the awesome IDE and fast support!
Title: Re: backtick execution broken
Post by: BlueHazzard on November 11, 2012, 04:44:44 pm
Hello,
for everybody who has the same problem like me. DON'T PUT YOUR PROGRAMS IN system32 FOLDER OF WINDOWS. in Win7 the user management redirect all calls to system32 to somewhere else if you are not the administrator. So your prog won't be found....

greetings