Code::Blocks Forums

User forums => Help => Topic started by: XG on January 09, 2006, 09:28:19 am

Title: CB for DOS GCC (DJGPP) ?
Post by: XG on January 09, 2006, 09:28:19 am
In DJGPP(GCC 4.01) , CB cant capture its output , when error :

gcc.exe -g  -IC:\DJGPP\include  -c main.cpp -o .objs\main.o
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

run same command in dos box:
gcc.exe -g  -IC:\DJGPP\include  -c main.cpp -o .objs\main.o
main.cpp: In function 'int main()':
main.cpp:15: error: 'cBox' was not declared in this scope

????

I test :

gcc.exe gcc.exe -g  -IC:\DJGPP\include  -c main.cpp -o .objs\main.o > output 
ouptut file is 0 byte size.

gcc.exe gcc.exe -g  -IC:\DJGPP\include  -c main.cpp -o .objs\main.o > output 2>&1
output file have full error info.
Title: Re: CB for DOS GCC (DJGPP) ?
Post by: takeshimiya on January 09, 2006, 08:08:03 pm
gcc.exe gcc.exe ???
Title: Re: CB for DOS GCC (DJGPP) ?
Post by: sethjackson on January 09, 2006, 08:10:48 pm
gcc.exe gcc.exe ???

:lol:
Title: Re: CB for DOS GCC (DJGPP) ?
Post by: XG on January 10, 2006, 01:13:13 am
I think you didnt use DJGPP,  only one file "gcc.exe" for C and C++ in DJGPP.
Title: Re: CB for DOS GCC (DJGPP) ?
Post by: Hirsngnimpf on February 16, 2006, 07:31:46 pm

Hi XG.

I just came across that same problem and it seems i found a cure.
Installed C::B 1.02RC2 with MinGW and tried a console-App, everything OK.
Installed DJGPP same version as you did and set up compiler options for it.
I did that by using a copy of the GNU GCC -Settings used for MinGW.
Then changed the Compiler's installation directory to my DJGPP-Directory
and rebuild.
Just as you stated, it tries to build, but the compiler's output is lost in nowhere.
Tried redirection on the commandline as you did, same results. And exactly the
same behaviour as for MinGW-G++. Strange enough.
So i decided to go a bit deeper and followed both compiler's File-IO with NTFileMon.
Result as followes:
for MinGW-GCC C::B calls the mingw32-g++.exe.
for DJGPP C::B seems to call NTVDM, which then calls gpp.exe
True, C::B will not call NTVDM, instead ye old Windows itself finds gpp.exe is an
old 16-Bit-Program and those get executed in the virtual Dos-Box NTVDM  :shock:
So, what's the clue?
Not realy knowing what the problem is with redirection in NTVDM i decided to
try a rude workaround. Just add a "cmd /C " to each command that is a 16-Bit executable.
So, in the Dialog "Compiler Settings" under "Other" -> "Advanced options..."
set "Compile single file to object file" to
cmd /C $compiler $options $includes -c $file -o $object
and alike for the other commands.
And, yes, it works. Now i get propper parsed compiler output.
It's not linking now, but that'll be a minor problem with startup-Code, i think.
And, i do get a Build message for that :-)

Good luck to XG an who else tries C::B to replace the fairly old RHIde.
Stefan


Title: Re: CB for DOS GCC (DJGPP) ?
Post by: MortenMacFly on February 16, 2006, 07:52:08 pm
I wonder wheether you missed the following in the compiler setup:
Menu "Settings" -> Compiler and Debugger -> Tab "Other":
Make sure "Compiler logging" is set to "Full command line".
Did you do that?!
With regards, Morten.
Title: Re: CB for DOS GCC (DJGPP) ?
Post by: Jordar on February 24, 2006, 12:16:30 am
Thanks Stefan you are a genius!  I have been having this same problem and am also using DJGPP.   If you are still having trouble linking I would note that I add to add the -lstdcxx and -lm to my linker options otherwise it gave me a wierd error.

Does anyone have any idea if/how hard it would be to get the built in debugger to work for a DJGPP created binary?

Thanks to all!

Christopher
Title: Re: CB for DOS GCC (DJGPP) ?
Post by: sdc395 on December 06, 2006, 04:18:46 pm
Hi all

A C::B newbie here.  I'm about to attempt a DJGPP project and I'm hoping to use C::B as the IDE.  Am I right in thinking that, if I follow the tips above, I'll get a perfect DOS exe?

Also, has anyone had any luck using C::B to debug their DOS exe?  Any other tips?

Cheers
Simon