I've run gdb on h3dInit() call which causes the failure. It appeared that call to glXGetProcAddressARB("glCreateShader") returns 0 when -lGL is the first, and a correct address when -lHorde3D is the first. The function is located in -lGL. How can this cause the problem?