*** multiple target patterns. Stop. error generated n DEV c++



  • Hi,

    I want to parse an XML file using DEV C++ for that I am using pugiXML ver1.7 I included pugi.cpp,pugi.hpp,pugiconfig.hpp files. After compiling it gives me error:: multiple target patterns at line $(BIN): $(OBJ) in below makefile

    # Project: Pugi
    # Makefile created by Dev-C++ 5.11
    
    CPP      = g++.exe
    CC       = gcc.exe
    WINDRES  = windres.exe
    OBJ      = pugi.o "F:/Rup/Cognizant\ data/Cognizant/xml/pugixml-1.7/pugixml-1.7/src/pugixml.o"
    LINKOBJ  = pugi.o "F:/Rup/Cognizant data/Cognizant/xml/pugixml-1.7/pugixml-1.7/src/pugixml.o"
    LIBS     = -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib" -static-libgcc "F:/Rup/Cognizant data/Cognizant/xml/pugixml-1.7/pugixml-1.7/src/pugiconfig.hpp" "F:/Rup/Cognizant data/Cognizant/xml/pugixml-1.7/pugixml-1.7/src/pugixml.hpp" "F:/Rup/Cognizant data/Cognizant/xml/pugixml-1.7/pugixml-1.7/src/pugixml.cpp"
    INCS     = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include"
    CXXINCS  = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++"
    BIN      = Pugi.exe
    CXXFLAGS = $(CXXINCS) 
    CFLAGS   = $(INCS) 
    RM       = rm.exe -f
    
    .PHONY: all all-before all-after clean clean-custom
    
    all: all-before $(BIN) all-after
    
    clean: clean-custom
    	${RM} $(OBJ) $(BIN)
    
    $(BIN): $(OBJ)
    	$(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)
    
    pugi.o: pugi.cpp
    	$(CPP) -c pugi.cpp -o pugi.o $(CXXFLAGS)
    
    "F:/Rup/Cognizant\ data/Cognizant/xml/pugixml-1.7/pugixml-1.7/src/pugixml.o": F:/Rup/Cognizant\ data/Cognizant/xml/pugixml-1.7/pugixml-1.7/src/pugixml.cpp
    	$(CPP) -c "F:/Rup/Cognizant data/Cognizant/xml/pugixml-1.7/pugixml-1.7/src/pugixml.cpp" -o "F:/Rup/Cognizant data/Cognizant/xml/pugixml-1.7/pugixml-1.7/src/pugixml.o" $(CXXFLAGS)
    

    I am novice user.Please help me out and give solution step by step. Here is my program. thanks in advance 🙂

    #include <pugixml.hpp>
    #include <iostream>
    #include<time.h>
    
    using namespace pugi;
    using namespace std;
    
    int main()
    {
    
    		const clock_t begin_time = clock();
    
    	//load existing xml file
    	xml_document doc; // this will create empty document in memory
    	xml_parse_result result = doc.load_file("F://Rup//M.tech 3rd sem//pugiXML//sample.xml", pugi::parse_default | pugi::parse_declaration);
    
    	if (!result)
    	{
    		cout << "Parse error: " << result.description()
    			<< ", character pos= " << result.offset;
    	}
    	else cout << "Success!!";
    
    	//Extracting parent 
    	cout << "Load result: " << result.description() << ", parent name: " 
    		<< doc.child("class").name() << endl; //this prints name of root element
    
    	cout << "Parent attribute:" << doc.child("class").attribute("name").value() << endl;
    
    	//xml_node panels = doc.child("class");
    	//cout << panels.name() << std::endl;
    	//Extracting child
    
    	//xml_node panel = panels.first_child();
    	cout << "first Child:" << doc.child("class").first_child().name() << endl;
    	cout << "first Child attr:" << doc.child("class").first_child().attribute("rollno").value() << endl;
    
    	//printing all values
    
    	for (xml_node classname = doc.child("class").first_child(); classname; classname = classname.next_sibling())
    	{
    		cout << classname.name() << endl;
    		for (xml_node stud = classname.first_child(); stud; stud = stud.next_sibling())
    		{
    			std::cout << stud.name() << "=" << stud.text().get() << std::endl;
    
    		}
    		cout << "  " << endl;
    	}
    
    	std::cout << float( clock () - begin_time ) /  CLOCKS_PER_SEC<<"  milli sec";
    	getchar();
    	return 0;
    }
    


  • Das ist aber echt ne wichtige Frage - zu Makefiles, nicht zu C++.



  • Dieser Thread wurde von Moderator/in SeppJ aus dem Forum C++ (alle ISO-Standards) in das Forum Rund um die Programmierung verschoben.

    Im Zweifelsfall bitte auch folgende Hinweise beachten:
    C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?

    Dieses Posting wurde automatisch erzeugt.


  • Mod

    Sounds like a problem with inproperly escaped characters. Have you tried escaping all the colons and all the spaces? I see that some spaces are escaped and some are not. An unescaped colon would look like multiple targets to Make.


Log in to reply