LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Problem With programming in Linux, Missing Libraries (https://www.linuxquestions.org/questions/programming-9/problem-with-programming-in-linux-missing-libraries-543802/)

2Pacalypse 04-06-2007 08:23 AM

Problem With programming in Linux, Missing Libraries
 
Ok, I have a rather simple problem, I need to write a program (to be used in my electronics project) that uses the LPT Port for communication and control however theres a serious problem with it I need it to be working on a standard Windows machine by using Borland C (So no special Libraries) however Since I do not have a Windows machine I can only write and test it on my Debian Etch box... and here start the problem of the missing Libraries I wrote a program and immediately I gotten a swarm of error, all of them are missing libraries and their functions being undefined. The missing libraries are: conio.h , dos.h , bios.h and graphics.h the commands that I need inside of them are textcolor , textbackground , clrscr , inp(ever though iostream IS included) and delay. So what do I do about the missing libraries? is there any way possible to add them to the Linux machine or am I forced to use a Windows machine to compile and test the program

acid_kewpie 04-06-2007 08:43 AM

most of these headers aren't "missing" they are simply dos only headers. a name like dos.h should give it away don't you think!? :) there are plenty of examples available online that i'm sure ou could track down via google. i remember one mini project called parapin which could be very easily pulled apart to see a simple exampleof parallel port interaction.

theNbomr 04-06-2007 07:26 PM

What you are attempting to do is certain to be non-portable. Virtually any time you need to access hardware directly, it will be non-portable.

Your best solution is to get a Windows box and Borland C compiler. Don't waste your time trying to write that kind of code on linux with any hope of portability to Windows.

Using Linux to learn how the hardware actually works would still be a useful effort, if that is the objective of the project. Linux has a few levels of code abstracting the parallel port, but I doubt that any of them are replicated in Windows.

--- rod.

2Pacalypse 04-07-2007 10:25 AM

ok so if I understood correctly theres no way to replicate the missing libs into Linux... well certainly no surprise since it is meant to work on a windows machine (that I don't have :P). guess theres no real other way to make sure the program is compilable.... well thanks anyways :)

95se 04-07-2007 12:19 PM

Quote:

Originally Posted by 2Pacalypse
ok so if I understood correctly theres no way to replicate the missing libs into Linux... well certainly no surprise since it is meant to work on a windows machine (that I don't have :P). guess theres no real other way to make sure the program is compilable.... well thanks anyways :)

If it's DOS based, you could just run FreeDOS in an emulator like Qemu. It supports redirecting parallel port access in the guest OS (FreeDOS) to a device in the host (linux), so it can access your parallel port. This option seems ideal, since it gives you the environment you need at no cost.

cyb0rg777 04-07-2007 12:32 PM

I've been working on the same thing.
As far as I know ,if you are using the inb() and outb() functions they won't work on windows xp because xp will not access the hardware directly.

Just thought i'd mention it before you start installing anything.

2Pacalypse 04-08-2007 08:33 AM

Quote:

Originally Posted by cyb0rg777
I've been working on the same thing.
As far as I know ,if you are using the inb() and outb() functions they won't work on windows xp because xp will not access the hardware directly.

Just thought i'd mention it before you start installing anything.

I know but theres a special patch for XP that enables usage of the LPT Parallel port, and the computer that is ment to originally run the project is patched with this ;) just FYI :P however this patch is somewhat of a hassle to enable and need to use inp32/outp32 rather then the simple inp/outp commands

and thats for the tip 95se ;) I'll probably do that assuming I could get a Compatible Borland Compiler


All times are GMT -5. The time now is 11:23 AM.