2

I'm using the CLion IDE and need to put some OpenGL files in. In the JetBrains/CLion folder there's a bin and lib folder. In the lib folder theres jar files, do I put the header and dlls in here?

get this error:

CMakeFiles\GL.dir/objects.a(main.cpp.obj): In function `glutInit_ATEXIT_HACK':
c:/mingw/include/gl/glut.h:486: undefined reference to `__glutInitWithExit'
CMakeFiles\GL.dir/objects.a(main.cpp.obj): In function `glutCreateWindow_ATEXIT_HACK':
c:/mingw/include/gl/glut.h:503: undefined reference to `__glutCreateWindowWithExit'
CMakeFiles\GL.dir/objects.a(main.cpp.obj): In function `glutCreateMenu_ATEXIT_HACK':
c:/mingw/include/gl/glut.h:549: undefined reference to `__glutCreateMenuWithExit'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\GL.dir\build.make:86: recipe for target 'GL.exe' failed
mingw32-make.exe[3]: *** [GL.exe] Error 1
CMakeFiles\Makefile2:59: recipe for target 'CMakeFiles/GL.dir/all' failed
CMakeFiles\Makefile2:71: recipe for target 'CMakeFiles/GL.dir/rule' failed
mingw32-make.exe[2]: *** [CMakeFiles/GL.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles/GL.dir/rule] Error 2
Makefile:109: recipe for target 'GL' failed
mingw32-make.exe: *** [GL] Error 2
Joe
  • 355
  • 3
  • 8
  • (1) you add include paths in [CMakeLists.txt](http://www.cmake.org/documentation/) (2) You should use system OpenGL headers – Ivan Aksamentov - Drop Mar 03 '15 at 01:07
  • (3) It was bad idea to put `glut` headers inside `mingw` include folder. (4) Now you should link glut `.lib`(`.a`) to your program (with CMake) – Ivan Aksamentov - Drop Mar 03 '15 at 01:32
  • possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Ivan Aksamentov - Drop Mar 03 '15 at 01:34

1 Answers1

2

From the FAQ here:

At present CLion supports GCC and Clang compilers and is guided by these two to get the libraries and headers paths.

So it depends on the compiler CLion is using where it looks for the header files.

Emil Laine
  • 41,598
  • 9
  • 101
  • 157