I have been trying to use Codelite but without much success. I am confused as to what to do, when to do it and some terminology.
- What is the heirarchy of program/project and workspace?
Initially I am just running a simple program to read in a file and display it but I am getting all sorts of errors. I want to make/build/run it as a C program but I suspect that my various settings are up the creek.
My code is called readRPTfile.c (well I hope it is). It is below
Code: Select all
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[])
{
FILE *inputFile;
char c,cc;
inputFile = fopen("20090220085501237.RPT", "r"); //fopen("file name","mode i.e r-read");
printf("File opened successfully. Contents:\n\n");
while ((c=getc(inputFile))!=EOF)
{ //loop for reading a char up to end of file
while ((cc=getc(inputFile))!='\n') { // loop for reading a char up to end of line
putchar(cc); // to display line
}
}
printf("\n\nNow closing file...\n");
fclose(inputFile);
}
My workspace within CodeLite looks like attachment called readRPT.c_workspace.jpg. The worst part is that I have no idea which ScanImages folder Codelite thinks it is in when it runs.
After writing my code and making sure that the source file 20090220085501237.RPT is in the right location to me (but I do not know where CodeLite thinks it is) I use the Run Active project button. See attachment called RunActiceProjectbutton.jpg
A DOS command window appears that says 'Press any key to continue ..'. I do so and the window disappears.
Under the Output View pane the following occurs
- Build tab is empty
- Errors tab is empty
- Find Results tab is empty
- Replace Results tab is empty
- Output tab has the contents
Code: Select all
Current working directory: C:\ScanImages\Scan Images\ScanImages
Running program: le_exec.exe ./ScanImages
Program exited with return code: 2293464
- Trace tab has the contents (note the 6th line)
Code: Select all
09:04:19: Loaded plugin: Gizmos Plugin - a collection of useful utils for C++
09:04:19: Loaded plugin: Snippet wizard
09:04:20: Loaded plugin: Subversion
09:04:20: Loaded plugin: A Unit test plugin based on the UnitTest++ framework
09:04:20: Loaded plugin: wxFormBuilder integration with CodeLite
09:04:20: File: C:\ScanImages\Scan Images\readRPTfile.cpp does not exist!
09:04:20: Loading accelerators from 'C:\Program Files\CodeLite C/config/accelerators.conf.default'
09:04:20: Loading accelerators from 'C:\Program Files\CodeLite C\plugins\resources\abbreviation.accelerators'
09:04:20: Loading accelerators from 'C:\Program Files\CodeLite C\plugins\resources\external_tools.accelerators'
09:04:20: Loading accelerators from 'C:\Program Files\CodeLite C/config/accelerators.conf.default'
09:04:20: Loading accelerators from 'C:\Program Files\CodeLite C\plugins\resources\abbreviation.accelerators'
09:04:20: Loading accelerators from 'C:\Program Files\CodeLite C\plugins\resources\external_tools.accelerators'
09:04:21: Install path: C:\Program Files\CodeLite C
09:04:21: Startup Path: C:\Program Files\CodeLite C
Why is it looking for a ccp file? I have saved my file as .c file.
Do I need to use the Build Active project button 1st?
I do hope I have all the modules I need and they are installed properly.
The given documentation assumes or presupposes an awful lot of knowledge that I do not seem to have. (Maybe I need a another, less comprehensive C coder to begin with?)