OpenGL vs. DirectX ???

This is a discussion on OpenGL vs. DirectX ??? within the Game Programming forums, part of the General Programming Boards category; Is that because standard C is used ?...

  1. #31
    Registered User
    Join Date
    Aug 2003
    Posts
    56
    Is that because standard C is used ?

  2. #32
    Registered User
    Join Date
    Aug 2003
    Posts
    56
    Originally posted by confuted
    change
    Code:
    #include <stdio.h>
    to this
    Code:
    #include <stdio>
    using namespace std;
    Well it doesnt compile correctly with that change but it does compile with a 'c' placed before the stdio

    Code:
    #include <cstdio>
    using namespace std;
    But I still get the error when linking:
    c:\windows\TEMP\ccDXufgb.o(.text+0x94):tictacto.cp p: undefined reference to `GetStockObject@4'
    c:\windows\TEMP\ccDXufgb.o(.text+0x4d4):tictacto.c pp: undefined reference to `TextOutA@20'
    c:\windows\TEMP\ccDXufgb.o(.text+0x4ee):tictacto.c pp: undefined reference to `TextOutA@20'
    c:\windows\TEMP\ccDXufgb.o(.text+0x508):tictacto.c pp: undefined reference to `TextOutA@20'
    c:\windows\TEMP\ccDXufgb.o(.text+0x525):tictacto.c pp: undefined reference to `TextOutA@20'
    c:\windows\TEMP\ccDXufgb.o(.text+0x53f):tictacto.c pp: undefined reference to `TextOutA@20'
    c:\windows\TEMP\ccDXufgb.o(.text+0x55c):tictacto.c pp: more undefined references to `TextOutA@20' follow

  3. #33
    Registered User
    Join Date
    Aug 2003
    Posts
    56
    Maybe I havent set up my compiler correctly?

    I need a 'compiler for dummies' version.

  4. #34
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    Have you read your compiler documentation?
    Away.

  5. #35
    Registered User
    Join Date
    Aug 2003
    Posts
    56
    errrr...

    You mean, read the instructions?

    No, I pretty much just double clicked the installer and then started compiling. Ya think I mighta missd something?


    Thanks for all your help!

    I think its time to go read some more about my compiler... LOL!

    Maybe I should download GLUT37 and start breaking that too...


  6. #36
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    You should have a help file of some sort which will tell you how to use your compiler and linker. Read that Although it appears that your compiler is kind of old if it won't accept #include <stdio>
    Away.

  7. #37
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    #include <stdio> ?!?!

    don't you mean #include <iostream>?


    **edit***

    for those "TextOut" etc. undefined references, are you including <windows.h>?

  8. #38
    Registered User
    Join Date
    Aug 2003
    Posts
    56
    The help file is a little sparse on it too.

    It was the first compiler that I could copy and paste code into and it worked.

    I am basically finding code and seeing what I have to do to get it to compile. I would hate to learn enough C++ to write a large program and then have no way of running it because of compiler issues.

    Now I need to learn more about compilers...

    Ugh... I shoulda done this years ago... It's easier when the brain cells arent all fused together with complacency ... LOL

  9. #39
    Registered User
    Join Date
    Aug 2003
    Posts
    56
    window.h is included

    I added iostream.h

    and I still get the errors...

  10. #40
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    I never said <iostream.h>, i said <iostream> <-notice no ".h"

  11. #41
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    If you're still having trouble post a zip file with your project as well as what compiler/OS you're using.

  12. #42
    Registered User
    Join Date
    Aug 2003
    Posts
    56
    Here is the cpp I am trying to get to compile correctly on Dev-C++ (Version 4)
    Attached Files Attached Files

  13. #43
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Originally posted by Grumpy_Old_Man
    [B]BTW CAT?

    Do you have any homework online?
    Perhaps you could throw in a link or two?
    I teach medical instrumentation, so the homework I give out probably isn't of any use to you :P

    The C++ Programming Language, Third Edition
    by Bjarne Stroustrup
    This is one of my 2 C++ references that I use all the time (the other being "The C++ Standard Library" by Josuttis). These books are excellent references, although I will admit I haven't used either while learning the language; I don't know how friendly relatively new programmers will find them. I don't think either is aimed at new programmers, actually. They're both books every serious programmer should eventually own, though.

    LOL! The code now compiles with those changes, however [seems like there is always a 'however'] now when i go from the compiler to the linker I get this
    You can ignore the replies that mention source code changes (although they won't hurt and may well improve your readability/standards compliance). Your code compiles, but doesn't link: this suggests that you don't have or aren't linking the proper libraries. Errors in code or headers will show up as failed compilation, not typically failed linking.

    Those all seem to be errors with linking WinAPI libraries; try to find a tutorial or such on compiling Win32 apps with your compiler, it will have to include that info.

  14. #44
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    be sure to include <windows.h> before any other include's. I have had this cause link errors before.

  15. #45
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    With the exception of having to change the second
    Code:
    for(u = blah,blah,blah
    to

    Code:
    for(uu = blah,blah,blah
    (because VC doens't allow redefinitions like that.)

    it complied and ran fine with VC++ 6

Page 3 of 4 FirstFirst 1234 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Going from DirectX to OpenGL
    By Wraithan in forum Game Programming
    Replies: 19
    Last Post: 02-24-2006, 11:07 AM
  2. Allegro, OpenGL.. or even DirectX?
    By Zeusbwr in forum C++ Programming
    Replies: 1
    Last Post: 11-14-2004, 08:16 AM
  3. Which is better: OpenGL or DirectX
    By Stan100 in forum Game Programming
    Replies: 2
    Last Post: 05-09-2003, 05:43 PM
  4. OpenGL 2 or DirectX ?
    By alex6852 in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 01-02-2003, 02:31 PM
  5. So.. what's the difference between DirectX and OpenGL?
    By QuestionC in forum Game Programming
    Replies: 6
    Last Post: 01-19-2002, 06:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21