-1

I have exported

/home/username/mesa/lib

LD_LIBRARY_PATH and tried to link the libraries, but I do not know what I have type wrong to compile the program.

So I tried to compile testing.cpp with the g++ command and it says :

 fatal error: osmesa.h: No such file or directory
 #include <osmesa.h>

I suppose I have typed wrong the command.

The command I tried: g++ testing.cpp -L/home/username/mesa/lib/libOSMesa.so -lmesa -s -Lmesa -lOSMesa -lGLU

Source code of testin.cpp:

#include <osmesa.h>

int main() 
{
return 0; 
}

libraries in side /home/username/mesa/lib:

libOSMesa.la libOSMesa.so libOSMesa.so.8 libOSMesa.so.8.0.0

scholar guy
  • 79
  • 2
  • 11
  • By the way, excellent job on learning how to run the compiler manually ! Once you get the hang of it though, I recommend reading on Gnu Makefiles and then on CMake to make your life easier ! – Arne J Jun 22 '19 at 07:35

1 Answers1

1

You must pass the include directories as well, use the -I compiler option. This is because the compiler will by default not look for headers in your home directory (it will do that for system installed libraries in /usr/include).

Arne J
  • 415
  • 2
  • 9