Page 1 of 1

Compile and Run individual files ?

Posted: Mon Jul 19, 2010 1:26 pm
by Bamboo
I have a question: Can CodeLite compile and run individual files (just Open them) which don't need to be in a project or workspace ?
Thank you very much!

Re: Compile and Run individual files ?

Posted: Mon Jul 19, 2010 1:49 pm
by eranif
You can define a tool for such task using the 'external tools' plugins

from the menu: Plugins -> External Tools -> Configure tools

create new tool

Name: compile single file
Tool path: g++
Arguments: $(CurrentFileFullPath) -o myexe -g
and check the options: Capture output process

This tool will simply compile the active file using the pattern g++ '$(CurrentFileFullPath) -o myexe -g'

You can define a shortcut for this tool using the 'settings -> keyboard shortcuts' and search for the external_tool_N entry

You can also simply run it from the toolbar or from the plugins menu

Eran

Re: Compile and Run individual files ?

Posted: Mon Jul 19, 2010 2:00 pm
by Bamboo
Thanks for responding :D
But I think all the files will have the same name "myexe", aren't they?

Beside, if I just open 1 file by CodeLite and run it by that tool, I always have the msg

Code: Select all

g++: $(CurrentFileFullPath): No such file or directory
g++: no input files
Program exited with return code: 1

Re: Compile and Run individual files ?

Posted: Mon Jul 19, 2010 3:15 pm
by eranif
Which version of codelite are you using?

Eran

Re: Compile and Run individual files ?

Posted: Mon Jul 19, 2010 5:26 pm
by Bamboo
I'm using v 2.5.2.4031
The problem happens when I trying to compile individual file with no workspace opened