mox601
06-03-2007, 03:05 AM
hello everyone, i'm matteo and i'm kinda new with opengl/glut so be patient...
i'm writing a program and everything went fine until i added the project a new file, objects.c and .h in which i have some functions to call from palazzo.c, the one with main().
i think i made a mess with the Makefile and with includes of libraries: i'm posting my code so i hope someone can help!
makefile:
#ottimizza livello 2 ed includi simboli debugging
OBJECTS=palazzo.o objects.o
CFLAGS=-O2 -g
INCDIR=
LINKLIBS=-lglut -lGLU -lGL -lm
palazzo: palazzo.o objects.o
$(CC) $(CFLAGS) $(LINKLIBS) objects.o palazzo.o -o palazzo
%.o: %.c
$(CC) $(CFLAGS) $(LINKLIBS) -c $< -o $@
clean:
rm -f *.o palazzo objects
@echo "clean done"palazzo.c (just the include)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <GL/glut.h>
#include <GL/glu.h>
#include "objects.h"objects.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <GL/glut.h>
#include "objects.h"objects.h
#ifndef _objects
#define _objects
#endifthe error i get when launcing make is the following:
cc -O2 -g -lglut -lGLU -lGL -lm -c palazzo.c -o palazzo.o
palazzo.c: In function ‘main’:
palazzo.c:234: error: ‘Glfloat’ undeclared (first use in this function)
palazzo.c:234: error: (Each undeclared identifier is reported only once
palazzo.c:234: error: for each function it appears in.)
palazzo.c:234: error: expected ‘;’ before ‘diffuseLight’
palazzo.c:235: error: expected ‘;’ before ‘specularLight’
palazzo.c:236: error: expected ‘;’ before ‘position’
palazzo.c:236:25: error: invalid suffix "f" on integer constant
palazzo.c:236:30: error: invalid suffix "f" on integer constant
palazzo.c:236:35: error: invalid suffix "f" on integer constant
palazzo.c:240: error: ‘diffuseLight’ undeclared (first use in this function)
palazzo.c:241: error: ‘specularLight’ undeclared (first use in this function)
palazzo.c:242: error: ‘position’ undeclared (first use in this function)
make: *** [palazzo.o] Error 1 tell me if i have to paste some other lines!
thanxx!
i'm writing a program and everything went fine until i added the project a new file, objects.c and .h in which i have some functions to call from palazzo.c, the one with main().
i think i made a mess with the Makefile and with includes of libraries: i'm posting my code so i hope someone can help!
makefile:
#ottimizza livello 2 ed includi simboli debugging
OBJECTS=palazzo.o objects.o
CFLAGS=-O2 -g
INCDIR=
LINKLIBS=-lglut -lGLU -lGL -lm
palazzo: palazzo.o objects.o
$(CC) $(CFLAGS) $(LINKLIBS) objects.o palazzo.o -o palazzo
%.o: %.c
$(CC) $(CFLAGS) $(LINKLIBS) -c $< -o $@
clean:
rm -f *.o palazzo objects
@echo "clean done"palazzo.c (just the include)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <GL/glut.h>
#include <GL/glu.h>
#include "objects.h"objects.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <GL/glut.h>
#include "objects.h"objects.h
#ifndef _objects
#define _objects
#endifthe error i get when launcing make is the following:
cc -O2 -g -lglut -lGLU -lGL -lm -c palazzo.c -o palazzo.o
palazzo.c: In function ‘main’:
palazzo.c:234: error: ‘Glfloat’ undeclared (first use in this function)
palazzo.c:234: error: (Each undeclared identifier is reported only once
palazzo.c:234: error: for each function it appears in.)
palazzo.c:234: error: expected ‘;’ before ‘diffuseLight’
palazzo.c:235: error: expected ‘;’ before ‘specularLight’
palazzo.c:236: error: expected ‘;’ before ‘position’
palazzo.c:236:25: error: invalid suffix "f" on integer constant
palazzo.c:236:30: error: invalid suffix "f" on integer constant
palazzo.c:236:35: error: invalid suffix "f" on integer constant
palazzo.c:240: error: ‘diffuseLight’ undeclared (first use in this function)
palazzo.c:241: error: ‘specularLight’ undeclared (first use in this function)
palazzo.c:242: error: ‘position’ undeclared (first use in this function)
make: *** [palazzo.o] Error 1 tell me if i have to paste some other lines!
thanxx!