Page 1 of 1

Program exited with return code: -1

Posted: Thu Aug 25, 2011 8:11 pm
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

Re: Program exited with return code: -1

Posted: Thu Aug 25, 2011 8:37 pm
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

Re: Program exited with return code: -1

Posted: Thu Aug 25, 2011 10:46 pm
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?

Re: Program exited with return code: -1

Posted: Thu Aug 25, 2011 10:53 pm
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.

Re: Program exited with return code: -1

Posted: Thu Aug 25, 2011 11:58 pm
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

Re: Program exited with return code: -1

Posted: Fri Aug 26, 2011 12:03 am
by cjnboston
Brilliant. Thank you so much. I'll install Qt and retry!

Re: Program exited with return code: -1

Posted: Fri Aug 26, 2011 4:25 pm
by cjnboston
That fixed my issue. Thank you so much for your help.