# 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 on other sites
try another program?

##### 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)

Noobwaker    133
bump?

##### Share on other sites
Kylotan    10011
It's probably a bug in the compiler. You could try a Rebuild All or whatever the VC2003 equivalent is. That sometimes cures a few problems.

##### Share on other sites
Noobwaker    133
I don't think I understand...

Anyway, all I have is a .c file, and the empty .obj file that it makes every time.

##### 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 on other sites
Noobwaker    133
Using VC2003 through Code::Blocks isn't working either...

And, why does GCC tell me that "sleep" and "GL_BGRA_EXT" are undefined?

##### 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 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 on other sites
Noobwaker    133
What do I need for those errors? (GCC compiler)

And does anyone have ideas on why the VC++ compiler freezes on it?

##### 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?

## 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