Newbie question

nobody wrote on Monday, March 20, 2006:

Using GLFW 2.5 with Dev-cpp, I opened
"particles" out of the examples folder
and when trying to compile it I got these
errors" (compile log):
Compiler: Default compiler
Executing gcc.exe…
gcc.exe “C:\Dev-Cpp\glfw\examples\particles.c” -o “C:\Dev-Cpp\glfw\examples\particles.exe” -I"C:\DEV-CPP\include" -L"C:\DEV-CPP\lib" -lglut32 -lopengl32
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x69a):particles.c: undefined reference to `glfwLockMutex’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x6d0):particles.c: undefined reference to `glfwWaitCond’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0xa98):particles.c: undefined reference to `glfwUnlockMutex’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0xaa5):particles.c: undefined reference to `glfwSignalCond’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1531):particles.c: undefined reference to `gluPerspective@32’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1864):particles.c: undefined reference to `glfwLockMutex’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x189a):particles.c: undefined reference to `glfwWaitCond’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x18d1):particles.c: undefined reference to `glfwUnlockMutex’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x18de):particles.c: undefined reference to `glfwSignalCond’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1aae):particles.c: undefined reference to `glfwInit’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1afa):particles.c: undefined reference to `glfwOpenWindow’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1b03):particles.c: undefined reference to `glfwTerminate’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1b1b):particles.c: undefined reference to `glfwSetWindowTitle’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1b27):particles.c: undefined reference to `glfwSwapInterval’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1b33):particles.c: undefined reference to `glfwSetWindowSizeCallback’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1b3f):particles.c: undefined reference to `glfwSetKeyCallback’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1d6d):particles.c: undefined reference to `glfwExtensionSupported’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1e23):particles.c: undefined reference to `glfwCreateMutex’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1e2d):particles.c: undefined reference to `glfwCreateCond’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1e37):particles.c: undefined reference to `glfwCreateCond’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1e50):particles.c: undefined reference to `glfwCreateThread’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1e58):particles.c: undefined reference to `glfwGetTime’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1e70):particles.c: undefined reference to `glfwGetTime’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1e86):particles.c: undefined reference to `glfwSwapBuffers’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1ea2):particles.c: undefined reference to `glfwGetWindowParam’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1ee5):particles.c: undefined reference to `glfwGetTime’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1f07):particles.c: undefined reference to `glfwWaitThread’
C:\WINDOWS\TEMP/ccc8Jfgb.o(.text+0x1f5c):particles.c: undefined reference to `glfwTerminate’
collect2: ld returned 1 exit status

Execution terminated

What is the proper way to set up the
linker options in the compiler?

drew_benton wrote on Wednesday, March 22, 2006:

If you are using GLFW, you will need to link in:
-lglfw
-lopengl32
-lglu32

NOT -glut32

Also, you will need to add a preprocessor define:
-DGLFW_DLL

Or, just add

#define GLFW_DLL

Before you include GLFW.H

***IF that still does not work, the GLFW.a that you are using is old and needs to be rebuilt using 2.5. I have a post here:
http://www.gamedev.net/community/forums/viewreply.asp?ID=2025814
With a DevCpp project that is out of the box ready to build + comes with the binaries.

I actually had to use that instead of the GLFW DevPak I had installed for DevCpp, so you will probabally have to as well.

I’ll try and check back here again later on to see if you have any more problems with getting it compiled, good luck!

Drew Benton
http://www.DrewBenton.net