Program exited with return code: -1

CodeLite installation/troubleshooting forum
User avatar
cjnboston
CodeLite Curious
Posts: 5
Joined: Thu Aug 25, 2011 8:03 pm
Genuine User: Yes
IDE Question: C++
Contact:

Program exited with return code: -1

Post by cjnboston »

Hi All,

I'm a new user to Codelite. The program appears to be functioning properly (when I purposely break my code the appropriate errors appear) but when I try to run the program terminal seems to not be able to find the .cpp file. Codelite returns the following error:

Current working directory: /Users/cjnboston/Library/Application Support/codelite/COSC_102/Chapter_1_Lab_1/Debug
Running program: /Applications/CodeLite.app/Contents/SharedSupport/OpenTerm 'cd "/Users/cjnboston/Library/Application Support/codelite/COSC_102/Chapter_1_Lab_1" && cd "./Debug" && ./Chapter_1_Lab_1 '
Program exited with return code: -1

Terminal returns the following error:
(comp name):~ cjnboston$ cd "/Users/cjnboston/Library/Application Support/codelite/COSC_102/Chapter_1_Lab_1" && cd "./Debug" && ./Chapter_1_Lab_1
-bash: ./Chapter_1_Lab_1: No such file or directory

I've spent a lot of time trying to diagnose this. I'm running a Mac OS 10.6.8 (which I completely reformatted last night in case the RoR programming i was being taught a few years ago was conflicting). I appreciate any assistance - I'm very new to programming but finding it addictive!

Corinna
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Program exited with return code: -1

Post by eranif »

It appears that codelite does not find the executable.

The question is: did you build your project and whether the build ended successfully?

In order for me to able to help you, I will need to see the complete build log.

Please read this:
viewtopic.php?f=3&t=804#p3562

Eran
Make sure you have read the HOW TO POST thread
User avatar
cjnboston
CodeLite Curious
Posts: 5
Joined: Thu Aug 25, 2011 8:03 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Program exited with return code: -1

Post by cjnboston »

Hi Eran,

I did build my project successfully. When I did some remedial error checking (reversing the cout arrows, some other things) it gave the proper error messages. The build log is as follows:

g++ -c "/Users/cjnboston/Library/Application Support/codelite/COSC_102/Chapter_1_Lab_1/main.cpp" -g -W -o ./Debug/main.o -I. -I. -I/usr/include/qt4 -I/usr/include/qt4/QtGui
g++ -o ./Debug/Chapter_1_Lab_1 ./Debug/main.o -L. -L/usr/lib/qt4 -lQtCore -lQtGui
ld: warning: directory '/usr/lib/qt4' following -L not found
ld: library not found for -lQtCore
collect2: ld returned 1 exit status
make[1]: *** [Debug/Chapter_1_Lab_1] Error 1
make[1]: Leaving directory `/Users/cjnboston/Library/Application Support/codelite/COSC_102/Chapter_1_Lab_1'
make: *** [All] Error 2
make: Leaving directory `/Users/cjnboston/Library/Application Support/codelite/COSC_102'
----------Build Ended----------
0 errors, 0 warnings

Thanks for the idea. Could you point me in the right direction to fix the issue?
User avatar
cjnboston
CodeLite Curious
Posts: 5
Joined: Thu Aug 25, 2011 8:03 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Program exited with return code: -1

Post by cjnboston »

A little bit more information:
I'm running version Codelite v2.10.0.4780 on a MacBook Pro with OS 10.6.8. I downloaded Xcode 3 last night when I rebuilt my mac.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Program exited with return code: -1

Post by eranif »

cjnboston wrote:ld: warning: directory '/usr/lib/qt4' following -L not found
ld: library not found for -lQtCore
collect2: ld returned 1 exit status
make[1]: *** [Debug/Chapter_1_Lab_1] Error 1
make[1]: Leaving directory `/Users/cjnboston/Library/Application Support/codelite/COSC_102/Chapter_1_Lab_1'
Even though codelite reported : "0 errors, 0 warnings" it is a bug... your code did not compile successfully as seen in the code qouted above.

I see that you are trying to build a QT project, however, it seems like you dont have Qt installed on your machine or the paths are incorrect
ld: warning: directory '/usr/lib/qt4' following -L not found
Eran
Make sure you have read the HOW TO POST thread
User avatar
cjnboston
CodeLite Curious
Posts: 5
Joined: Thu Aug 25, 2011 8:03 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Program exited with return code: -1

Post by cjnboston »

Brilliant. Thank you so much. I'll install Qt and retry!
User avatar
cjnboston
CodeLite Curious
Posts: 5
Joined: Thu Aug 25, 2011 8:03 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Program exited with return code: -1

Post by cjnboston »

That fixed my issue. Thank you so much for your help.
Post Reply