Compiled program execution error on linux

CodeLite installation/troubleshooting forum
User avatar
LeetShiva
CodeLite Enthusiast
Posts: 20
Joined: Wed Mar 14, 2012 6:39 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Compiled program execution error on linux

Post by LeetShiva »

I guess it is error here in wrapper:

Code: Select all

#!/bin/bash 

## A wrapper script around the xterm utility 
## which allows codelite to export LD_LIBRARY_PATH into the exterm
## shell
if [ $# -ne 2 ]; then
	echo "usage: codelite_xterm '<Title>' '<Program>'"
	exit 1
fi

program_title=$1
if [ "${LD_LIBRARY_PATH}" = "" ]; then
	## LD_LIBRARY_PATH is not defined OR empty
	## Run xterm without the bash wrapper
	xterm -T "$program_title" -e $2 2> /dev/null
else
	xterm -T "$program_title" -e /bin/bash -c 'export LD_LIBRARY_PATH=$0;shift;$@' $LD_LIBRARY_PATH "$@" 2> /dev/null
fi

Just what should I change to remind you I get error message with /bin/sh not /bin/bash and that is maybe problem ?

Code: Select all

Running program: /usr/bin/xterm '$TITLE' '/bin/sh -f /usr/bin/codelite_exec ./HelloWorld '
Program exited with return code: -1
mkorhonen
CodeLite Curious
Posts: 5
Joined: Fri Mar 16, 2012 5:37 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Compiled program execution error on linux

Post by mkorhonen »

For what it's worth, I'm getting the same error with an existing C++ Makefile project. I can successfully build the project by running the correct make commands, and step into it with the debugger. However, when I go to the menubar and click Build -> Run (or hit CTRL-F5), the program does not execute and I see the following on the "Output" tab:

Current working directory: /home/MATTER/mkorhonen/svn_working/sw/sw/branches/qsrv-dev/chassis/packet_proc
Running program: /usr/bin/codelite_xterm 'bin/packet-daemon_unit_test --gtest_filter='Mp4ParserTest.youtube_hd_moov' ' '/bin/sh -f /usr/bin/codelite_exec LD_LIBRARY_PATH=../vendor/qpid/target/arch/x86_64/lib:/home/MATTER/mkorhonen/svn/sw/sw/branches/qsrv-dev/protocol_buffers/target/arch/x86_64/lib:../vendor/boost/target/arch/x86_64/lib:../vendor/liburcu/target/arch/x86_64/lib:../vendor/tbb/target/arch/x86_64/lib/ bin/packet-daemon_unit_test --gtest_filter='Mp4ParserTest.youtube_hd_moov' '
Program exited with return code: -1


If I manually copy and paste this line that CodeLite attempts to execute in a bash shell, the program executes as expected:
"/usr/bin/codelite_xterm '...<snip>...' '/bin/sh -f /usr/bin/codelite_exec LD_LIBRARY_PATH=...<snip>...'"

Can you help me figure out why I can't run this application within CodeLite, but I can run it manually?

I'm using Ubuntu 10.04 LTS on a 64-bit x86 machine, CodeLite version v3.5.5378, and I did not compile CodeLite myself (I just installed the package).

Let me know if you need more information.
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Compiled program execution error on linux

Post by DavidGH »

LeetShiva wrote:What version to choose from https://sourceforge.net/projects/codeli ... elite-3.5/
I gues I should try GTK version cause I already tried ubuntu version and it do not work.
You're running debian. Assuming that's debian squeeze, why not use the debian version instead, as has now been suggested twice?

Uninstall your current version, then follow the instructions in this link and you'll automatically get the correct version. If you still have a problem, then you've found a bug.
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Compiled program execution error on linux

Post by DavidGH »

mkorhonen wrote: Running program: /usr/bin/codelite_xterm 'bin/packet-daemon_unit_test --gtest_filter='Mp4ParserTest.youtube_hd_moov' ' '/bin/sh -f /usr/bin/codelite_exec LD_LIBRARY_PATH=../vendor/qpid/target/arch/x86_64/lib:/home/MATTER/mkorhonen/svn/sw/sw/branches/qsrv-dev/protocol_buffers/target/arch/x86_64/lib:../vendor/boost/target/arch/x86_64/lib:../vendor/liburcu/target/arch/x86_64/lib:../vendor/tbb/target/arch/x86_64/lib/ bin/packet-daemon_unit_test --gtest_filter='Mp4ParserTest.youtube_hd_moov' '
Two thoughts:
  • It was a good idea to paste that line into a normal terminal. Did you first cd to /home/MATTER/mkorhonen/svn_working/sw/sw/branches/qsrv-dev/chassis/packet_proc?

    You seem to have a lot of single-quotes there. Some are from CodeLite; try removing the others/escaping them/changing them to double-quotes/
Regards,

David
mkorhonen
CodeLite Curious
Posts: 5
Joined: Fri Mar 16, 2012 5:37 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Compiled program execution error on linux

Post by mkorhonen »

DavidGH wrote:
mkorhonen wrote: Running program: /usr/bin/codelite_xterm 'bin/packet-daemon_unit_test --gtest_filter='Mp4ParserTest.youtube_hd_moov' ' '/bin/sh -f /usr/bin/codelite_exec LD_LIBRARY_PATH=../vendor/qpid/target/arch/x86_64/lib:/home/MATTER/mkorhonen/svn/sw/sw/branches/qsrv-dev/protocol_buffers/target/arch/x86_64/lib:../vendor/boost/target/arch/x86_64/lib:../vendor/liburcu/target/arch/x86_64/lib:../vendor/tbb/target/arch/x86_64/lib/ bin/packet-daemon_unit_test --gtest_filter='Mp4ParserTest.youtube_hd_moov' '
Two thoughts:
  • It was a good idea to paste that line into a normal terminal. Did you first cd to /home/MATTER/mkorhonen/svn_working/sw/sw/branches/qsrv-dev/chassis/packet_proc?
Yes I ran it from the .../packet_proc directory. If I don't run it in the correct directory, I get a different error message (which is expected): 'packet-daemon_unit_test not found'
DavidGH wrote: You seem to have a lot of single-quotes there. Some are from CodeLite; try removing the others/escaping them/changing them to double-quotes/
[/list]
Regards,

David
Thanks for the feedback. I tried the following:
1. Removing the program argument [--gtest_filter='Mp4ParserTest.youtube_hd_moov'] "fixed" the problem; an xterm window opened when I hit CTRL-F5 and the program ran in it.
2. I tried adding the program argument [--gtest_filter='Mp4ParserTest.youtube_hd_moov' ] back and reproduced the issue. CTRL-F5 doesn't run launch an xterm window, but I can copy and paste the /usr/bin/codelite_xterm line in a terminal and it works
3. I noticed that I accidentally had a space after the last single quote in (2). I tried fixing this using the program argument [--gtest_filter='Mp4ParserTest.youtube_hd_moov'], but this had the same behavior as (2).
4. I tried changing the single quotes to double quotes by using the program argument [--gtest_filter="Mp4ParserTest.youtube_hd_moov"]. This did launch an xterm window, but the application I'm using doesn't appear to support the double quotes.
5. I tried escaping the single quotes by using the program argument [--gtest_filter=\'Mp4ParserTest.youtube_hd_moov\']. This launched an xterm window with CTRL-F5, but it looks like the application didn't see the correct arguments. When I tried copying and pasting the /usr/bin/codelite_xterm line in a terminal, the single quotes weren't terminated correctly
6. I tried escaping the single quotes by using the program argument [--gtest_filter=\''Mp4ParserTest.youtube_hd_moov\'']. This didn't launch an xterm window with CTRL-F5; when I tried copying and pasting the /usr/bin/codelite_xterm line in a terminal, the application saw extra backslash characters in the commandline arguments
7. I tried the same program argument as (3) [--gtest_filter='Mp4ParserTest.youtube_hd_moov'], and changed Settings->Global Editor Preferences->Terminal to use double quotes by specifying this command: [/usr/bin/codelite_xterm "$(TITLE)" "$(CMD)"]. Both CTRL-F5 and copying-and-pasting had the same behavior: an xterm was launched, but the application didn't appear to recognize the commandline argument.
8. I tried the same program argument as (3) [--gtest_filter='Mp4ParserTest.youtube_hd_moov'], and changed Settings->Global Editor Preferences->Terminal to use this command: [$(CMD)]. CTRL-F5 didn't run the application (similar to the original problem). Copying-and-pasting allowed my to run the application on the shell

Can you think of anything else I can try? Let me know if you need more information.

Thanks!
Mark
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Compiled program execution error on linux

Post by DavidGH »

Hmm. I suppose there's a chance that, as it doesn't contain any spaces, the app will cope without any quoting: [--gtest_filter=Mp4ParserTest.youtube_hd_moov]

Otherwise you could try removing the quotes around $(CMD): [/usr/bin/codelite_xterm '$(TITLE)' $(CMD)].

Failing both, try replacing the /usr/bin/codelite_xterm with something else. I see that I'm still using a simple xterm there, inherited from an ancient .codelite/config.
mkorhonen
CodeLite Curious
Posts: 5
Joined: Fri Mar 16, 2012 5:37 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Compiled program execution error on linux

Post by mkorhonen »

DavidGH wrote:Hmm. I suppose there's a chance that, as it doesn't contain any spaces, the app will cope without any quoting: [--gtest_filter=Mp4ParserTest.youtube_hd_moov]
Thanks! This is sufficient to workaround the issue for now. CTRL-F5 ran the application as I expected.
DavidGH wrote:Otherwise you could try removing the quotes around $(CMD): [/usr/bin/codelite_xterm '$(TITLE)' $(CMD)].
Unfortunately, this didn't work. When I copy and paste the /usr/bin/xcodelite_term command on the terminal, it doesn't do anything other than print "usage: codelite_xterm '<Title>' '<Program>'"
DavidGH wrote:Failing both, try replacing the /usr/bin/codelite_xterm with something else. I see that I'm still using a simple xterm there, inherited from an ancient .codelite/config.
I'll likely experiment with this later if I need to run the same application with a commandline argument with spaces and this issue isn't fixed in a future release.

Thanks for your support!
Mark
User avatar
LeetShiva
CodeLite Enthusiast
Posts: 20
Joined: Wed Mar 14, 2012 6:39 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Compiled program execution error on linux

Post by LeetShiva »

When I run the command in my terminal I mean when I copy /usr/bin/xterm -title'$TITLE' -e '/bin/sh -f /usr/bin/codelite_exec ./HelloWorld ' and paste and run in terminal I get following error:
No absolute path found for shell: /bin/sh -f /usr/bin/codelite_exec ./HelloWorld '
Anyone know how to hgmm make that work ?
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Compiled program execution error on linux

Post by DavidGH »

LeetShiva wrote:When I run the command in my terminal I mean when I copy /usr/bin/xterm -title'$TITLE' -e '/bin/sh -f /usr/bin/codelite_exec ./HelloWorld ' and paste and run in terminal I get following error:
No absolute path found for shell: /bin/sh -f /usr/bin/codelite_exec ./HelloWorld '
Anyone know how to hgmm make that work ?
Please answer the following questions:
1) Which debian version are you on?
2) Exactly which CodeLite version are you now using, and where did you get it from? (Or did you build it from source?)
3) What is the result of doing, in a terminal: ls /usr/bin/codelite_exec
I mean when I copy /usr/bin/xterm -title'$TITLE' -e '/bin/sh -f /usr/bin/codelite_exec ./HelloWorld ' and paste and run in terminal
4) Try that again. Presumably it'll still fail. What is the result of then doing, in the same terminal: ls ./HelloWorld
User avatar
LeetShiva
CodeLite Enthusiast
Posts: 20
Joined: Wed Mar 14, 2012 6:39 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Compiled program execution error on linux

