Results 1 to 3 of 3

Thread: openGL in windows using netbeans

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    2

    openGL in windows using netbeans

    I've used openGL before but I've never been very good and setting up IDEs to use the libraries I want. So I'm using netbeans 6.7 and I'm trying to run openGL for C/C++ (I program in C). As far as I can tell I've installed all the correct things, gl.h, glut.h, glu32, opengl32, glut32 libraries, I've run mulitple tutorials and to no avail. I've finally come to rest on this last error:

    gcc -g -O0 -Wall main.c -lglut32 -lglu32 -lopengl32 -o myprog
    /cygdrive/c/DOCUME~1/SHANNO~1.BAR/LOCALS~1/Temp/ccJZxZ2f.o: In function `main':
    /cygdrive/t/mine/projects/consoleApp/CppApplication_1/main.c:31: undefined reference to `_glutInit'
    /cygdrive/t/mine/projects/consoleApp/CppApplication_1/main.c:32: undefined reference to `_glutInitDisplayMode'
    /cygdrive/t/mine/projects/consoleApp/CppApplication_1/main.c:33: undefined reference to `_glutInitWindowSize'
    /cygdrive/t/mine/projects/consoleApp/CppApplication_1/main.c:34: undefined reference to `_glutInitWindowPosition'
    /cygdrive/t/mine/projects/consoleApp/CppApplication_1/main.c:35: undefined reference to `_glutCreateWindow'
    /cygdrive/t/mine/projects/consoleApp/CppApplication_1/main.c:36: undefined reference to `_glutDisplayFunc'
    /cygdrive/t/mine/projects/consoleApp/CppApplication_1/main.c:37: undefined reference to `_glutReshapeFunc'
    /cygdrive/t/mine/projects/consoleApp/CppApplication_1/main.c:38: undefined reference to `_glutMainLoop'
    collect2: ld returned 1 exit status
    make: *** [myprog] Error 1


    My makefile looks as follows:
    COMPILER = gcc
    CCFLAGS = -g -O0 -Wall
    myprog: main.c
    ${COMPILER} ${CCFLAGS} main.c -lglut32 -lglu32 -lopengl32 -o myprog

    ..and I've changed the link line to a variety of different things, I've tried the relative path -L/usr/include/w32api, I've changed the order, I've done a ton. The most notable problem I run into, which I'm guessing is the culprit is the error I get when I include -lglut -lGL -lGLU

    gcc -g -O0 -Wall main.c -L/usr/include/w32api -lGL -lGLU -lglut32 -lglu32 -lopengl32 -o myprog
    /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -lGL
    collect2: ld returned 1 exit status
    make: *** [myprog] Error 1

    Which leads me to believe that I've installed something wrong. I've gone into the project properties and added opengl32.lib glu32.lib glut32.lib to the 'Additional Library Directories' and -lopengl32 -lglu32 -lglut32 to the 'Libraries' tab.

    Pretty much I've totally run into a wall, the only thing I've really found is stuff for openGL java in netbeans and then I found something that was in C++, which didn't work either.

    Can someone please help me?

  2. #2
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    2

    Re: openGL in windows using netbeans

    well i fixed it...added a few libraries to the link line...i still can't get it to run in netbeans though, works in cygwin

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2009
    Posts
    1

    Re: openGL in windows using netbeans

    i have the same problem, but shown warnings are

    gcc-3.exe -o dist/Debug/Cygwin-Windows/opengl -s build/Debug/Cygwin-Windows/teste.o -lglut32 -lglu32 -lopengl32 -lglaux -lgdi32 -lwinmm
    /usr/lib/w32api/libglut32.a(glut_swap.o):glut_swap.c.text+0xcb): undefined reference to `__imp___iob'
    /usr/lib/w32api/libglut32.a(glut_util.o):glut_util.c.text+0x3f): undefined reference to `__imp___iob'
    /usr/lib/w32api/libglut32.a(glut_util.o):glut_util.c.text+0x5c): undefined reference to `__imp___iob'
    /usr/lib/w32api/libglut32.a(glut_util.o):glut_util.c.text+0x75): undefined reference to `__imp___iob'
    /usr/lib/w32api/libglut32.a(glut_util.o):glut_util.c.text+0xa4): undefined reference to `__flsbuf'
    /usr/lib/w32api/libglut32.a(glut_util.o):glut_util.c.text+0xec): undefined reference to `__imp___iob'
    /usr/lib/w32api/libglut32.a(glut_util.o):glut_util.c.text+0x109): undefined reference to `__imp___iob'
    /usr/lib/w32api/libglut32.a(glut_util.o):glut_util.c.text+0x122): undefined reference to `__imp___iob'
    /usr/lib/w32api/libglut32.a(glut_util.o):glut_util.c.text+0x16c): undefined reference to `__flsbuf'
    /usr/lib/w32api/libglut32.a(glut_util.o):glut_util.c.text+0x1af): undefined reference to `__imp___iob'
    /usr/lib/w32api/libglut32.a(glut_util.o):glut_util.c.text+0x1cc): undefined reference to `__imp___iob'
    /usr/lib/w32api/libglut32.a(glut_util.o):glut_util.c.text+0x1e5): undefined reference to `__imp___iob'
    /usr/lib/w32api/libglut32.a(glut_util.o):glut_util.c.text+0x211): undefined reference to `__flsbuf'

    I use more libraries than you, these libraries are used by devcpp, i thought it would work in netbeans

Similar Threads

  1. NetBeans and OpenGL On A Mac
    By Carmine in forum OpenGL: macOS
    Replies: 1
    Last Post: 09-03-2014, 09:26 PM
  2. OpenGL development on netbeans
    By jeferson in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 05-12-2013, 08:49 AM
  3. Building in NetBeans in C++ on Windows 7
    By stig mann in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 03-12-2013, 11:08 AM
  4. [Tutorial] NetBeans with OpenGL and Freeglut
    By wolfomat in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 03-22-2012, 12:05 PM
  5. Netbeans compiles and runs in terminal?
    By RobertEd in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 05-21-2010, 12:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean