Sign in to follow this  

help compile project using Kdevelop

This topic is 4686 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, for days i have been trying to compile the server to my game on Linux (Fedora Core 3, using Kdevelop). now, finnally after i set up all the libraries, includes, and fixed all the errors, now what? when i click build, it builds everything with no errors, and the last message is "*** Exited with status: 2 ***". i didnt see any linker messages though, do i have to link it myself or something? when i click debug->run, it says "blah/blah is no such file or directory". if i click Build->execute program, it just gives this output in the "messages" tab: cd '/root/fta_server/fta_serv/debug' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k -j1 *** Exited with status: 2 *** so, anyone hav any clue what the problem could be? thanks for any help.

Share this post


Link to post
Share on other sites
it seems i cant find much help for this problem searching google and talking to people on IRC.

however, i really dont need kdevelop. i just want to get this compiled. ive tried writing the makefile with help from someone but i still cant get it to work. when i use it, i get this output:

[root@ool-4573224b fta_server]# make
make: Circular fta_server/Collision_Object.o <- fta_server/Collision_Object.o dependency dropped.
g++ -Wall -pedantic `sdl-config --cflags` -I/root/raknet/RakNetEVERYTHING!/Source -c -o fta_server/Collision_Object.o
g++: no input files
make: *** [fta_server/Collision_Object.o] Error 1


and this is what the makefile looks like:


#use "g++" to compile source files.
CC = g++

#use "g++" to link the object files.
LD = g++

#Compiler flags:
CFLAGS = -Wall -pedantic `sdl-config --cflags` -I/root/raknet/RakNetEVERYTHING!/Source
#CFLAGS = g++ -Wall -pedantic `sdl-config --cflags` -c Character.cpp -o #Charactor.o

#Linker flags:
LDFLAGS = $(shell sdl-config --libs)

#Dependency generator:
MDEPEND = g++ -M

#Clean-up command:
RM = /bin/rm -f

# dirs to search for files in
VPATH = ..

# The list of source files:
SRCS = Collision_Object.cpp Database.cpp Entity.cpp main.cpp Map.cpp Memory_Managed_Object.cpp Network_Server.cpp Player.cpp Projectiles.cpp System.cpp Character.cpp

#Libraries to include when linking:
LIBS = -lSDL /usr/local/lib/libmysqlpp.a /root/raknet/RakNetEVERYTHING!/bin/raknet.2.0.13.a

# program executable file name.
PROG = gf_server

# list of generated object files.
OBJS = fta_server/Collision_Object.o fta_server/Database.o fta_server/Entity.o fta_server/main.o fta_server/Map.o fta_server/Memory_Managed_Object.o fta_server/Network_Server.o fta_server/Player.o fta_server/Projectiles.o fta_server/System.o fta_server/Character.o


######## RULES ########

# Top-level rule: compile everything
all: $(PROG)

# The program link rule:
$(PROG): $(OBJS)
$(LD) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROG)

# Meta rule for compiling ".o" files
%.o: %.o
$(CC) $(CFLAGS) -c $< -o $@

# Rule for cleaning up before a recompile:
clean:
$(RM) $(PROG) $(OBJS)

# Rule for creating dependency lists and writing them into a dependency file:
#.depend:
# $(RM) .depend
# $(MDEPEND) $(SRCS) > .depend

#Include dependency list:
#include .depend



thanks for any help.

Share this post


Link to post
Share on other sites
thanks for your reply. now it actually attempts to compile, but it gives me a bunch of errors, things like "SDL.h : no such file or directory". however it all compile fine in Kdev, and in fact im using the same exact files and (i think) compiler settings, so im not sure what the problem could be. SDL.h is definetly in the folder i specify in the makefile. heres the latest version of it (i changed some include and lib stuff too):


#use "g++" to compile source files.
CC = g++

#use "g++" to link the object files.
LD = g++

#Compiler flags:
CFLAGS = -Wall -pedantic `sdl-config --cflags` -I/root/mysql/include -I/root/raknet/RakNetEVERYTHING!/Source -I/root/boost_1_32_0 -I/usr/include/SDL


#Linker flags:
LDFLAGS = $(shell sdl-config --libs)

#Dependency generator:
MDEPEND = g++ -M

#Clean-up command:
RM = /bin/rm -f

# dirs to search for files in
VPATH = ..

# The list of source files:
SRCS = Collision_Object.cpp Database.cpp Entity.cpp main.cpp Map.cpp Memory_Managed_Object.cpp Network_Server.cpp Player.cpp Projectiles.cpp System.cpp Character.cpp