Post by LeetShiva »

I have tried to compile new version 3.5 from source and I have downloaded from sourceforge page and GTK and ubuntu src and build and one and other and both give the same error.
Also I have used till now a long time version 2.8.0.4537 from debian repos that is from testing unstable repo and I used that version for a moths :) It worked perfectly fine but when I tried to download new version I get notification taht there is new version available I tried and with .deb ubut=ntu package from http://www.codelite.co.uk/debian/ repo and get the same error then I tried to build it myself and do that with gtk and ubuntu version and neither work I searched after adding debian repo from http://www.codelite.co.uk/debian/ to my sources list and get the same 2.8 version in it.
Ok then I checked and saw that I have bad written repo in sources list now I have updated 3.5.5375 version on my debian testing :) but it still give the same error when I run it.

Code: Select all

Running program: xterm '/bin/sh -f /usr/bin/codelite_exec ./HelloWorld '
Program exited with return code: -1
When I run :$ ls /usr/bin/codelite_exec i get nothing but that same file script I mean there is that script on the system.
when I run :$ ls -l /usr/bin/codelite_exec i get this output permisons octaly are 755 :) rwxr-xr-x

Now I'm downloading debug symbols from repo and I'll try it again.
I was satisfied programer that have use codelite for everyday C++ programing and find it more useful than Code::Bloks and eclipse together
Faster smaller and more intuitive interface.
Post Reply