in kfs-0.5 must be changed in file KfsSample_

2011-01-11
2013-04-25
  • he hongjing
    he hongjing
    2011-01-11

    in kfs-0.5 must be changed in file KfsSample_main.cc

    line:66
    KfsFileStat statInfo; ->> struct stat statInfo;

    line:105
    string* basedir = "ctest"; ->> char* basedir = "ctest";

    line:117
    string tempFn(basedir + "/foo.1"); ->> char tempFn;strcpy( tempFn, basedir );

    line:166
    kfsOff_t sz = statInfo.size; ->> off_t sz = statInfo.st_size;

    line:173
    string npath = basedir + "/foo.2"; ->> char npath;strcpy( npath, basedir );strcat( npath, "/foo.2" );

    vi kfs-0.5/examples/makefile**

    AR=ar
    ARFLAGS=-cr
    RL=ranlib
    RLFLAGS=
    CC=g++
    CXXFLAGS=-I. -Wall
    CP=cp
    LDFLAGS=

    ifneq ($(RELEASE),yes)
    CXXFLAGS += -g
    LDFLAGS  += -g
    endif

    CXXFLAGS += -I../src/cc/ -I/usr/include/ -I../src/cc/libkfsClient/

    LDFLAGS += -L../build/lib/static/

    EXTLIBS=-lkfsClient -lkfsCommon -lkfsIO -lqcdio -lpthread -lrt -lssl

    DOWNLOAD_SRC= \
    KfsSample_main.cc

    OBJ_DOWNLOAD=$(DOWNLOAD_SRC:.cpp=.o,.cc=.o)

    TARGETS=testkfs

    all: $(TARGETS)

    testkfs: $(OBJ_DOWNLOAD)
            $(CC) $(LDFLAGS) $(CXXFLAGS) -o $@ $^ $(EXTLIBS)

    %.o:%.cpp
            $(CC) $(CXXFLAGS) -c -o $**@ $<

    clean:
            rm -f *~ $(OBJS) $(TARGETS)

    I hope it's helpful for some people

     
  • Very helpful - thanks, Hongjing!!