Sign in to follow this  
Noobwaker

Compiler idle/freeze

Recommended Posts

Noobwaker    133
I started up the VC 2003 command line compiler, and attempted to compile my source code. It starts, and I get no errors, but it doesn't do anything, almost as if it is in an infinite loop. What could possibly cause this? It compiles fine in another compiler.

Share this post


Link to post
Share on other sites
Noobwaker    133
It compiles other files, but it just freezes on that one. It used to give me errors, but now that I took care of all the errors, it just freezes.

Also, how do you link libraries with a command line compiler? (VC++ Toolkit 2003)

Share this post


Link to post
Share on other sites
Spudder    385
Rather than trying to compile your code through the command line why dont you download Code::Blocks and use the toolkit through that?

Also you dont link files through the compiler, you invoke cl.exe to produce a .obj file for each of your source files then pass these to link.exe along with any other required options which will produce your exe file. If you use Code::Blocks then all these details will be taken care of.

Share this post


Link to post
Share on other sites
Endar    668
Hvae you got the proper header files included? You'll probably need windows.h and gl.h.

For many systems, you'll need to include "gl/gl.h" for the opengl header file, and if 'sleep' is the windows function, after you include <windows.h>, make sure you change "sleep" to "Sleep".

Share this post


Link to post
Share on other sites
Noobwaker    133
"sleep" -> "Sleep" fixed the sleep problem, and switching out the gl.h file for the one that comes in the MS SDK fixed the "GL_BGRA_EXT" error. However, now I get some link errors. Only 3 though:
oRly.o:oRly.c:(.text+0x429): undefined reference to `ChoosePixelFormat@8'
oRly.o:oRly.c:(.text+0x489): undefined reference to `SetPixelFormat@12'
oRly.o:oRly.c:(.text+0x65b): undefined reference to `SwapBuffers@4'
What am I missing now?


(compiling with VC2003 still doesn't work)

Share this post


Link to post
Share on other sites
smart_idiot    1298
In theory, you need to add -lgdi32 to the linker options, which is odd, because I would have expected it to be there by default. Is -mwindows getting passed to the linker too?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this