1

My friend made OpenGL graphic engine, but he is working on Windows. I want to compile project with it.
I installed all required libs with headers, but now problem is with linking (project in Code::Blocks). I found paths for /usr/lib/libSOIL.a and /usr/local/lib/libglfw3.a, but what about:

  • C:\Program Files (x86)\CodeBlocks\MinGW\lib\libopengl32.a
  • C:\Program Files (x86)\CodeBlocks\MinGW\lib\assimp_debug-dll_win32\assimp.lib

Also, what I must modify in project file to compile it? It requires: glfw3, glm, gl3w.h, assimp, SOIL (this is what I get from .hpp files). I installed all headers (downloaded sources and make && make install)...

I tried to compile it from terminal with g++, but I don't know switches for libraries.

Current situation:

$ g++ Camera.o Entity.o Frustum.o gl3w.o Light.o Material.o Mesh.o Model.o ModelPart.o Shader.o Texture.o Utilities.o ../main.o -o main -L/usr/local/lib/libglfw3.a -lX11 -lXext -lXt -lSM -lGLU -lglut -lSOIL
/usr/bin/ld: gl3w.o: undefined reference to symbol 'glXGetProcAddress'
/usr/bin/ld: note: 'glXGetProcAddress' is defined in DSO /usr/lib/nvidia-313-updates/libGL.so.1 so try adding it to the linker command line
/usr/lib/nvidia-313-updates/libGL.so.1: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status

(i added too much libraries to command line, I know)

EDIT
Added -lGL and -ldl and some problems comes out. Now, I'll trying compile it with makefile...

2
  • I think your problem is not about how to compile with OpenGL in Linux, but a general lack of understanding how the GCC build toolchain works in Linux. Just throwing a Makefile into that won't really solve that problem. Commented Nov 15, 2013 at 11:57
  • Now solved, just tons of mistakes with libraries etc. Also, Makefile is really better solution than C::B project... Commented Nov 15, 2013 at 18:35

1 Answer 1

1

libopengl32 -> libGL.a

assimp -> libassimp.a ?

You gotta provide the Makefile you're compiling it with.

Sign up to request clarification or add additional context in comments.

3 Comments

But from what directory? I have a few libGL.so, and none libassimp.a :( Please look at my edit, I added error from ld.
There is no libGL.a. You want to link to libGL.so simply by specifying the -lGL linker flag.
@aso you forgot to link with GLFW it seems, specify -lglfw3 to the commandline

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.