User forums > Using Code::Blocks
Cannot run a program compiled in Code Blocks ouside Code Blocks
ouch:
Also be sure your user has permission to actually launch executables in that folder.
Radek:
The current directory is always on the search path.
You need "./app" if the "app" is an "executable script" which will be run by something else known to the system. For example "./configure".
The only unusual libs used by the app are wxwidgets libs. wxwidgets is installed in /usr/lib so that it should be found.
AFAIK, there is no permission for running apps in a particular folder in Debian. There are "owner", "group" and "others" permissions.
If it were a general problem the the problem would be here all the time but it isn't.
Jenna:
--- Quote from: Radek on November 08, 2012, 06:31:47 am ---The current directory is always on the search path.
--- End quote ---
Not on linux !
At least not on the linuxes I use.
This is a security feature.
You always need to run an app with [relative_or_absolute_path_to]/exefile .
Did you try it and it also does not work, or did you even not try it.
If it's the second, I stop answering in this thread, because if you do not want any help, it's not worth to spend my time.
Radek:
I made some experiments:
(1) Copying file-roller (a windowing app) in a folder in my /home
- running by double-click : runs
- running from commandline as "file-roller" : runs
- running from commandline as "./file-roller" : runs
- running fom Midnight Commander by double-click : runs
(2) compiling a "hello world" app (a commandline app, only a "printf") named "test" in Code Blocks and copying in a folder in my /home
- running from Code Blocks : runs
- running by double-click : nothing happens (expected)
- running from commandline as "test" : runs but does not produce the output
- running from commandline as "./test" : runs and writes "hello world"
- running from Midnight Commander by double-click : opens a command window, runs and writes "hello world"
(3) copying the problematic app "viewer" (a windowing app) in a folder in my /home
- running from Code Blocks : runs
- running by double-click : nothing happens
- running from commandline as "viewer" : command not found
- running from commandline as "./viewer" : GP fault
- running from Midnight Commander : nothing happens
So, you need not write "./" in Debian for executables nor run executables only from "standard places". I have tried not only "./" but also specifying the full path (/home/radek/db/viewer), creating a launcher and assigning /home/radek/db/viewer to it (I got "cannot run a child"). I also tried to run "ldd" and "elfread" on the "viewer" and I got the expected output. No complaints that this is not an executable. Still, "command not found" or a GP fault.
There must something happen to linking an app in Code Blocks in the last version. Some strange binding or requesting.
MortenMacFly:
--- Quote from: Radek on November 08, 2012, 09:33:42 am ---There must something happen to linking an app in Code Blocks in the last version. Some strange binding or requesting.
--- End quote ---
Inspect the full build log and you'll see exactly what's going on. There is no hidden magic, never has been nor will be.
BTW: don't use "test" as application name on Unixes. This is a reserved system command. Surely you get different results if you call that by accident, i.e. w./the local prefix "./".
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version