Hi,
I've got a problem : my program doesn't compile. I've use both technics of the doc, but with the createproject.sh script, after the creation of the project "my_project", when I do "jam" after a configuration, it say :
...failed C++ ./out/linuxx86/optimize/src/my_project.o...
...skipped my_project for lack of <src!>my_project.o...
...failed updating 1 target...
...skipped 1 target...
So, I've try with the Makefile, I've copy Makefile template, then edit it. When I do "make" it say something like (I translate from french) : "make: *** No rules to create the "main.o" target, necessary for "my_project". Stop."
The Makefile looks like that :
VERSION = 1.0
RELEASE_DATE = 01-Jan-2005
SRCDIR = ./src
TARGET_TYPE = exe
#TARGET_TYPE = plugin
TARGET_NAME = my_project
ifeq ($(TARGET_TYPE),exe)
TARGET=$(TARGET_NAME)$(EXE)
else
TARGET=$(TARGET_NAME)$(DLL)
endif
#------
# Location of sources and object files
#------
SRC=main.cpp
OBJS=$(addsuffix .o, $(basename $(SRC)))
OUT=.
#------
# Tools to use
#------
CXX=g++
LINK=$(CXX)
RM=rm -rf
#------
# Abstractions
#------
LFLAGS.L = -L
LFLAGS.l = -l
CFLAGS.D = -D
CFLAGS.I = -I
#------
# Flags for compiler and linker.
# Make sure to update the required libraries for your own project
#------
CFLAGS := $(shell cs-config --cflags)
CXXFLAGS := $(shell cs-config --cxxflags)
LINKFLAGS := $(shell cs-config --libs crystalspace)
DO.SHARED.PLUGIN.CORE=$(LINK) $(LFLAGS.DLL) -o $@ $^ $(PLUGIN.POSTFLAGS)
DO.PLUGIN = \
$(DO.SHARED.PLUGIN.PREAMBLE) \
$(DO.SHARED.PLUGIN.CORE) $(LINKFLAGS) \
$(DO.SHARED.PLUGIN.POSTAMBLE)
DO.EXE = $(LINK) -o $@ $^ $(LFLAGS.EXE) $(LINKFLAGS) $(LIBS.EXE.PLATFORM)
ifeq ($(TARGET_TYPE),exe)
DO.TARGET = $(DO.EXE)
else
DO.TARGET = $(DO.PLUGIN)
endif
CSCONFIG.MAK=csconfig.mak
-include $(CSCONFIG.MAK)
#------
# Rules
#------
.PHONY: all depend clean
.SUFFIXES: .cpp
.cpp.o: $<
$(CXX) $(CXXFLAGS) -o $@ -c $<
all: $(CSCONFIG.MAK) $(TARGET)
$(TARGET): $(OBJS)
$(DO.TARGET)
clean:
$(RM) $(TARGET) $(TARGET).app $(OBJS) $(CSCONFIG.MAK) \
makefile.dep *.def
#------
# Create dependencies
#------
depend: $(CSCONFIG.MAK)
gcc -MM $(CXXFLAGS) $(SRC) > makefile.dep
#------
# Re-create the config flags include file
#------
$(CSCONFIG.MAK):
cs-config --makevars > $(CSCONFIG.MAK)
#------
# Include dependencies
#------
-include makefile.dep
I need some help, it's an important project. Thanks.
[edit]
Ok, I've find for the Makefile, it was just to change SRC=main.cpp by SRC=src/main.cpp (it's hard to work with this heat). But I've got compils error like :
src/main.cpp : In member function 'bool Simple::HandleEvent(iEvent&)':
src/main.cpp:50: error: 'struct iEvent' has no member named 'Type'
Is there a librairy for this to include ?
[/edit]
[edit 2]
Allright, I've change ".Type" by ".Name", it's find, but I still have one error :
"'csevKeyboard' and 'csevQuit' was not declared in this scope." Maybe it's not the good syntaxe.
[/edit 2]
[edit 3]
Allright, I find that the example of documentation is not uptodate at all. I find good example into the cs/data directory. So it may work now. Don't use the documentation exemple with cs 0.99, it will not work with iEvent, and well, there's lot of change into the 0.99 version.
[/edit 3]