473,811 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Call to undefined function error

49 New Member
hi
i made program to control sevensegment but when i make debug
tell me call to undefined function inportb
Expand|Select|Wrap|Line Numbers
  1. #define Data 0x378
  2. #define Status Data+1
  3. #define Control Data+2
  4.  
  5. #include <dos.h>
  6. #include <conio.h>
  7. #include <stdio.h>
  8. #include <iostream.h>
  9.  
  10. void main(int n)
  11. {
  12.   int x;
  13.   do{
  14.      x=inportb(Status);
  15.      x= x&& 0x80;
  16.      }while(x!=0x80);
  17.  //  do{
  18.       if(kbhit()==1)
  19.       {
  20.        // int n;
  21.         switch(n)
  22.         {
  23.          case 0:
  24.          outportb(Data,0x40) ;
  25.          break ;
  26.          case 1:
  27.          outportb(Data,0x57);
  28.          break;
  29.           case 2:
  30.          outportb(Data,0x09);
  31.          break;
  32.           case 3:
  33.          outportb(Data,0x03);
  34.          break;
  35.           case 4:
  36.          outportb(Data,0x26);
  37.          break;
  38.           case 5:
  39.          outportb(Data,0x12);
  40.          break;
  41.           case 6:
  42.          outportb(Data,0x10);
  43.          break;
  44.           case 7:
  45.          outportb(Data,0x47);
  46.          break;
  47.           case 8:
  48.          outportb(Data,0x00);
  49.          break;
  50.           case 9:
  51.          outportb(Data,0x02);
  52.          break;
  53.          default: cout<< "this is wrong" ;
  54.          break;
  55.          }
  56.        }
  57.      else cout<<"do nothing";
  58.   //   }while
  59.   }
  60.  
Feb 2 '09 #1
22 8551
donbock
2,426 Recognized Expert Top Contributor
Header files <dos.h>, <conio.h>, and <streamio.h> are only available on certain platforms -- they are not part of Standard C. Are you sure they are available on your platform?

Functions inportb and outportb are only available on certain platforms -- they are not part of Standard C. Are you sure they are available on your platform? Your error message suggests that at least one of them wasn't available to the linker. You may need to specify an object library on the command line. The name of the necessary object library is platform-dependent.

By the way, what is your platform?

Header file <stdio.h> is part of Standard C; but header file <streamio.h> might be intended to refer to <streamio>, part of Standard C++. You really don't want to mix these together. Are you using C or C++?
Feb 2 '09 #2
newb16
687 Contributor
Anyway, you can't write to io ports by address from win32 program, and from dos program on win2k and later. You need to find some driver that allows you to do it ( dlportio, giveio, etc ). And most of them don't work on vista.
Feb 2 '09 #3
Banfa
9,065 Recognized Expert Moderator Expert
and finally main should be either

int main()

or

int main(int argc, char **argp)

but not

void main(int n)
Feb 2 '09 #4
orked
49 New Member
I used Borland C++, so i can use iostream library
i want to know ,if i can use kbhit in c++or not but it need stdio.h library
Feb 2 '09 #5
orked
49 New Member
oh ,i forgot asking about dos ,my doctor told we can use it in c or c++ and two function (inportb&outpor tb) defined in it,why the program told "call to undefined function"
Feb 3 '09 #6
newb16
687 Contributor
What part of the sentence in #6 is a question?

Nevertheless, open dos.h that your compiler includes and look if there are these functions declared.
Feb 3 '09 #7
orked
49 New Member
sorry ,can you tell me how i can open dos.h to show if functions defined in it or not
my question in #6 dos.h library found in c++ or not,and why is not defined my function if it is found
Feb 3 '09 #8
Banfa
9,065 Recognized Expert Moderator Expert
dos.h library is not in C++ because, as stated in #2 they are not part of the C++ standard. However they may be available on your platform. Your platform is the hardware/OS combination you are using.

You open dos.h in the same way you open any source file, locate it on your hard drive and use a text editor to open it.
Feb 3 '09 #9
orked
49 New Member
you mean i will find information about dos in class libraries guide in the program itself
Feb 3 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

6
2415
by: obi wan kenobi | last post by:
i've used the Amazon PHP api for several months now to pull amazon data into my affiliate site - but recently i'm starting to get "call to undefined function" errors " Fatal error: Call to undefined function: asinsearchrequest() in" What's strange is that problem is intermittent - and there is no way to reproduce it exactly - it just appears to come and go. I'm using nusoap as well.
4
15347
by: gc | last post by:
I'm a PHP and MySQL newbie. I have a feeling a lot of you may have seen this before. I'm teaching myself PHP/MySQL and trying to setup a guestbook. I'm running latest versions of Apache, PHP and MySql on WIN 2000. PHP is installed from the zip file. When serving php docs (code snippets below) I get the messages: "Fatal error: Call to undefined function mysql_connect() " "Fatal error: Call to undefined function mysql_pconnect() "
1
10014
by: annie | last post by:
Can anyone point me in the right direction here? I've got this little image script <?php $im = ImageCreate(200,200); $white = ImageColorAllocate($im,oxFF,oxFF,oxFF); $black = ImageColorAllocate($im,ox00,ox00,ox00); ImageFilledRectangle($im,50,50,150,150,$black); header("content-type: image/png");
1
10508
by: franscescomoi | last post by:
Hi. On PHP 4.3.10 on Linux I try to: ------ $im = imagecreate(400, 30); $black = imagecolorallocate($im, 0, 0, 0); imagettftext($image, 20, -3, 10, 20, $black, 'Arial.ttf', 'Test'); ------- But I get this error message:
1
9133
by: muelli75 | last post by:
Hi! Im getting insane by solving a problem .... I try to define a function which uses a code-snippet from another file. My base are the codes from the great book "WebDataBase-Book by H. Williams & D. Lane". So I try to use
8
4205
by: Cruella DeVille | last post by:
I'm writing a class to handle reading/writing from/to files like this (shortened) lass FileIO{ private $filename; private $mode; private $filePointer; private $dictionary; public function __construct($filename = null, $mode = 'r+'){
11
2747
by: Felix Kater | last post by:
Hi, I can compile and run this code (see below) which twice calls the function f, first with too less, second with too much arguments. But is it legal and free of memory leaks and other problems? Of course, I presume that inside f I don't access i in case it was called via g. int f(int i){ /* ... */ return 0; }
9
5268
by: java | last post by:
Hey there, I just removed an elderly PHP4-Installation from my Windows-Box and installed PHP 5.2.1. I used the PHP4-Module as local batchfile- interpreter by E:\ersDHCP>php ./extractLog.php which was perfectly alright and worked well. But now PHP5 fails to run the same script without any modification!
1
2082
by: maverick1911 | last post by:
Can any body help with the above error and how to fix it . here is the code refered to in the error Fatal error: Call to undefined function displayHeader() in C:\wamp\www\functions.php on line 15 <?php require( "config.php" ); //------------------------------------------------------------------------------------------------------- function dbConnect() {
9
3280
by: CryptiqueGuy | last post by:
Consider the variadic function with the following prototype: int foo(int num,...); Here 'num' specifies the number of arguments, and assume that all the arguments that should be passed to this function are of type int. (My question has nothing to do with the definition of the function foo, so don't bother about it.) If I call the function as: foo(2,3,4,5,6,7,8);/*More arguments than expected*/
0
9728
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
9605
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
10389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10135
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
9205
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
7670
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
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.