Thread: An Error

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    11

    An Error

    Hi I got this error when trying to compile a GDI window I was making, In the makefile.
    Code:
    # Project: Project1
    # Makefile created by Dev-C++ 4.9.9.2
    
    CPP  = g++.exe
    CC   = gcc.exe
    WINDRES = windres.exe
    RES  = gdi_private.res
    OBJ  = "D:/Documents\ and\ Settings/Stephen/Desktop/gdi/main.o" $(RES)
    LINKOBJ  = "D:/Documents and Settings/Stephen/Desktop/gdi/main.o" $(RES)
    LIBS =  -L"C:/Dev-Cpp/lib" -mwindows -lgdi32  
    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  = gdi.exe
    CXXFLAGS = $(CXXINCS)  
    CFLAGS = $(INCS)  
    RM = rm -f
    
    .PHONY: all all-before all-after clean clean-custom
    
    all: all-before gdi.exe all-after
    
    
    clean: clean-custom
    	${RM} $(OBJ) $(BIN)
    
    $(BIN): $(OBJ) //<<<---This is the line of code that refers to the error
    	$(CPP) $(LINKOBJ) -o "gdi.exe" $(LIBS)
    
    "D:/Documents\ and\ Settings/Stephen/Desktop/gdi/main.o": D:/Documents\ and\ Settings/Stephen/Desktop/gdi/main.cpp
    	$(CPP) -c "D:/Documents and Settings/Stephen/Desktop/gdi/main.cpp" -o "D:/Documents and Settings/Stephen/Desktop/gdi/main.o" $(CXXFLAGS)
    
    gdi_private.res: gdi_private.rc D:/Documents\ and\ Settings/Stephen/Desktop/gdi/GDI01.RC 
    	$(WINDRES) -i gdi_private.rc --input-format=rc -o gdi_private.res -O coff
    Error:
    26 C:\Dev-Cpp\Makefile.win [Build Error] *** multiple target patterns. Stop.

    Ive tryed 2 other forums but nobody seems to know what is wrong.

    Any ideas =/

    --Stephen

  2. #2
    Registered User
    Join Date
    Jan 2006
    Posts
    11
    Come on please, Nobody seems to know anythung about this =[

    --Stephen

  3. #3
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    The error is because your target expands to someting like

    Code:
    ggdi.exe: something D:something_else
    Make sees D: as beeing anoter target
    must be some missing '"' somewhere. Cannot locate it .
    Kurt

  4. #4
    Registered User
    Join Date
    Jan 2006
    Posts
    11
    Kind of lost reading that =/

    --Stephen

  5. #5
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    I don't think that you really need all those absolute path in your makefile
    Like this it's not generating errors anymore
    Code:
    # Project: Project1
    # Makefile created by Dev-C++ 4.9.9.2
    
    CPP  = g++.exe
    CC   = gcc.exe
    WINDRES = windres.exe
    RES  = gdi_private.res
    OBJ  = main.o $(RES)
    LINKOBJ  = main.o $(RES)
    LIBS =  -L"C:/Dev-Cpp/lib" -mwindows -lgdi32  
    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  = gdi.exe
    CXXFLAGS = $(CXXINCS)  
    CFLAGS = $(INCS)  
    RM = rm -f
    
    .PHONY: all all-before all-after clean clean-custom
    
    all: all-before gdi.exe all-after
    
    
    clean: clean-custom
    	${RM} $(OBJ) $(BIN)
    
    $(BIN): $(OBJ)
    	$(CPP) $(LINKOBJ) -o "gdi.exe" $(LIBS)
    
    main.o: main.cpp
    	$(CPP) -c main.cpp -o main.o $(CXXFLAGS)
    
    gdi_private.res: gdi_private.rc GDI01.RC 
    	$(WINDRES) -i gdi_private.rc --input-format=rc -o gdi_private.res -O coff
    Kurt

  6. #6
    Registered User
    Join Date
    Jan 2006
    Posts
    11
    Nop, still getting the error

    --Stephen

  7. #7
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    The makefile that I posted should be ok ( at least for gnu-make ).
    Are you writing the makefile yourself ?
    If not I guess the original one got generated again.
    Kurt

  8. #8
    Registered User
    Join Date
    Jan 2006
    Posts
    11
    No it just generates.

    --Stephen

  9. #9
    Registered User
    Join Date
    Jan 2006
    Posts
    11
    I stopped it from generating but this line of code

    Code:
    $(BIN): $(OBJ)
    Still has this error:
    "26 C:\Dev-Cpp\Makefile.win [Build Error] *** multiple target patterns. Stop. "

    --Stephen
    Last edited by Tyriin; 01-28-2006 at 12:28 PM.

  10. #10
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    Think best is if you setup a new project, and move your source-files.
    I would recommend to use a path without any spaces in the name as well. ( not even Windows itself handles them very well ).
    Kurt

  11. #11
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Code:
    $(BIN): $(OBJ)
    expands to
    Code:
    gdi.exe: main.o gdi_private.res
    Does that help?

    I'm not sure if this works in Windows:
    Code:
    D:/Documents\ and\ Settings/Stephen/Desktop/gdi/GDI01.RC
    Try this instead:
    Code:
    "D:/Documents and Settings/Stephen/Desktop/gdi/GDI01.R"
    But don't get confused and try both:
    Code:
    "D:/Documents\ and\ Settings/Stephen/Desktop/gdi/main.o"
    How are you invoking make? Try
    Code:
    C>make all
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  12. #12
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    Code:
    "26 C:\Dev-Cpp\Makefile.win [Build Error] *** multiple target patterns. Stop. "
    Code:
    OBJ  = "D:/Documents\ and\ Settings/Stephen/Desktop/gdi/main.o" $(RES)
    Just noticed that the makefile and sources are on different drives even. Unusual I would say.
    Must be something wrong with either the setup of the IDE ( compiler ) or your project.
    Kurt

  13. #13
    Registered User
    Join Date
    Jan 2006
    Posts
    11
    None of those worked. =[

    And Im still getting this error.

    --Stephen

  14. #14
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    How are you invoking make?
    Code:
    all: all-before gdi.exe all-after
    all-before and all-after aren't declared.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  15. #15
    Registered User
    Join Date
    Jan 2006
    Posts
    11
    Im new to GDI, I was following a tutorial on it and then this happened and I started seeking help so Im not sure what to do =[

    --Stephen

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  3. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  4. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 10:33 AM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 01:10 AM