Thread: MinGW undefined reference

  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    10

    MinGW undefined reference

    Hello,

    i need help , i don't know what causes the error *_*




    i have this code :


    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <dos.h>
    
    int main(void)
    {
      puts("Content-type: text/html\r\n\r\n");
      puts("<b>Hello World!</b>");
     outportb(0x378,0xFF);
      return 0;
    }

    i want to convert it to cgi script by using the following command :

    Code:
    gcc -Wall test.c -o test.cgi
    but i get this error :

    undefined reference to 'outportb'


    i'm using MinGW

    please , any idea about this error ?????

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Well you could begin with deleting the include for dos.h AND deleting the call to outportb()

    What are you thinking of doing?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Nov 2009
    Posts
    10
    this is a code for setting the parallel port value into 0 volt.

    i want to make it executable in the cgi directory by convert it to .cgi extension.

    when i remove the outportb line, it works fine and i get my cgi script.

    But with the outportb line i get this error.

    i want to control the parallel port through internet that's all.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Well then, you need to use the appropriate Win32 API calls then.

    A console program is NOT a DOS program.
    A tutorial on Parallel port Interfacing
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Nov 2009
    Posts
    10
    thx aloooooooooooooooot

    i used inpout32.dll functions and it works just fiiiiiiiiiiine

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. gcc: undefined reference for phidgets functions
    By chris24300 in forum C Programming
    Replies: 1
    Last Post: 09-11-2009, 12:46 PM
  2. Undefined reference
    By TheEngineer in forum C Programming
    Replies: 17
    Last Post: 08-12-2009, 10:34 AM
  3. Library troubles with makefile
    By mslate in forum Linux Programming
    Replies: 17
    Last Post: 07-23-2009, 04:43 PM
  4. C OpenGL Compiler Error?
    By Matt3000 in forum C Programming
    Replies: 12
    Last Post: 07-07-2006, 04:42 PM
  5. Textbox
    By maxorator in forum Windows Programming
    Replies: 20
    Last Post: 09-25-2005, 10:04 AM