Very new to mac, very old to programming.
Searched for a while but can't come up with a solution.
I have a program which was developed under linux and it works very well, i now have troubles on the new mac book pro 2.4ghz nvidia notebook i picked up last week.
Ive grabbed the needed frameworks and installed per instruction. Ive also downloaded the xcode developer kit and installed.
Here is the makefile, modified as per internet instruction for compilation on a mac.
In the actual source ive only changed the opengl, glut and cg header files as per new instruction when compilation is on a mac.
Anyway this is the makefile and the error is below.
CC = g++
########################################################
# LIBRARY/FRAMEWORK INCLUDES -lXi-lXmu
#cgc -profile arbfp1 -o shader.pso shader.cg
#cgc -profile arbvp1 -o temp.vp test.cg
#glxinfo |grep programs
########################################################
# libraries required to compile for the labs
INCLUDE =
LIBDIR =
GLULIBDIR =
FRAMEWORK = -framework OpenGL -framework GLUT -framework SDL_image -framework SDL -framework Cg
LIBRARIES = -lm
ALLOFEM = $(FRAMEWORK) $(INCLUDE) $(LIBDIR) $(LIBRARIES) $(GLULIBDIR)
########################################################
# 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)
########################################################
# 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) -O3 -c -o $@ $< $(DEBUG) $(INCLUDE)
galaxy: $(OBJECTS)
$(CC) $(INCLUDE) $(OBJECTS) $(ALLOFEM) $(DEBUG) -O3 -o galaxy
tar:
tar -czvf proj497.tgz *.cpp *.h *.txt makefile
clean:
rm -rf *.o galaxy proj497.tgz
And the error message, it has to do with the final linking
g++ -O3 -c -o galaxy.o galaxy.cpp
g++ -O3 -c -o SolidEntity.o SolidEntity.cpp
g++ -O3 -c -o Vec3.o Vec3.cpp
g++ -O3 -c -o Frustum.o Frustum.cpp
g++ -O3 -c -o FileReader.o FileReader.cpp
g++ -O3 -c -o Matrix4x4.o Matrix4x4.cpp
g++ -O3 -c -o Camera.o Camera.cpp
g++ -O3 -c -o Texture.o Texture.cpp
g++ -O3 -c -o Shaders.o Shaders.cpp
g++ -O3 -c -o Utility.o Utility.cpp
g++ -O3 -c -o Stars.o Stars.cpp
g++ -O3 -c -o Planets.o Planets.cpp
g++ -O3 -c -o Earth.o Earth.cpp
g++ -O3 -c -o Mars.o Mars.cpp
g++ -O3 -c -o Venus.o Venus.cpp
g++ -O3 -c -o Mercury.o Mercury.cpp
g++ -O3 -c -o Jupiter.o Jupiter.cpp
g++ -O3 -c -o Saturn.o Saturn.cpp
g++ -O3 -c -o Uranus.o Uranus.cpp
g++ -O3 -c -o Neptune.o Neptune.cpp
g++ -O3 -c -o Pluto.o Pluto.cpp
g++ 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 -framework OpenGL -framework GLUT -framework SDL_image -framework SDL -framework Cg -lm -O3 -o galaxy
/usr/bin/ld: Undefined symbols:
_main
collect2: ld returned 1 exit status
make: *** [galaxy] Error 1
Thanks guys for any and all help!
Searched for a while but can't come up with a solution.
I have a program which was developed under linux and it works very well, i now have troubles on the new mac book pro 2.4ghz nvidia notebook i picked up last week.
Ive grabbed the needed frameworks and installed per instruction. Ive also downloaded the xcode developer kit and installed.
Here is the makefile, modified as per internet instruction for compilation on a mac.
In the actual source ive only changed the opengl, glut and cg header files as per new instruction when compilation is on a mac.
Anyway this is the makefile and the error is below.
CC = g++
########################################################
# LIBRARY/FRAMEWORK INCLUDES -lXi-lXmu
#cgc -profile arbfp1 -o shader.pso shader.cg
#cgc -profile arbvp1 -o temp.vp test.cg
#glxinfo |grep programs
########################################################
# libraries required to compile for the labs
INCLUDE =
LIBDIR =
GLULIBDIR =
FRAMEWORK = -framework OpenGL -framework GLUT -framework SDL_image -framework SDL -framework Cg
LIBRARIES = -lm
ALLOFEM = $(FRAMEWORK) $(INCLUDE) $(LIBDIR) $(LIBRARIES) $(GLULIBDIR)
########################################################
# 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)
########################################################
# 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) -O3 -c -o $@ $< $(DEBUG) $(INCLUDE)
galaxy: $(OBJECTS)
$(CC) $(INCLUDE) $(OBJECTS) $(ALLOFEM) $(DEBUG) -O3 -o galaxy
tar:
tar -czvf proj497.tgz *.cpp *.h *.txt makefile
clean:
rm -rf *.o galaxy proj497.tgz
And the error message, it has to do with the final linking
g++ -O3 -c -o galaxy.o galaxy.cpp
g++ -O3 -c -o SolidEntity.o SolidEntity.cpp
g++ -O3 -c -o Vec3.o Vec3.cpp
g++ -O3 -c -o Frustum.o Frustum.cpp
g++ -O3 -c -o FileReader.o FileReader.cpp
g++ -O3 -c -o Matrix4x4.o Matrix4x4.cpp
g++ -O3 -c -o Camera.o Camera.cpp
g++ -O3 -c -o Texture.o Texture.cpp
g++ -O3 -c -o Shaders.o Shaders.cpp
g++ -O3 -c -o Utility.o Utility.cpp
g++ -O3 -c -o Stars.o Stars.cpp
g++ -O3 -c -o Planets.o Planets.cpp
g++ -O3 -c -o Earth.o Earth.cpp
g++ -O3 -c -o Mars.o Mars.cpp
g++ -O3 -c -o Venus.o Venus.cpp
g++ -O3 -c -o Mercury.o Mercury.cpp
g++ -O3 -c -o Jupiter.o Jupiter.cpp
g++ -O3 -c -o Saturn.o Saturn.cpp
g++ -O3 -c -o Uranus.o Uranus.cpp
g++ -O3 -c -o Neptune.o Neptune.cpp
g++ -O3 -c -o Pluto.o Pluto.cpp
g++ 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 -framework OpenGL -framework GLUT -framework SDL_image -framework SDL -framework Cg -lm -O3 -o galaxy
/usr/bin/ld: Undefined symbols:
_main
collect2: ld returned 1 exit status
make: *** [galaxy] Error 1
Thanks guys for any and all help!