Menu

[Build Error] No rule to make target...

2008-12-12
2012-09-26
  • Martin Willms

    Martin Willms - 2008-12-12

    I'm a social science student trying to get someone else's program ('TextTiling' or 'TextTile') to compile because this program would help me for research I'm working on. I know very little about C++, but I've been using Dev-C++ trying to get it to compile. I'm having problems, and any help I could get would be appreciated.

    The error I get trying to run the makefile is this:

    [Build Error] No rule to make target 'ByteHash.C', needed by 'ByteHash.o'. Stop.

    The makefile I'm running is this:


    Project: TextTiling

    Makefile created by Dev-C++ 4.9.9.2

    CPP = g++.exe
    CC = gcc.exe
    WINDRES = windres.exe
    RES =
    OBJ = ByteHash.o error.o MemList.o Param.o segdist.o String.o TextTile.o util.o $(RES)
    LINKOBJ = ByteHash.o error.o MemList.o Param.o segdist.o String.o TextTile.o util.o $(RES)
    LIBS = -L"C:/Dev-Cpp/lib"
    INCS = -I"C:/Dev-Cpp/include"
    CXXINCS = -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
    BIN = TextTiling.exe
    CXXFLAGS = $(CXXINCS) -ansi -pedantic -Wall
    CFLAGS = $(INCS) -ansi -pedantic -Wall
    RM = rm -f

    .PHONY: all all-before all-after clean clean-custom

    all: all-before TextTiling.exe all-after

    clean: clean-custom
    ${RM} $(OBJ) $(BIN)

    $(BIN): $(OBJ)
    $(CC) $(LINKOBJ) -o "TextTiling.exe" $(LIBS)

    ByteHash.o: ByteHash.C
    $(CC) -c ByteHash.C -o ByteHash.o $(CFLAGS)

    error.o: error.c
    $(CC) -c error.c -o error.o $(CFLAGS)

    MemList.o: MemList.C
    $(CC) -c MemList.C -o MemList.o $(CFLAGS)

    Param.o: Param.C
    $(CC) -c Param.C -o Param.o $(CFLAGS)

    segdist.o: segdist.C
    $(CC) -c segdist.C -o segdist.o $(CFLAGS)

    String.o: String.C
    $(CC) -c String.C -o String.o $(CFLAGS)

    TextTile.o: TextTile.C
    $(CC) -c TextTile.C -o TextTile.o $(CFLAGS)

    util.o: util.c
    $(CC) -c util.c -o util.o $(CFLAGS)


    It seems to be putzing out almost at the very beginning.

    The program comes with no documentation other than a readme file. The relevant line for compiling?

    1. Build TextTile and segdist with "make"

    I'm running Dev-C++ 4.9.9.2 over Vista. What can I tell you? I'm at my wits end. I suspect because what I'm trying to do is very easy, but I'm not sure what I'm doing wrong. None of the files are nested in directories with spaces...

    Cheers (and thanks!),

    Martin

     
    • Martin Willms

      Martin Willms - 2008-12-16

      Will do, Clifford. Thanks again for the help. You're very prompt and the help is appreciated.

       
    • cpns

      cpns - 2008-12-12

      Post the whole log, not a fragment!

      You may have confused teh build by using .C rather than .c. GNU assumes the .C files are C++ rather than C, use lowercase extensions.

      The "PLEASE READ BEFORE POSTING A QUESTION" has specific instructions on workarounds necessary to use Dev-C++ with Vista, did you apply them? (the makefile indicates that you have not).

      Clifford

       
    • Martin Willms

      Martin Willms - 2008-12-12

      Hi Clifford, I changed the file extensions to .c and made some progress since my last post. I'm sorry for my ignorance, but I'm a complete newbie to C.

      The complete log is this:

      Compiler: Default compiler
      Building Makefile: "C:\Dev-Cpp\workspace\Makefile.win"
      Executing make...
      make.exe -f "C:\Dev-Cpp\workspace\Makefile.win" all
      gcc.exe -c TextTiling/util.c -o TextTiling/util.o -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/workspace/TextTiling"

      TextTiling/util.c:8:22: sys/wait.h: No such file or directory
      TextTiling/util.c:26:21: sys/vfs.h: No such file or directory
      TextTiling/util.c: In function `free_storage':
      TextTiling/util.c:239: error: storage size of 'sfs' isn't known

      make.exe: *** [TextTiling/util.o] Error 1

      Execution terminated


      The program is one I downloaded here: http://people.ischool.berkeley.edu/~hearst/tiling-about.html

      I didn't write the makefile, but have altered it to reflect the lower case C's.

      I've googled around and I think I'm missing the posix library, but don't really have a clue and am leery about downloading and linking files that I'm not certain about. I have done some bits to ensure the thing works on Vista, but am not sure I've covered everything.

      (I've set the environment variables and tried to make sure no spaces were in the paths.)

      Thanks for your help,

      Martin

       
    • cpns

      cpns - 2008-12-12

      > TextTiling/util.c:8:22: sys/wait.h: No such file or directory
      > TextTiling/util.c:26:21: sys/vfs.h: No such file or directory

      These are OS specific files, but are not Windows headers. Windows does not fully support POSIX APIs. You will probably have to do some porting of the code to get it to compile and run on Windows.

      You will probably have more luck building it in its intended environment (Linux or OSX perhaps, either way a UNIX-like environment). You might be able to build it under Cygwin, but that is a sledgehammer for a nut.

      A simple(ish) solution is to run Linux under a Virtual Machine (using VMWare's free VMPlayer or VMServer tools for example). And then build and run teh code in a VM. The VM can access the Windows machine via a virtual network, so you can still get results and data uinto the Windows environment if you wish.

      On a diferent issue, Dev-C++ will sometimes (and apparently randomly) fail when projects are in sub-folders of its installation directory (C:\Dev-Cpp).

      Clifford

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.