• Advertisement

grady

Member
  • Content count

    104
  • Joined

  • Last visited

Community Reputation

122 Neutral

About grady

  • Rank
    Member
  1. Strange GCC Issue

    I'm not an expert, but this is what I do to automatically create a makefile for my small projects. The file below would be called game.mk. The line in the 'makefile' target that calls the compiler with the -M option does all of the magic. 'gcc -M source.cpp' will barf a makefile-syntax-friendly list of header files that source.cpp depends on. I found this out from O'Reilly's "Managing Projects with Make" book. #to recreate the makefile type 'make -f game.mk makefile AUTO=headers' INCLUDE=-I /usr/incl (truncated) SOURCES=$(OBJS:.o=.cpp) terrain.cpp game : $(OBJS) $(CXX) $(OBJS) $(INCLUDE) $(LIBS) -pg -o $@ terrain : $(TERRAINOBJS) $(CXX) $(TERRAINOBJS) $(INCLUDE) $(LIBS) -pg -o $@ clean: rm core* *.o game makefile : $(AUTO) cp game.mk $@ $(CXX) $(INCLUDE) -M $(SOURCES) >> $@ headers:
  2. Here is a how-to on loading functions and classes from shared objects at runtime. http://www.tldp.org/HOWTO/C++-dlopen/
  • Advertisement