| J4ke (9) | ||
I have some C++ code that uses OpenGL and GLUT. When I try to compile it, it gives me the following result:
When I run the executable, I do not even see a window before it crashes. When I try to print out something as the first line of code, I do not see that appear. I want to note that I have looked all around for the same problem, but all of the solutions that apparently worked for other people have not worked for me. I am running Windows 7 x64. I compiled this with the Eclipse IDE, and I included opengl32, glu32, and glut32 (the libraries) in that order. I successfully was able to compile the exact same code using Eclipse on Linux Mint x86, so it is not the code. If anyone has a solution, please let me know. Thanks. | ||
|
|
||
| Smac89 (201) | |
| I think maybe the libraries that worked on linux aren't the same as the ones used by windows. So you have to find the same ones for windows and compile using those. For example you will need opengl32.dll on windows not the opengl32.lib for linux | |
|
|
|
| majidkamali1370 (226) | |
|
I think you should reverse libraries order. first glut, then glu and then gl. BTW, you must copy those lib files in lib directory of your compiler and corresponding dlls in system directory. check file extension. if it is .c change it to .cpp or vice versa. It seems linker encountered a problem with name mangling. | |
|
|
|
| J4ke (9) | |
|
@Smac89 Yes, I do know this, but I am sure I have the right libraries. @majidkamali370 I tried this already, it did not work. | |
|
|
|
| computerquip (1997) | |
| We don't know how you're opening a window or the rest of your program. Care to provide a test case? | |
|
|
|
| iHutch105 (1092) | |
| What do you mean by "included" the libraries? | |
|
|
|
| J4ke (9) | |
|
@iHutch105 By included, I mean as a compile option I used -lopengl32, to include the opengl library. Normally if the compiler had a problem finding opengl32, it would give an error about that, but it didn't, so I know that including the libraries works just fine.. | |
|
|
|
| J4ke (9) | |||
@computerquip
Is how I open a window. As I stated in the first post, the entire program runs just fine on Linux Mint, but will crash on start-up when I use Windows 7. I believe it is something to do with linking the libraries, possibly an outdated library, although I'm pretty sure that I'm using the latest versions of everything. | |||
|
Last edited on
|
|||
| EssGeEich (1009) | |
| I don't think order of "library inclusion" matters. Perhaps something with Eclipse's libraries? Try using it with a clean reinstall of MinGW. | |
|
|
|
| ne555 (4385) | |
|
> I don't think order of "library inclusion" matters There are cases. It could give you `undefined reference'. @OP: Debugger, backtrace. Edit: see `Auto-import' http://gnuwin32.sourceforge.net/compile.html | |
|
Last edited on
|
|
| majidkamali1370 (226) | |
|
does Eclipse use gcc? In gcc this is the command for compiling and linking. g++ myProgram.cpp -lglut -lGLU -lGLthis command is case sensitive. | |
|
|
|
| J4ke (9) | ||
I was fooling around with stuff, and then realized that it didn't just have to be a problem with GLUT. I tried compiling just a simple "Hello World" application, and it compiled. When I tried to run it, however, it just gave me the error
This looks like it could be a problem with MinGW maybe? I have never had this problem in my three years of programming before. I googled it and couldn't seem to find anything. Remember, this is when I'm trying to compile a simple hello world application that I know works. | ||
|
|
||
| EssGeEich (1009) | ||
|
Here maybe? http://stackoverflow.com/questions/4702732/the-program-cant-start-because-libgcc-s-dw2-1-dll-is-missing
| ||
|
|
||
| J4ke (9) | |
| Yes, thank you, that worked. | |
|
|
|