Passing file handle to compiler
-
- CodeLite Enthusiast
- Posts: 13
- Joined: Fri Nov 21, 2008 12:51 pm
- Contact:
Passing file handle to compiler
Hi,
I'm trying to use CodeLite together with the KEIL-compiler.
In general calling the compiler from the command line is not a problem. The thing is that KEIL wants to have a file where it can output its warnings and errors. If I call the compiler without a file a window opens, the messages are written there and the window closes again without the chance to read the warnings.
So is there a way to get a file handle to the output window of CodeLite in order to pass it to the command line for the compiler? Then the messages of KEIL should be written to the output window and I could read them.
Or is it possible to somehow open the file specified at the command line in the output window after compilation?
Thanks in advance for any reply.
Best regards
I'm trying to use CodeLite together with the KEIL-compiler.
In general calling the compiler from the command line is not a problem. The thing is that KEIL wants to have a file where it can output its warnings and errors. If I call the compiler without a file a window opens, the messages are written there and the window closes again without the chance to read the warnings.
So is there a way to get a file handle to the output window of CodeLite in order to pass it to the command line for the compiler? Then the messages of KEIL should be written to the output window and I could read them.
Or is it possible to somehow open the file specified at the command line in the output window after compilation?
Thanks in advance for any reply.
Best regards
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Passing file handle to compiler
Please give an example for how do you compile using the command line
This way, we could try and mimic this behaviour within codelite
Eran
This way, we could try and mimic this behaviour within codelite
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 13
- Joined: Fri Nov 21, 2008 12:51 pm
- Contact:
Re: Passing file handle to compiler
Hi,
a call to the compiler from the command line would look like this:
"D:\KeilV700\UV4\Uv4.exe -r rtos.uv3.uvproj -o Build_Output.txt" where uv4.exe is the compiler, -r is the option for the project to compile and -o is the option for the file to write the output to.
Like I said, the compiler call and the project is no problem, but what do I pass for the output file?
Regards
a call to the compiler from the command line would look like this:
"D:\KeilV700\UV4\Uv4.exe -r rtos.uv3.uvproj -o Build_Output.txt" where uv4.exe is the compiler, -r is the option for the project to compile and -o is the option for the file to write the output to.
Like I said, the compiler call and the project is no problem, but what do I pass for the output file?
Regards
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Passing file handle to compiler
How did you achieve the first part? (calling Uv4.exe and passing -r etc)
Did you use the standard way of creating new compiler from settings -> build settings -> new compiler? or are you using the 'custom build' option from your project settings ?
Eran
Did you use the standard way of creating new compiler from settings -> build settings -> new compiler? or are you using the 'custom build' option from your project settings ?
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 13
- Joined: Fri Nov 21, 2008 12:51 pm
- Contact:
Re: Passing file handle to compiler
Hi,
I simply used the custom build option of the project.
But if it requires creating a new compiler I'd be willing to do so
Regards
I simply used the custom build option of the project.
But if it requires creating a new compiler I'd be willing to do so
Regards
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Passing file handle to compiler
Ok... so can you please paste here the command you used for the build?Action wrote:I simply used the custom build option of the project.
Whats wrong with passing it like this:
Code: Select all
D:\KeilV700\UV4\Uv4.exe -r rtos.uv3.uvproj -o Build_Output.txt
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 13
- Joined: Fri Nov 21, 2008 12:51 pm
- Contact:
Re: Passing file handle to compiler
Hi,
After the compiler run - indepent on the result - Codelite always tells me that the build ended without errors and warnings although the compiler outputs three warnings in the Build_Output.txt.
That's why I was asking for the possibility to get a file handle to the output window so that I might pass it as a parameter to the compiler.
Regards
As for the compiler run nothings wrong. The thing is that the compiler writes its warnings and compiler errors only (!) to the Build_Output.txt and not in the output window of Codelite. This means that I don't see any compiler output in Codelite (and therefore don't know if the compiler had an error or not).Whats wrong with passing it like this:
After the compiler run - indepent on the result - Codelite always tells me that the build ended without errors and warnings although the compiler outputs three warnings in the Build_Output.txt.
That's why I was asking for the possibility to get a file handle to the output window so that I might pass it as a parameter to the compiler.
Regards
-
- CodeLite Enthusiast
- Posts: 13
- Joined: Fri Nov 21, 2008 12:51 pm
- Contact:
Re: Passing file handle to compiler
Hi,
does your not answering mean that there's no way to achieve what I wanted?
Is there a way to get CodeLite to parse a file after compiling and display the file to the compiler-output-window?
Best regards
does your not answering mean that there's no way to achieve what I wanted?
Is there a way to get CodeLite to parse a file after compiling and display the file to the compiler-output-window?
Best regards
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Passing file handle to compiler
The fact that I did not answer only means that it slipped my mind, sorry.Action wrote:does your not answering mean that there's no way to achieve what I wanted?
I have an solution that will work:
- In your project settings, define a new 'post build' command (right click on your project and select 'PostBuild') with the following command:
Code: Select all
cat Build_Output.txt
- Since you are under Windows, download cat.exe from here:
http://sourceforge.net/projects/unxutil ... p/download
- Extract the cat.exe and place it somewhere under your system PATH
Now, once the build will end, codelite will 'cat' the content of the Build_Output.txt and it will be displayed in the Build Output window
I just tried it with gcc under Windows and it is working fine (errors are clickable and marked with red/orange, the error counter is outputing the correct error number as well)
Give it a try and let me know how it went,
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 13
- Joined: Fri Nov 21, 2008 12:51 pm
- Contact:
Re: Passing file handle to compiler
No worries.eranif wrote:The fact that I did not answer only means that it slipped my mind, sorry.
The solution with the cat-utility works just fine!
But I had to do some minor adjustments. I deducted that once I defined the post-build-command the custom build seems to be disabled - at least CodeLite tried to compile my project using mingw which of course didn't work.
So I simply put the compiler call and the cat.exe-call into a batch-file that is called from the custom build. And this works just fine!
Thank you very much for your help.
Best regards