473,394 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Output to LPT1

HELLO Everyone!
I am novice in programing in dev C++,
and allready have a problem.
I am trying to send a signal as a bit in output to parallel port!
Here is the code

#include <conio.h>
#include <stdio.h>
int _outp( short port, int databyte);
int main()
{
int inval = 0 ;
while (inval < 256 )
{
printf( " Enter number beetween 0 and 256 ");
scanf("%d", &inval);
_outp(0x378, inval);
}
_outp(0x378, 0 );
return 0 ;
}

Here is the message what compiler says:
linker error , undefined reference to `_outp(short int)`
Help please?
Sep 10 '08 #1
5 4361
weaknessforcats
9,208 Expert Mod 8TB
The linker can't find the code for this function:
Expand|Select|Wrap|Line Numbers
  1. int _outp( short port, int databyte);
  2.  
Sep 10 '08 #2
[quote=weaknessforcats]The linker can't find the code for this function:
[code]
int _outp( short port, int databyte);

what to do then with linker?
Sep 10 '08 #3
weaknessforcats
9,208 Expert Mod 8TB
Locate the code for that function. If it's in a library then add the library to your make file so the linker can search it.

The documentation for the functon should a) identify the header file to use and b) the library name to add to the makefile. If you wrote thios function, then add the soruce file with the funciton definition to your make file.
Sep 11 '08 #4
newb16
687 512MB
First of all check that your OS supports ( unlike, e.g., win XP ) direct write to io port. If not, search for the driver first.
Sep 11 '08 #5
weaknessforcats
9,208 Expert Mod 8TB
_outp is in libc.lib. Is that library in your build?
Sep 12 '08 #6

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

Similar topics

1
by: Chuck Rittersdorf | last post by:
Hi There I am having a problem using the win32 API from VB6. I am trying to send a command string to a printer(zebra TLP 2742) on LPT1 using the folowing API functions CreateFile and...
0
by: Nick | last post by:
Hi guys, I have an old VB app that writes just fine to an old LPT printer. I do this using: Open "LPT1" .... Now, the app is changing and I have to do the same thing in .NET. I found at...
1
by: Allan | last post by:
I open and write LPT1 as file with standart file i/o functions. But it sends directly to the printer on win98 without spooling.But when I send something from command prompt (dos) to LPT1 it is...
3
by: Michael Harris | last post by:
Access XP WinXP Adobe Acrobat 5.0 I'm playing with Keri Hardwick's "Save a report's output as a PDF file" and most of it still works. The problem is the ChangePdfFileName is not changing the...
5
by: Tom | last post by:
I am converting an old application that was printing directly to a specialized printer device (i.e. a special label printer). It was doing this by opening a file with the file path of 'LPT1:' and...
3
by: nimmiejoey | last post by:
Hello everybody, could you please tell me the meaning of the command outport(LPT1,00)
1
by: Hector M Banda | last post by:
Hi all, Need advice on how to send output to a tiket printer using VB2005. I cannot figure out how to send scape sequences to change fonts, etc. I am using a generic printer driver but no luck....
1
by: pablome | last post by:
I found already 2 sites that explain some about Parralel Port interfacing using VB in windows and are yet to understand it all. These sites are: http://www.logix4u.net/index.htm &...
0
by: realgoggi | last post by:
Hello, I have a label printer connected to LPT1 on the server where IIS and the ASPX/C# code is running. From the web application I need to send data to the printer. Preferably directly,...
2
by: KS | last post by:
What is wrong with the login procedure in the community forums in DOT.net C# ?????? I have tried the trick with deleting coockis 3 or 4 times but STILL I have problems with the login procedure !...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.