I work with the .pas in c:\progs, and I have the following paths by the way: Include: c:\djgpp\include (Can I put here c:\progs ?) Libraries: c:\djgpp\lib Object c:\progs\obj Source c:\progs Standard Headers c:\djgpp\include (I have my doubts on this one, what is the purpose of this path?) Main target c:\progs\whatever.exe Primary file ? what is the purpose of this one?
When I compile the files, rhide put the *.o files in the c:\djgpp\bin, so what's the matter with the Object path?
Thanks for your patience, and help. Alejandro Villarroel
Alejandro Villarroel a écrit:
I work with the .pas in c:\progs, and I have the following paths by
the way: Include: c:\djgpp\include (Can I put here c:\progs ?)
Not recommended at all. It contains headers files for C programming. You will not use them directly if you programm only in Pascal, but you need them indirectly because for example crt.pas calls crt.c
Libraries: c:\djgpp\lib
ok
Object c:\progs\obj
can be ok
Source c:\progs
ok
Standard Headers c:\djgpp\include (I have my doubts on this one,
what is the purpose of this path?)
see above
Main target c:\progs\whatever.exe
ok
When I compile the files, rhide put the *.o files in the
c:\djgpp\bin, so what's the matter with the Object path?
... from first part :
I have djgpp and gpc installed in my PC. I run c:\djgpp\rhide, and what paths I have to type and where?
That's the mistake. You should cd to c:\progs and issue from there rhide whatever.gpr to open a project, etc... By default rhide would put .o files also in c:\progs. If you want to put them in c:\progs\objects you should use the gpc compiler option --object-destination-path=c:/progs/objects in rhide you inlude this by hitting Options/compiler Options With command line programming you should issue gpc --object-... --automake whatever.pas -o whatever.exe Beware that there is also in rhide an Options/Directories/Objects where the C compiler looks for .o files and that gpc has also an --objects-path option for apparently the same purpose (for _looking_ only, not for _putting_ .o files)
Primary file ? what is the purpose of this one?
For any but the very elementary programs, you should use units and/or modules to contain reusable code. THen you have a main program whatever.pas which says it needs external units or modules by containing an instruction: uses unit1, unit2; or something like: import ... (I am not familiar with this kind of stuff, I use only the previous one) then in command line programming you issue gpc --automake whatever.pas -o whatever.exe and gpc knows by reading whatever.pas that it should compile also unit1.pas and unit2.pas and link the resulting unit1.o and unit2.o with whatever.o to produce whatever.exe Within rhide you should open a project whatever.gpr in the c:\progs directory and give him as primary file whatever.pas He will then issue exactly the previous command line when you hit Compile/Make (F9) or Compile/Build all If you hit Compile/Compile (Alt F9) it will compile only the file in the current edit window by issuing e.g. gpc -c unit1.pas -o unit1.o without any automake nor linking. This is useful only if you want to write and check the syntax of a given unit without compiling the whole stuff (which may be rather long with big projects) Hope this helps Maurice