Author Topic: backtick execution broken  (Read 5280 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2545
backtick execution broken
« 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?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6666
    • My Best Post
Re: backtick execution broken
« Reply #1 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.
« Last Edit: November 08, 2012, 11:00:37 pm 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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12073
    • Travis build status
Re: backtick execution broken
« Reply #2 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.
(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 BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2545
Re: backtick execution broken
« Reply #3 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?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: backtick execution broken
« Reply #4 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.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: backtick execution broken
« Reply #5 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 ?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12073
    • Travis build status
Re: backtick execution broken
« Reply #6 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.
(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 BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2545
Re: backtick execution broken
« Reply #7 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!

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2545
Re: backtick execution broken
« Reply #8 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