m3the01
2007.06.19, 02:39 PM
Background
Full working application developed under linux with opengl, cg, sdl
Just switched to a mac book pro, been waiting for an update in hardware and it came:-)
Now i downloaded the xcode development kit, which i was told will load most lib's i need.
Im using g++ compiler and a makefile for builds,
I downloaded the cg, sdl and sld_image frameworks and they are all installed in the root library/frameworks section
Ive downloaded the runtime and the devel-extras from the sdl site. I dont really see much in the sdl_devel-extras besides those sdlmain.h and sdlmain.m files. I attempted to include them in my project directory and in my main class with #include "SDLMain.h"
#include "SDLMain.m"
But i get a crazy amount of errors,
Here is a copy of my makefile and the error i get,
############
MACHINE= $(shell uname -s)
################################################## ######
# LIBRARY/FRAMEWORK INCLUDES -lXi-lXmu
#cgc -profile arbfp1 -o shader.pso shader.cg
#cgc -profile arbvp1 -o temp.vp test.cg
#glxinfo |grep programs
################################################## ######
ifeq ($(MACHINE),Darwin)
OPENGL_INC= -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
OPENGL_LIB= -framework OpenGL -framework GLUT -framework SDL_image -framework SDL -framework Cg
SDL_INC= #`sdl-config --cflags`
SDL_LIB= #`sdl-config --libs`
else
OPENGL_INC= -FOpenGL -FGLUT -FCg
OPENGL_LIB= -framework OpenGL -framework GLUT -framework SDL_image -framework SDL -framework Cg
SDL_INC= #'sdl-config --cflags'
SDL_LIB= #'sdl-config --libs'
endif
CC = g++
# libraries required to compile for the labs
INCLUDE=$(SDL_INC) $(OPENGL_INC)
LIBRARIES = -lm $(SDL_LIB) $(OPENGL_LIB)
ALLOFEM = $(INCLUDE) $(LIBRARIES)
################################################## ######
# COMPILE FLAGS & OBJECT LIST
################################################## ######
DEBUG =
TOPS = galaxy.o SolidEntity.o
SOLID_OBJS = Stars.o Planets.o Earth.o Mars.o Venus.o Mercury.o Jupiter.o Saturn.o Uranus.o Neptune.o Pluto.o
UTILITY = Vec3.o Frustum.o FileReader.o Matrix4x4.o Camera.o Texture.o Shaders.o Utility.o
OBJECTS = $(TOPS) $(UTILITY) $(SOLID_OBJS)
EXECUTABLE = galaxy
################################################## ######
# DEPENDENCIES -Wall warnings
################################################## ######
all: galaxy
run: all
./galaxy 1
big: all
./galaxy 2
stereo: all
./galaxy 3
debug: all
gdb ./galaxy
%.o: %.cpp %.h
$(CC) -c -O3 -o $@ $< $(INCLUDE)
$(EXECUTABLE): $(OBJECTS)
$(CC) -O3 -o $(EXECUTABLE) $(OBJECTS) $(LIBRARIES)
tar:
tar -czvf proj497.tgz *.cpp *.h *.txt makefile
clean:
rm -rf *.o galaxy proj497.tgz
make
g++ -c -O3 -o galaxy.o galaxy.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o SolidEntity.o SolidEntity.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Vec3.o Vec3.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Frustum.o Frustum.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o FileReader.o FileReader.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Matrix4x4.o Matrix4x4.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Camera.o Camera.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Texture.o Texture.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Shaders.o Shaders.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Utility.o Utility.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Stars.o Stars.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Planets.o Planets.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Earth.o Earth.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Mars.o Mars.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Venus.o Venus.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Mercury.o Mercury.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Jupiter.o Jupiter.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Saturn.o Saturn.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Uranus.o Uranus.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Neptune.o Neptune.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Pluto.o Pluto.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -O3 -o galaxy galaxy.o SolidEntity.o Vec3.o Frustum.o FileReader.o Matrix4x4.o Camera.o Texture.o Shaders.o Utility.o Stars.o Planets.o Earth.o Mars.o Venus.o Mercury.o Jupiter.o Saturn.o Uranus.o Neptune.o Pluto.o -lm -framework OpenGL -framework GLUT -framework SDL_image -framework SDL -framework Cg
/usr/bin/ld: Undefined symbols:
_main
collect2: ld returned 1 exit status
make: *** [galaxy] Error 1
Full working application developed under linux with opengl, cg, sdl
Just switched to a mac book pro, been waiting for an update in hardware and it came:-)
Now i downloaded the xcode development kit, which i was told will load most lib's i need.
Im using g++ compiler and a makefile for builds,
I downloaded the cg, sdl and sld_image frameworks and they are all installed in the root library/frameworks section
Ive downloaded the runtime and the devel-extras from the sdl site. I dont really see much in the sdl_devel-extras besides those sdlmain.h and sdlmain.m files. I attempted to include them in my project directory and in my main class with #include "SDLMain.h"
#include "SDLMain.m"
But i get a crazy amount of errors,
Here is a copy of my makefile and the error i get,
############
MACHINE= $(shell uname -s)
################################################## ######
# LIBRARY/FRAMEWORK INCLUDES -lXi-lXmu
#cgc -profile arbfp1 -o shader.pso shader.cg
#cgc -profile arbvp1 -o temp.vp test.cg
#glxinfo |grep programs
################################################## ######
ifeq ($(MACHINE),Darwin)
OPENGL_INC= -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
OPENGL_LIB= -framework OpenGL -framework GLUT -framework SDL_image -framework SDL -framework Cg
SDL_INC= #`sdl-config --cflags`
SDL_LIB= #`sdl-config --libs`
else
OPENGL_INC= -FOpenGL -FGLUT -FCg
OPENGL_LIB= -framework OpenGL -framework GLUT -framework SDL_image -framework SDL -framework Cg
SDL_INC= #'sdl-config --cflags'
SDL_LIB= #'sdl-config --libs'
endif
CC = g++
# libraries required to compile for the labs
INCLUDE=$(SDL_INC) $(OPENGL_INC)
LIBRARIES = -lm $(SDL_LIB) $(OPENGL_LIB)
ALLOFEM = $(INCLUDE) $(LIBRARIES)
################################################## ######
# COMPILE FLAGS & OBJECT LIST
################################################## ######
DEBUG =
TOPS = galaxy.o SolidEntity.o
SOLID_OBJS = Stars.o Planets.o Earth.o Mars.o Venus.o Mercury.o Jupiter.o Saturn.o Uranus.o Neptune.o Pluto.o
UTILITY = Vec3.o Frustum.o FileReader.o Matrix4x4.o Camera.o Texture.o Shaders.o Utility.o
OBJECTS = $(TOPS) $(UTILITY) $(SOLID_OBJS)
EXECUTABLE = galaxy
################################################## ######
# DEPENDENCIES -Wall warnings
################################################## ######
all: galaxy
run: all
./galaxy 1
big: all
./galaxy 2
stereo: all
./galaxy 3
debug: all
gdb ./galaxy
%.o: %.cpp %.h
$(CC) -c -O3 -o $@ $< $(INCLUDE)
$(EXECUTABLE): $(OBJECTS)
$(CC) -O3 -o $(EXECUTABLE) $(OBJECTS) $(LIBRARIES)
tar:
tar -czvf proj497.tgz *.cpp *.h *.txt makefile
clean:
rm -rf *.o galaxy proj497.tgz
make
g++ -c -O3 -o galaxy.o galaxy.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o SolidEntity.o SolidEntity.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Vec3.o Vec3.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Frustum.o Frustum.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o FileReader.o FileReader.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Matrix4x4.o Matrix4x4.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Camera.o Camera.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Texture.o Texture.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Shaders.o Shaders.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Utility.o Utility.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Stars.o Stars.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Planets.o Planets.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Earth.o Earth.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Mars.o Mars.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Venus.o Venus.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Mercury.o Mercury.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Jupiter.o Jupiter.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Saturn.o Saturn.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Uranus.o Uranus.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Neptune.o Neptune.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -c -O3 -o Pluto.o Pluto.cpp -FOpenGL -FGLUT -FCg -FSDL_image -FSDL
g++ -O3 -o galaxy galaxy.o SolidEntity.o Vec3.o Frustum.o FileReader.o Matrix4x4.o Camera.o Texture.o Shaders.o Utility.o Stars.o Planets.o Earth.o Mars.o Venus.o Mercury.o Jupiter.o Saturn.o Uranus.o Neptune.o Pluto.o -lm -framework OpenGL -framework GLUT -framework SDL_image -framework SDL -framework Cg
/usr/bin/ld: Undefined symbols:
_main
collect2: ld returned 1 exit status
make: *** [galaxy] Error 1