Can't run .exe files outside of CodeLite

CodeLite installation/troubleshooting forum
Zer0
CodeLite Curious
Posts: 5
Joined: Tue Jan 04, 2011 5:26 am
Genuine User: Yes
IDE Question: c++
Contact:

Can't run .exe files outside of CodeLite

Post by Zer0 »

Hello,

I'm trying to create a small console app project with only one source file (main.cpp) that will work as a standalone executable that I can run through the terminal without using CodeLite's "Run" command.

I managed to compile and build the project, and I tried double-clicking on the .exe file that appeared in myprojectdir/debug. Unfortunately this does nothing.

Is there something extra I need to do with my project so that the program runs when I click the .exe file?

Thanks.

System Specs:

Running Ubuntu 10.10
Using GNOME Terminal 2.32
Codelite 2.9.0.4684
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Can't run .exe files outside of CodeLite

Post by eranif »

Zer0 wrote:Is there something extra I need to do with my project so that the program runs when I click the .exe file?
At first I thought you are using Windows... (.exe)

But then then I saw this:
Zer0 wrote:Running Ubuntu 10.10
Using GNOME Terminal 2.32
Codelite 2.9.0.4684
In that case:
Open a terminal shell and try to run it from the command line - this will tell you the error...

Eran
Make sure you have read the HOW TO POST thread
Zer0
CodeLite Curious
Posts: 5
Joined: Tue Jan 04, 2011 5:26 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Can't run .exe files outside of CodeLite

Post by Zer0 »

Ok, I opened up a shell in GNOME Terminal and navigated to the Debug folder of the project directory, but when I tried to run my_program.exe, it said that the .exe file wasn't found.

PS: I was using the 'exec' command in GNOME (exec [program/command name]). Is this the correct command to use?

Thank you
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Can't run .exe files outside of CodeLite

Post by DavidGH »

Hi,

Either:
1) Open a terminal. Use cd to navigate to the directory holding the binary (if it really is called my_program.exe, something is seriously wrong with your CodeLite settings ;) ). Then do:

Code: Select all

./my_program
where my_program is the name of the binary. Note that the './' is needed because that dir won't be in your PATH, so the file won't be found otherwise.

Or:
2) Open a terminal. do:

Code: Select all

/full/path/to/my_program
Regards,

David
Zer0
CodeLite Curious
Posts: 5
Joined: Tue Jan 04, 2011 5:26 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Can't run .exe files outside of CodeLite

Post by Zer0 »

Just to clarify, the file is (or should be) an executable file, but it does not have the file extension '.exe'. I'm simply a former Windows user and I'm used to having that extension on applications.

Also, I tried what you showed me, but I ended up getting an error 'Command not found.'
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Can't run .exe files outside of CodeLite

Post by eranif »

Can you paste here the *full* output of your build? (rebuild it and paste the output here)
I suspect that the build failed...
Eran
Make sure you have read the HOW TO POST thread
Zer0
CodeLite Curious
Posts: 5
Joined: Tue Jan 04, 2011 5:26 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Can't run .exe files outside of CodeLite

Post by Zer0 »

Ok, here it is:

Code: Select all

----------Build Started--------
/bin/sh -c '"make"  -j 2 -f "Hoppity_Hop1.mk"  all'
----------Building project:[ Hoppity_Hop1 - Debug ]----------
make: *** No rule to make target `/home/kevin/Documents/codelite projects/Hoppity_Hop/main.cpp', needed by `Debug/main.o'.  Stop.
make: *** Waiting for unfinished jobs....
----------Build Ended----------
0 errors, 0 warnings
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Can't run .exe files outside of CodeLite

Post by eranif »

As you can see, you dont have any executable... (build failed)

1) Please read the build output
2) I am guessing that the problem can be:
- codelite has no permissions to create the Debug folder
- the SPACE in the folder path ("/home/kevin/Documents/codelite projects/Hoppity_Hop/main.cpp")

Eran
Make sure you have read the HOW TO POST thread
Zer0
CodeLite Curious
Posts: 5
Joined: Tue Jan 04, 2011 5:26 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Can't run .exe files outside of CodeLite

Post by Zer0 »

It's not the space, I changed it to an underscore and it still has problems. Also, there is already a debug folder with the executable file and the object file.

I cleaned and then built the project and then the workspace. This is the build info I got:

Code: Select all

----------Build Started--------
/bin/sh -c '"make"  -j 2 -f "Hoppity_Hop1.mk"  all'
----------Building project:[ Hoppity_Hop1 - Debug ]----------
g++ -c  "/home/kevin/Documents/codelite_projects/Hoppity_Hop/main.cpp" -g  -o ./Debug/main.o "-I." "-I." 
g++ -o ./Debug/Hoppity_Hop1 ./Debug/main.o  "-L."   
----------Build Ended----------
0 errors, 0 warnings
By the looks of it the build succeeded, but I still can't run the executable files with GNOME terminal.
Post Reply