#Libraries to include when linking:
LIBS = -lSDL /usr/local/lib/libmysqlpp.a /root/raknet/RakNetEVERYTHING!/bin/raknet.2.0.13.a

# program executable file name.
PROG = gf_server

# list of generated object files.
OBJS = fta_server/Collision_Object.o fta_server/Database.o fta_server/Entity.o fta_server/main.o fta_server/Map.o fta_server/Memory_Managed_Object.o fta_server/Network_Server.o fta_server/Player.o fta_server/Projectiles.o fta_server/System.o fta_server/Character.o


######## RULES ########

# Top-level rule: compile everything
all: $(PROG)

# The program link rule:
$(PROG): $(OBJS)
$(LD) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROG)

# Meta rule for compiling ".o" files
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@

# Rule for cleaning up before a recompile:
clean:
$(RM) $(PROG) $(OBJS)

# Rule for creating dependency lists and writing them into a dependency file:
#.depend:
# $(RM) .depend
# $(MDEPEND) $(SRCS) > .depend

#Include dependency list:
#include .depend





thanks again.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
err..nevermind that last post, I'm talking in my sleep. Do make sure that the SDL.h is where it should be, though.

Share this post


Link to post
Share on other sites
This sort of seems to work, aside from me not having any of the files or this mysterious raknet thingy.

#use "g++" to compile source files.
CC = g++ -c

#use "g++" to link the object files.
LD = g++

#Compiler flags:
CFLAGS := -Wall -pedantic `sdl-config --cflags` -I/root/raknet/RakNetEVERYTHING!/Source

#Linker flags:
LDFLAGS := `sdl-config --libs`

#Clean-up command:
RM = rm -f

# The list of source files:
SRCS = Collision_Object.cpp Database.cpp Entity.cpp main.cpp Map.cpp Memory_Managed_Object.cpp Network_Server.cpp Player.cpp Projectiles.cpp System.cpp Character.cpp

#Libraries to include when linking:
LIBS = /usr/local/lib/libmysqlpp.a /root/raknet/RakNetEVERYTHING!/bin/raknet.2.0.13.a

# program executable file name.
PROG = gf_server

# list of generated object files.
OBJS = $(foreach file,$(SRCS),fta_server/$(file:%.cpp=%.o))


######## RULES ########

# Targets that aren't real files
.PHONY: all clean

# Top-level rule: compile everything
all: $(PROG)
@echo "Source: $(SRCS)"
@echo "Objects: $(OBJS)"

# The program link rule:
$(PROG): $(OBJS)
$(LD) $(LDFLAGS) $^ $(LIBS) -o $(PROG)

# Meta rule for compiling ".o" files
fta_server/%.o: %.cpp
$(CC) $(CFLAGS) -c $< -o $@
$(CC) -MM $(CFLAGS) $< -MF$(@:fta_server/%.o=%.depend) -MT$@

# Rule for cleaning up before a recompile:
clean:
$(RM) $(PROG) $(OBJS) $(wildcard *.depend)

# Include dependency information if it exists:
ifneq ($(strip $(wildcard *depend)),)
include $(wildcard $(wildcard *.depend))
endif







Note: `sdl-config --cflags` will include all the junk you need for SDL, but you need to use #include "SDL.h" in your source, not #include <SDL.h> or #include "sdl.h".

Share this post


Link to post
Share on other sites
I just noticed that SDL uses long long, and pedantic doesn't like that, so you might want to add -Wno-long-long to CFLAGS, not that it would fix your problem.

Try compiling something really simple, like this:

// foo.cpp

#include "SDL.h"

int main()
{
return 0;
}


g++ `sdl-config --cflags --libs` foo.cpp -o foo

If it doesn't work, then SDL probably isn't installed correctly.

Share this post


Link to post
Share on other sites
hi smart_idiot,

i guess i wasnt kidding when i said i was secretly looking for the Windows disk. i can happily say that i gave up on Linux and now am running on Windows [grin].

this is for the dedicated server for my MORPG. i put togeather the machine and installed Fedora on it. but i was having a hell of a time trying to get the server to compile. furthermore, i was getting a lot of problems trying to setup the MySQL database as well (i got errors manually dowloading and using the installer script, using yum, using apt-get, AND using up2date). after ripping out all my hair for days i decided to just go with Windows.

the only reason i was using Linux in the first place was because Windows didnt support RAID 1, however i have found a solution to this problem. im just going to write a Python script that will periodically make a copy of the database onto the second HD. ironically, i think this will be better then RAID 1 since it will be faster to make writes and will use less disk space. (plus i can have the script do other things, like compress the data first, make archives, upload to a web server, etc..)

Share this post


Link to post
Share on other sites

This topic is 4686 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this