Jump to content
  • Advertisement
Sign in to follow this  
Cyntalan

Linker errors revisited

This topic is 3684 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

Reading threads like this (http://www.gamedev.net/community/forums/topic.asp?topic_id=336356) in hopes they would solve what I would think would have been a simple problem, I've exhausted all possibilities, but maybe my case is unique. I have the same exact problem as stated above, same compiler, though working with GLFW. However, my links are set up correctly, but the problem still occurs.
#include <windows.h>
#include <gl/glfw.h>

using namespace std;

int main(int argc, char *argv[])
{
    if(glfwInit() != GL_TRUE)
    {
        return EXIT_FAILURE;
    }

    glfwTerminate();

    system("PAUSE");
    return EXIT_SUCCESS;
}



I did give adding the includes to gl.h/glu.h a go to no avail as well (though glfw's supposed to include those anyway). All the libraries are properly linked, and yet that slew of linker errors continue. My uniqueness might be in that rather than Dev-C++, I'm using the portable version, as it's running off my portable HDD. Perhaps something isn't properly communicating here that would otherwise on a normal install. Any ideas? EDIT: I meant to put this in the beginners forums. This doesn't really correlate to NeHe other than the original thread was from there.

Share this post


Link to post
Share on other sites
Advertisement
I do wonder why people continue to use Dev-C++, it hasn't been updated for years and there are far better free IDEs out there. I *believe* Code::Blocks will work standalone so it might be worth giving that a try if you need it to run from a USB stick.

Anyway, could you post the exact linker errors you are getting and I'll see if I can help.

Luke.

Share this post


Link to post
Share on other sites
Code::Blocks can run standalone but you must move the program settings from %APPDATA% to the same folder as the program executable.

Share this post


Link to post
Share on other sites
the list of linker errors is identical to that in the link provided in the original post.

As for moving onto CodeBlocks, I have that on my computer at home (though I have another thread in the OpenGL forum about a whole different issue that I'm having there), as well as VCE, which has worked the best for me, but isn't portable. I have actually been meaning to move onto CodeBlocks, but seeing as there's not a pre-prepared extractable ready (like Dev-C++), I haven't exactly had chance to get my portable hard drive to a location I can do the steps to make it portable myself. The location it's currently in doesn't allow installs on the computer, so doing it myself is out until I can get it onto one that does. Until then, I'm stuck w/ Dev-C++.

EDIT: Adding compiler log, perhaps something here will give a clue

Quote:
Compiler: Default compiler
Building Makefile: "F:\projects\test\Makefile.win"
Executing make...
make.exe -f "F:\projects\test\Makefile.win" all
g++.exe main.o -o "test.exe" -L"F:/Dev-CppPortable/App/devcpp/lib" -L"F:/Dev-CppPortable/App/devcpp/lib" -mwindows -lopengl32 -lglu32 -lglfw

F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0xe70):win32_window.c: undefined reference to `wglCreateContext@4'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0xe8b):win32_window.c: undefined reference to `wglMakeCurrent@8'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0xe9f):win32_window.c: undefined reference to `wglGetProcAddress@4'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0xeb2):win32_window.c: undefined reference to `wglGetProcAddress@4'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0xec9):win32_window.c: undefined reference to `glGetString@4'

F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0xf1f):win32_window.c: undefined reference to `wglGetProcAddress@4'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0xf3e):win32_window.c: undefined reference to `wglGetProcAddress@4'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0xf4d):win32_window.c: undefined reference to `wglGetProcAddress@4'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0xfc4):win32_window.c: undefined reference to `wglMakeCurrent@8'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0xfcf):win32_window.c: undefined reference to `wglDeleteContext@4'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0x122c):win32_window.c: undefined reference to `glClear@4'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0x1343):win32_window.c: undefined reference to `glGetIntegerv@8'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0x1351):win32_window.c: undefined reference to `glGetFloatv@8'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0x135f):win32_window.c: undefined reference to `glClearColor@16'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0x1369):win32_window.c: undefined reference to `glClear@4'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_window.o)(.text+0x1393):win32_window.c: undefined reference to `glClearColor@16'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(glext.o)(.text+0x90):glext.c: undefined reference to `glGetString@4'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(glext.o)(.text+0x108):glext.c: undefined reference to `glGetString@4'
F:/Dev-CppPortable/App/devcpp/lib/libglfw.a(win32_glext.o)(.text+0x5f):win32_glext.c: undefined reference to `wglGetProcAddress@4'
collect2: ld returned 1 exit status

make.exe: *** [test.exe] Error 1

Execution terminated


EDIT 2: Note that if I run straight openGL (tested w/ NeHe lesson 2), I don't get the linker errors, so perhaps this is a problem with GLFW itself, like perhaps I need to find a location the compiler will search out the DLL for? Not sure.

[Edited by - Cyntalan on July 18, 2008 10:31:10 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!