473,799 Members | 3,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

re-compile error

re-compile under dev -c++ bloodshed.

can u help ?
#include<dos.h>
#include<proces s.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_PO RT,0x00);
while(1)
{
outport(*DATA_P ORT,0x00);
delay(2000);
outport(*DATA_P ORT,0xff);
delay(2000);
outport(*DATA_P ORT,0x00);
delay(2000);
j=0x80;
for(i=0;i<8;i++ )
{
outport(*DATA_P ORT,j);
j=j>>1;
delay(2000);
}
}
}
Compiler: Default compiler
Executing gcc.exe...
gcc.exe "C:\Documen ts and Settings\farm\T EST.C" -o "C:\Documen ts and
Settings\farm\T EST.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
Nov 14 '05
13 2679
Je***********@p hysik.fu-berlin.de writes:
[...]
The last character in a regular C program must be a line feed. The ^Z
stuff is an abomination from very old DOS programs where it was meant
to indicate the end of the file. Normal compilers will choke on it.


A C source file must end in an end-of-line indicator, which is
translated to a new-line character in translation phase 1. This
needn't be a line feed character.

It's also possible that phase 1 will eliminate the ^Z character.
I have no idea whether the OP's compiler actually does this.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #11
Keith Thompson <ks***@mib.or g> writes:
Je***********@p hysik.fu-berlin.de writes:
[...]
The last character in a regular C program must be a line feed. The ^Z
stuff is an abomination from very old DOS programs where it was meant
to indicate the end of the file. Normal compilers will choke on it.


A C source file must end in an end-of-line indicator, which is
translated to a new-line character in translation phase 1. This
needn't be a line feed character.

It's also possible that phase 1 will eliminate the ^Z character.
I have no idea whether the OP's compiler actually does this.


Actually, since the OP's compiler complained about it:

C:/Documents and Settings/farm/TEST.C:33: stray '\32' in program

apparently it doesn't eliminate the ^Z character. ('\32' is ASCII
character 26, also known as ^Z.) Presumably the compiler for which
the source file was intended behaved differently.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #12
On Mon, 13 Dec 2004 13:26:57 +0100, jacob navia
<ja***@jacob.re mcomp.fr> wrote in comp.lang.c:
You are running under the windows OS. This OS is NOT the DOS
operating system that was discontinued more than 10 years ago.


If I've told you once, I've told you LLONG_MAX times not to
exaggerate.

<OT>
MS-DOS 7.1, on which this program would work with the appropriate
compiler, headers, and libraries, was shipping as part of Windows 98
well into the year 2000 when Windows 98 was replaced by Windows
Millennium. Hardly "more than 10 years ago". Not even 5, in fact.
</OT>

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #13
Jack Klein wrote:
On Mon, 13 Dec 2004 13:26:57 +0100, jacob navia
<ja***@jacob.re mcomp.fr> wrote in comp.lang.c:

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

If I've told you once, I've told you LLONG_MAX times not to
exaggerate.

<OT>
MS-DOS 7.1, on which this program would work with the appropriate
compiler, headers, and libraries, was shipping as part of Windows 98
well into the year 2000 when Windows 98 was replaced by Windows
Millennium. Hardly "more than 10 years ago". Not even 5, in fact.
</OT>


An emulation layer is available still TODAY.

Those are *emulations* of msdos under a virtual 16 bit machine running
under the windows OS. NOT native compiled applications.

I spoke about that emulation layer in my message.
Nov 14 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4324
by: Nel | last post by:
I have a question related to the "security" issues posed by Globals ON. It is good programming technique IMO to initialise variables, even if it's just $foo = 0; $bar = ""; Surely it would be better to promote better programming than rely on PHP to compensate for lazy programming?
4
6430
by: Craig Bailey | last post by:
Anyone recommend a good script editor for Mac OS X? Just finished a 4-day PHP class in front of a Windows machine, and liked the editor we used. Don't recall the name, but it gave line numbers as well as some color coding, etc. Having trouble finding the same in an editor that'll run on OS X. -- Floydian Slip(tm) - "Broadcasting from the dark side of the moon"
1
4101
by: Chris | last post by:
Sorry to post so much code all at once but I'm banging my head against the wall trying to get this to work! Does anyone have any idea where I'm going wrong? Thanks in advance and sorry again for adding so much code... <TABLE border="1" bordercolor="#000000" cellspacing="0"> <TR>
11
4012
by: James | last post by:
My form and results are on one page. If I use : if ($Company) { $query = "Select Company, Contact From tblworking Where ID = $Company Order By Company ASC"; }
4
18543
by: Alan Walkington | last post by:
Folks: How can I get an /exec'ed/ process to run in the background on an XP box? I have a monitor-like process which I am starting as 'exec("something.exe");' and, of course the exec function blocks until something.exe terminates. Just what I /don't/ want. (Wouldn't an & be nice here! Sigh) I need something.exe to disconnect and run in the background while I
1
3705
by: John Ryan | last post by:
What PHP code would I use to check if submitted sites to my directory actually exist?? I want to use something that can return the server code to me, ie HTTP 300 OK, or whatever. Can I do this with sockets??
10
4226
by: James | last post by:
What is the best method for creating a Web Page that uses both PHP and HTML ? <HTML> BLA BLA BLA BLA BLA
8
4420
by: Beowulf | last post by:
Hi Guru's, I have a query regarding using PHP to maintain a user profiles list. I want to be able to have a form where users can fill in their profile info (Name, hobbies etc) and attach an image, which will upload the record to a mySql db so users can then either view all profiles or query.. I.e. show all males in UK, all femails over 35 etc. Now, I'm not asking for How to do this but more what would be the best way? I've looked at...
1
3640
by: joost | last post by:
Hello, I'm kind of new to mySQL but more used to Sybase/PHP What is illegal about this query or can i not use combined query's in mySQL? DELETE FROM manufacturers WHERE manufacturers_id NOT IN ( SELECT manufacturers_id FROM products )
2
106620
by: sky2070 | last post by:
i have two file with jobapp.html calling jobapp_action.php <HTML> <!-- jobapp.html --> <BODY> <H1>Phop's Bicycles Job Application</H1> <P>Are you looking for an exciting career in the world of cyclery? Look no further! </P> <FORM NAME='frmJobApp' METHOD=post ACTION="jobapp_action.php"> Please enter your name:
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9538
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10470
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10023
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9067
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7561
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5583
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2935
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.