OpenGL vs. DirectX ???

This is a discussion on OpenGL vs. DirectX ??? within the Game Programming forums, part of the General Programming Boards category; It compiles for me too... but when it goes from the compiler to the linker is where I am getting ...

  1. #46
    Registered User
    Join Date
    Aug 2003
    Posts
    56
    It compiles for me too... but when it goes from the compiler to the linker is where I am getting the 'reference' errors.

    I still havent figured out how to set up my devC++ compiler.

    LOL! I just now after a few months of tinkering got rid of a nasty asp4wave fatal execution thing that would give me the blue screen of death.

    This c++ thing might take a while to figure out.

  2. #47
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,220
    to get rid of linker errors, you have to make sure you're loading the correct libraries.

    This does not mean #includes, it means going to project options and adding the libs there.

    Search for files *.a containing the functions you want, and include those libraries.

  3. #48
    Registered User
    Join Date
    Aug 2003
    Posts
    56
    0.0

    Where would those files be?

    EDIT:
    he he... nevermind, they are in the compilers default direcrories.

    But, the reference is to 'TextOut' is that a variable or a function?
    Last edited by Grumpy_Old_Man; 08-16-2003 at 11:58 PM.

  4. #49
    *******argv[] - hu? darksaidin's Avatar
    Join Date
    Jul 2003
    Posts
    314
    Originally posted by Grumpy_Old_Man
    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;
    There is no way to compile that code because the missing linked libraries are Microsoft specific. You should use non proprietary tutorials instead.

    Not sure what you want to do now, OpenGL, DirectX, none of them ? If you are new to coding in general you should get a good book. Thats a lot easier than using outdated tutorials. If you are only new to C/C++ you should be able to do the little neccessary conversions here and there on your own.

    If you still want to get that OpenGL tutorial to work, tell us what exactly the linker errors were. Did you link the libraries as I told you ?

    edit: I'm also using Dev C++ and with the help of the people on these boards and a little thinking of my own I got all those tutorials to work with DevC++ except for those from this site that use propriatary Microsoft stuff. Which is a bad habit anyway.

    another edit: Here is how you tell the linker to link the libraries you need:

    In DevC++ go to "Project", "Project Options". Select the "Paramters" tab, in the right textbox enter "-l" to link a library (that is not a capital i but an l "el" and make sure you don't use L because thats another parameter again (parameterlist is case sensitive)) followed by the library name without leading "lib" and without trailing ".a". to link "libopengl.a" you would have to specify "-lopengl" in the linkers parameter box. Make sure you link libopengl, libglu32, libglaux. Then come back and tell us the errors you get *after* you did this. I'm sure we can fix it.
    Last edited by darksaidin; 08-17-2003 at 06:32 AM.

  5. #50
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Originally posted by darksaidin
    There is no way to compile that code because the missing linked libraries are Microsoft specific. You should use non proprietary tutorials instead.
    The missing libraries are part of the WinAPI. Any and all compilers that can compile Win32 applications should be able to use that code. And yes, other compilers can do Win32 applications, if you configure them correctly.

    Dev-C++ can compile Win32 applications, so it is possible to get this code to work.
    Last edited by Cat; 08-17-2003 at 09:21 AM.

  6. #51
    Registered User
    Join Date
    Aug 2003
    Posts
    56
    Well, originally I was thinking of OpenGL because it was easier than DirectX to get started.

    Then...

    I decided to try out something easier like a tic tac toe game.

    But...

    That didnt work because my compiler is acting hinky.

    Do I just need the -l or should stuff follow the 'l'?

    I have the Dev C++ set up in its default settings and it wont link this program...
    Attached Files Attached Files

  7. #52
    *******argv[] - hu? darksaidin's Avatar
    Join Date
    Jul 2003
    Posts
    314
    Originally posted by Cat
    The missing libraries are part of the WinAPI. Any and all compilers that can compile Win32 applications should be able to use that code. And yes, other compilers can do Win32 applications, if you configure them correctly.

    Dev-C++ can compile Win32 applications, so it is possible to get this code to work.
    I won't argue with you cat, but look here and see what I mean Stdafx.h?

    So no, you can't use them without MS VC++. Unless I got a wrong reply, which is well possible =)

    edit: mhm, seems like you added a reply to that thread that I didn't read. Well then your probably right. However, we still don't know where to find the missing functions without stdafx
    Last edited by darksaidin; 08-17-2003 at 11:53 AM.

  8. #53
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    This is the totality of everything the auto-generated stdafx.h contains:

    Code:
    // stdafx.h : include file for standard system include files,
    // or project specific include files that are used frequently, but
    // are changed infrequently
    //
    
    #pragma once
    
    
    #define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
    // Windows Header Files:
    #include <windows.h>
    // C RunTime Header Files
    #include <stdlib.h>
    #include <malloc.h>
    #include <memory.h>
    #include <tchar.h>
    
    // TODO: reference additional headers your program requires here
    All it does is make sure that those headers are included in every source file. The only purpose of this is to enable precompiled headers to speed up compilation. It doesn't contain ANY nonstandard classes, interfaces, or functions. All the magic is in <windows.h>, so if you include that (as the FIRST include you do), then every WinAPI function should be visible and useable.

    An his compiler IS able to find the headers -- he's including <windows.h> which is where those functions are declared. It wouldn't compile if he didn't have the headers.

    He's getting a linker error that it can't find the library where the executable code for functions like TextOut live. He just needs to link whatever Win32 libraries are included with Dev-C++.

    TextOut() is not VC++ specific; any platform that can use the WinAPI to compile Windows programs can successfully compile the code he used.
    Last edited by Cat; 08-17-2003 at 10:46 PM.

  9. #54
    Registered User
    Join Date
    Aug 2003
    Posts
    56
    Oops...

    I finally found the switch under Options-Compiler-Linker...
    I checked the little box next to "Compile for Win32"

    And Voila!

    It runs.

    ROFL!

    Uhmmm, can I just put my name on other peoples code and act like a programmer?

  10. #55
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    Uhmmm, can I just put my name on other peoples code and act like a programmer
    yeah, if you dont mind going to jail for 5-10 years for copyright invasions(unless the person says the code is open source, or free to use).

  11. #56
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    Originally posted by EvBladeRunnervE
    yeah, if you dont mind going to jail for 5-10 years for copyright invasions(unless the person says the code is open source, or free to use).
    Generally I would hope that code you find in a tutorial would be OSS
    Away.

Page 4 of 4 FirstFirst 1234
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, 10:07 AM
  2. Allegro, OpenGL.. or even DirectX?
    By Zeusbwr in forum C++ Programming
    Replies: 1
    Last Post: 11-14-2004, 07:16 AM
  3. Which is better: OpenGL or DirectX
    By Stan100 in forum Game Programming
    Replies: 2
    Last Post: 05-09-2003, 04:43 PM
  4. OpenGL 2 or DirectX ?
    By alex6852 in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 01-02-2003, 01: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, 05:18 PM

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