Jump to content
  • Advertisement
Sign in to follow this  
Syrinth

Attempting to start with OpenGL. Lots of failure

This topic is 2479 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, so this has been a very frustrating experience going over the past few weeks and has reduced my morale to near zero.

I've been attempting to start programming in OpenGL because my friend explained to me why it's better than DirectX and I can see his points and would like to do this. However, I cannot for the life of me get this wretched thing set up to work.

I have been trying to follow tutorials but code doesn't compile, I get linker errors and the whole thing just makes me so frustrated I don't want to even bother coding anymore.

So, I am looking to someone else who knows what they're doing and can hopefully set me on the right path for how to get started here. I have seen the NeonHelium webpage and honestly, the fact that the code is so old has me kind of nervous.

I am running Visual Studio C++ 2010 Express on Windows 7. I have scrapped all previous attempts at getting this to work in the hopes that a new slate will help sort things out.

I currently have, on my computer, SDL, glut, glfw and glm but I obviously have no idea what I'm doing with them.

Can someone PLEASE help get me started with this? I really want the chance to prove that I'm not a complete idiot :/

Share this post


Link to post
Share on other sites
Advertisement
First, why does your friend say that openGL is better than directX? I suppose they're just different but I'd call it a question of preference more than anything else. Do your own reading and decide for yourself. I'm just thinking that if you haven't coded in both, how can you say you agree with him?

Fortunately though, I do think that openGL is the easier one to learn, so you can get away with relatively few lines of code. You need to post your errors here though, otherwise it could be ANYTHING that's wrong... I've done all my openGL coding on a Linux environment (was much easier for me), but your general syntax could be incorrect, you could be using the wrong libraries, etc... what exactly is your error?

Share this post


Link to post
Share on other sites
I don't think OpenGL here is the problem. How familiar are you with C++? You say it "doesn't compile".. what does it mean? Did you check the compiler output? Do you understand what the compiler is telling you?

Share this post


Link to post
Share on other sites
NeHe tutorials and glaux? That sure won't compile. If that's the case then you'll need to get a modern image loading library and use that instead. I'm not familiar with the current options so I'll leave recommendations for others.

Share this post


Link to post
Share on other sites
The errors were primarily linker errors and other such things. I decided I wanted to scrap the project and try to set up from scratch again. I'll repost the problems I was having though...

By better I meant in terms that it's cross-platform and not just Microsoft controlled. Sorry.

I have experience with C++, but it's been a while and when I was last working on it, I was using machines where this stuff was already set up.

I tried to get help on the OpenGL board but that seems to have petered out... Link to my original post where I was trying to debug is here http://www.gamedev.net/topic/620666-issues-setting-upstarting-with-opengl-and-possibly-missing-files/

I really think I did something wrong when trying to link to my the wretched things in the first place but I'm just so confused...

Currently getting the error

1>LINK : fatal error LNK1104: cannot open file 'SDL_image.lib'

if I link to lib/x64 or x86 in the SDL folder and cannot open cannot open file 'SDL.lib' for linking to the lib flder in general.

Share this post


Link to post
Share on other sites
Have you done the following steps?

1. Add all include directories to you project properties
2. Add all library directories to your project properties
3. Add all .lib files your project needs to additional dependencies



After looking at that thread you linked to it seems that you have done 1 and 2 but did you do 3?

Share this post


Link to post
Share on other sites
I just searched for and found additional dependencies.

Here is what I have in it.


SDL.lib
SDLmain.lib
SDL_image.lib
OpenGL32.lib

If I remove the SDL statements from the additional directories, I get the following:


1>Main.obj : error LNK2019: unresolved external symbol _glfwGetWindowParam referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _glfwGetKey referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _glfwSwapBuffers referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _glfwEnable referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _glfwSetWindowTitle referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol __imp__glewInit referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _glfwTerminate referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _glfwOpenWindow referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _glfwOpenWindowHint referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _glfwInit referenced in function _main
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

Share this post


Link to post
Share on other sites
Additional dependencies also needs glfw.lib (Or whatever the glfw library file is called these days, you can check that by looking in glfw's installation directories)

The last error has to do with the entry point. Are you using a main function in a windows project that requires a WinMain function?
Anyway, we can look at that later...

Share this post


Link to post
Share on other sites
I'm using main based off of the tutorial so it could be wrong? Will add the glfw.lib file and see what happens.

Well, I can't seem to find any .lib file in my glfw folders so I'm confused... the lib folder contains a carbon, cocoa, win32 and x11 folder. There are no .lib files in it... I'm currently using glfw 2.7.3

Share this post


Link to post
Share on other sites
Hidden

I'm using main based off of the tutorial so it could be wrong?

Lets look into that later...



Is there a .lib file under the win32 folder?

Share this post


Link to post
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!