Thread: header file help

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    208

    header file help

    I made my own header file to create a window and then called the function in another source but I get a linker error of undifined referance to `createwin()'

    I made sure to include the header and I know i have the function name rite I have no idea what could be causeing this error any help would be appreciated thanks in advance

    kas2002

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Do you have the function body in a separate source file or in the header also? Post up your header file and lets have a look. When you get a linker error like that it is saying it can't find the body to the function you're trying to call.
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    208
    I figured it out thanks

    I was also wondering could I just make a program that initializes say a library like OPENGL and then create a header file for that and only have to call 1 function in my main program code to initialize OPENGL. Well I am sure it could be done but I was wondering how I would go abouts this.
    Last edited by kas2002; 01-04-2003 at 07:48 PM.

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Possible Possible

    What are you using for OpenGL? Glut?

  5. #5
    Registered User
    Join Date
    May 2002
    Posts
    208
    yea I think but I may have figured it out I have a different question though what does this error mean???



    [Linker error] undefined reference to `WinMain@16'


    thats the only one left
    Jeff Paddon
    Undergraduate Research Assistant
    Physics Department
    St. Francis Xavier University

  6. #6
    May be an undefined reference to WinMain on line 16? LOL. Post the code.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need Help Fixing My C Program. Deals with File I/O
    By Matus in forum C Programming
    Replies: 7
    Last Post: 04-29-2008, 07:51 PM
  2. Replies: 30
    Last Post: 06-19-2006, 12:35 AM
  3. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  4. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM