Jump to content
  • Advertisement
Sign in to follow this  
graveyard filla

help compile project using Kdevelop

This topic is 4972 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
Advertisement
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
Change -I/usr/include/SDL to -I/usr/include/SDL/include

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
thanks everyone.. i tried using smart_idiot's script, but still no luck, i get the same erros all dealing with SDL types being un-declared, including one error saying SDL.h does not exist..

*secretly starts searching for Windows 2000 boot disk*

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!