Menu

Can't get GLUI to work

2007-07-26
2012-09-26
  • Nobody/Anonymous

    Hi,

    I just started working with Dev-c++ and I'm having trouble getting it to work with GLUI. After checking out this forum, I was able to make it work with GLUT, but only in C mode (not C++), and I can't get it to work with GLUI at all. I would really appreciate some help with this.

    I'm using Windows Vista Home Premium
    I'm using Dev-C++ version 4.9.9.2
    The only GLUI code I added to my working GLUT code was #include <GL/glui.h>
    My compiler log is as follows:

    Compiler: Default compiler
    Building Makefile: "C:\Dev-Cpp\Projects\GUI\Makefile.win"
    Executing make...
    c:\dev-cpp\bin\make.exe -f "C:\Dev-Cpp\Projects\GUI\Makefile.win" all
    c:\dev-cpp\bin\gcc.exe -c main.c -o main.o -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/gtk-2.0" -I"C:/Dev-Cpp/include/glib-2.0" -I"C:/Dev-Cpp/lib/gtk-2.0/include" -I"C:/Dev-Cpp/lib/glib-2.0/include" -I"C:/Dev-Cpp/include/atk-1.0" -I"C:/Dev-Cpp/include/pango-1.0" -I"C:/Dev-Cpp/include/GL" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -mms-bitfields -I"C:\Dev-Cpp\include\gtkdeps-2.0" -I"C:\Dev-Cpp\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\lib\glib-2.0" -I"C:\Dev-Cpp\lib\glib-2.0\include" -mms-bitfields -lglui -lglut32 -lopengl32 -lglu32 -lwinmm

    In file included from main.c:2:
    C:/Dev-Cpp/include/GL/glui.h:30:19: cstdlib: No such file or directory
    C:/Dev-Cpp/include/GL/glui.h:31:18: cstdio: No such file or directory

    C:/Dev-Cpp/include/GL/glui.h:32:19: cstring: No such file or directory
    In file included from main.c:2:
    C:/Dev-Cpp/include/GL/glui.h:40: error: syntax error before "Arcball"

    C:/Dev-Cpp/include/GL/glui.h:40: warning: data definition has no type or storage class
    C:/Dev-Cpp/include/GL/glui.h:53: error: syntax error before "RGBc"
    C:/Dev-Cpp/include/GL/glui.h:53: error: syntax error before '{' token

    ..... (A bunch more errors, I won't bother including the whole list here)

    Any help would be very much appreciated.

    Thanks,
    --Steph

     
    • Nobody/Anonymous

      Any news of this issue?

      --Steph

       
    • Nobody/Anonymous

      I got to work finally :)

      Just in case anyone else has the same problems, this is what my compiler commands are: -mms-bitfields -lglut32 -lopengl32 -lglu32 -lglui -lwinmm
      and my linker commands: -fnative-struct -lglut32 -lopengl32 -lglu32 -lglui -lwinmm

      Thanks for all the help!

      --Steph

       
    • Wayne Keen

      Wayne Keen - 2007-07-26

      Well, your results seem consistent.

      As you mentioned earlier, you have issues compiling C++ code. The headers
      that it is not finding are C++ headers.

      You will probably need to work with your paths in the IDE to get the
      header and library directories added correctly, in much the same way
      as you did for the C stuff.

      Wayne

       
    • Nobody/Anonymous

      That's what I expected, but I'm not sure what to change exactly. This is what I get when I try to compile it as C++ code, and was having the same errors without the GLUI include (just with GLUT):

      Compiler: Default compiler
      Building Makefile: "C:\Dev-Cpp\Projects\Makefile.win"
      Executing make...
      c:\dev-cpp\bin\make.exe -f "C:\Dev-Cpp\Projects\Makefile.win" all
      c:\dev-cpp\bin\g++.exe -D__DEBUG__ test.o -o "Project1.exe" -L"C:/Dev-Cpp/lib" -lgtk-win32-2.0 -lgdk-win32-2.0 -limm32 -lshell32 -lole32 -luuid -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -mno-cygwin -fnative-struct -lglui -lglut32 -lopengl32 -lglu32 -lwinmm -g3

      C:/Dev-Cpp/lib/libglut32.a(glut_win.o)(.text+0x631):glut_win.c: undefined reference to ChoosePixelFormat@8' C:/Dev-Cpp/lib/libglut32.a(glut_win.o)(.text+0x64a):glut_win.c: undefined reference toSetPixelFormat@12'
      C:/Dev-Cpp/lib/libglut32.a(win32_menu.o)(.text+0x4a7):win32_menu.c: undefined reference to `GdiFlush@0'
      ... (more errors of similar nature)

      Thanks again,
      --Steph

       
      • Wayne Keen

        Wayne Keen - 2007-07-26

        I have a silly question - are you using Dev-C++ with Cygwin?

        Wayne

         
    • Nobody/Anonymous

      No, not to my knowledge anyway lol. Just running it as a standard windows app.

      --Steph

       
      • Wayne Keen

        Wayne Keen - 2007-07-26

        You are compiling with an option -mngo-cygwin that makes no sense for
        compiling under mingw - it is an option one uses when compiling under
        cygwin and telling it to not use cygwin1.dll

        Wayne

         
    • Nobody/Anonymous

      Thanks. I got the compile codes from other posts on this forum to get GLUT to work in C mode, so I'm not sure which are needed and which aren't. I've removed that one, but I'm still having the same problems.

      New compiler log in C++ mode:

      Compiler: Default compiler
      Building Makefile: "C:\Dev-Cpp\Projects\Makefile.win"
      Executing make...
      c:\dev-cpp\bin\make.exe -f "C:\Dev-Cpp\Projects\Makefile.win" all
      c:\dev-cpp\bin\g++.exe -D__DEBUG__ test.o -o "Project1.exe" -L"C:/Dev-Cpp/lib" -lgtk-win32-2.0 -lgdk-win32-2.0 -limm32 -lshell32 -lole32 -luuid -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -fnative-struct -lglui -lglut32 -lopengl32 -lglu32 -lwinmm -g3

      C:/Dev-Cpp/lib/libglut32.a(glut_win.o)(.text+0x631):glut_win.c: undefined reference to ChoosePixelFormat@8' C:/Dev-Cpp/lib/libglut32.a(glut_win.o)(.text+0x64a):glut_win.c: undefined reference toSetPixelFormat@12'
      C:/Dev-Cpp/lib/libglut32.a(win32_menu.o)(.text+0x4a7):win32_menu.c: undefined reference to GdiFlush@0' C:/Dev-Cpp/lib/libglut32.a(win32_x11.o)(.text+0x1f):win32_x11.c: undefined reference toGetPixelFormat@4'
      C:/Dev-Cpp/lib/libglut32.a(win32_x11.o)(.text+0x44):win32_x11.c: undefined reference to DescribePixelFormat@16' C:/Dev-Cpp/lib/libglut32.a(win32_x11.o)(.text+0xc0):win32_x11.c: undefined reference toGetSystemPaletteEntries@16'
      C:/Dev-Cpp/lib/libglut32.a(win32_x11.o)(.text+0x374):win32_x11.c: undefined reference to `CreatePalette@4'
      ... more errors....

      Thanks,
      --Steph

       
    • Wayne Keen

      Wayne Keen - 2007-07-26

      I think you have an issue with the order in which you are linking you graphics libraries.

      I don't remember (and am stuck in a place I can't check) what the right order is, but
      play around with the order of glut32, opengl32 and glu32 - it may fix things.

      You have a LOT of libraries linked, gtk, gdk, pango, and some things I am not even
      sure what they are - like the mno-cygwin, they probably are not causing problems,
      but they would be better not there.

      Wayne

       
    • Nobody/Anonymous

      Playing around with them changes the order of the errors, but no luck in fixing the problem. When you are able to get home and check on the order they should be linked in, I would really appreciate it. Which are the libraries that are needed and which ones are not? If you could post what I should have under the compiler and linker command options, that would be of great help.

      Thanks so much for troubleshooting this with me :)

      --Steph

       
    • Nobody/Anonymous

      Were you able to check the order for me Wayne?

      Thanks,
      --Steph

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.