Re: re-compile error

From: jacob navia (jacob_at_jacob.remcomp.fr)
Date: 12/13/04


Date: Mon, 13 Dec 2004 13:26:57 +0100

developer wrote:
> re-compile under dev -c++ bloodshed.
>
> can u help ?
>
>
> #include<dos.h>
> #include<process.h>
> #include<io.h>
> #include<stdio.h>
> #define STROBE 0x01
> #define NOT_STB 0x00
>
> void main()
> {
> char i,j;
> unsigned int CTRL_PORT,STAR_PORT;
> unsigned int far *DATA_PORT;
> DATA_PORT=MK_FP(0x0000,0x0408);
> STAR_PORT=*DATA_PORT+1;
> CTRL_PORT=STAR_PORT+1;
> outport(CTRL_PORT,0x00);
> while(1)
> {
> outport(*DATA_PORT,0x00);
> delay(2000);
> outport(*DATA_PORT,0xff);
> delay(2000);
> outport(*DATA_PORT,0x00);
> delay(2000);
> j=0x80;
> for(i=0;i<8;i++)
> {
> outport(*DATA_PORT,j);
> j=j>>1;
> delay(2000);
> }
> }
> }
>
>
> Compiler: Default compiler
> Executing gcc.exe...
> gcc.exe "C:\Documents and Settings\farm\TEST.C" -o "C:\Documents and
> Settings\farm\TEST.exe" -g3 -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
> C:/Documents and Settings/farm/TEST.C:9: `main' must return `int'
> C:/Documents and Settings/farm/TEST.C: In function `int main(...)':
> C:/Documents and Settings/farm/TEST.C:12: parse error before `*'
> token
> C:/Documents and Settings/farm/TEST.C:13: `DATA_PORT' undeclared
> (first use this function)
> C:/Documents and Settings/farm/TEST.C:13: (Each undeclared
> identifier is reported only once for each function it appears in.)
> C:/Documents and Settings/farm/TEST.C:13: `MK_FP' undeclared (first
> use this function)
> C:/Documents and Settings/farm/TEST.C:16: `outport' undeclared
> (first use this function)
> C:/Documents and Settings/farm/TEST.C:20: `delay' undeclared (first
> use this function)
>
> C:/Documents and Settings/farm/TEST.C: At global scope:
> C:/Documents and Settings/farm/TEST.C:33: stray '\32' in program
>
> C:/Documents and Settings/farm/TEST.C:33:3: warning: no newline at end of
> file
>
> Execution terminated
>
>

You are running under the windows OS. This OS is NOT the DOS
operating system that was discontinued more than 10 years ago.

This program is writing to a specific address. This will never work
under the win32 versions of windows (windows 95 or higher).

But all this is probably too technical for you. The fact that you
attempt to compile this under windows shows that you haven't got
any idea what this code is doing. I would suggest that you find
someone competent and give this to him (her).

Under DOS, you could write to any memory address since the OS
wasn't using protected mode and virtual memory. This doesn't work
since windows 95...

Anyway, maybe it will run if you compile it under a 16 bit DOS compiler
under the emulation layer of windows, who knows.

jacob



Relevant Pages

  • Re: Bug/problem with lcc-win
    ... layer or through using a sufficiently old version of win32, ... which is a 16 bit DOS emulation mode (which does ... Who writes a Win32 compiler and is ... unfamiliar with the basic execution modes of Windows? ...
    (comp.lang.c)
  • Re: hmm..interesting
    ... you've got a discussion of ARM vs Intel architecture here: ... And ARM is rapidly running away from RISC. ... mainstream (many netbooks and smartphones run Linux instead of Windows ... And hardly any C compiler does. ...
    (comp.sys.acorn.hardware)
  • Re: Getting a C++ compiler for Windows XP
    ... My previous computer ran DOS 5.0 and Window 3, ... However, I have now bought a new computer, and this one runs Windows XP ... I thought I read that Microsoft had a C++ compiler which they let you ... come home with a compiler and some manuals for it. ...
    (comp.programming)
  • Re: Stalin ported to Windows.
    ... Therefore, the compiler ... Stalin from Scheme sources; it took six hours to generate the C ...   Junia and Reane  got a working Windows port from the C ...
    (comp.lang.scheme)
  • Re: hmm..interesting
    ... work out at more power per Watt than x86. ... mainstream (many netbooks and smartphones run Linux instead of Windows ... the fact that Visual Studio allows you to get away with fairly sloppy ... difficult to find a C compiler that *doesn't* have vendor-specific ...
    (comp.sys.acorn.hardware)