Portál AbcLinuxu, 15. listopadu 2025 06:46
include $(DEPFILE)
Pri kompilaci dostanu chybu
Makefile:43: dependencyfile.make: No such file or directory InitFileParser.o(.text+0xe): In function `InitFileParser::InitFileParser[not-in-charge]()': : undefined reference to `std::basic_string< char, std::char_traits< char>, std::allocator< char> >::basic_string[in-charge]()' InitFileParser.o(.text+0x1c): In function `InitFileParser::InitFileParser[not-in-charge]()': : undefined reference to `std::basic_string< char, std::char_traits< char>, std::allocator< char> >::basic_string[in-charge]()' InitFileParser.o(.text+0x2a): In function `InitFileParser::InitFileParser[not-in-charge]()': : undefined reference to `std::basic_string< char, std::char_traits< char>, std::allocator< char> >::basic_string[in-charge]()'+ tunu dalsich podobnych hlasek o undefined reference Situace: - 4 zdrojove soubory: initexception.hh InitFileParser.cc InitFileParser.hh parserPokus.cc - Makefile je nasledujici:
# objektitiedostot
OBJS = InitFileParser.o parserPokus.o
SRC = *.cc
# Variables
#CXX = tutg++
CXX = gcc
CXXFLAGS =
DEPXX = g++ -MM
DEPFILE = dependencyfile.make
EXE = parserPokus
# Linker part
XXLNK = $(CXX) -o $@ $(CXXFLAGS) $^
# First rule is a default rule, executed with only "gmake"
default: $(EXE)
# Main executable linking
$(EXE): $(OBJS)
$(XXLNK)
# Clean part, removes *.o, executable and the dependency file
clean:
-rm $(OBJS) $(EXE) $(DEPFILE)
# Object files are compiled using ..., dependencies are found
# from DEPFILE file
%.o: %.cpp
$(CXX) -c $(CXXFLAGS) $<
# finds out the file dependencies automatically and adds them to a file
$(DEPFILE):
$(DEPXX) $(SRC) > $(DEPFILE)
depend:
@echo "Updating $(DEPFILE)"
$(DEPXX) $(SRC) > $(DEPFILE)
# include information from dependency file to this file
include $(DEPFILE)
Protoze skolni kompilator/gmake to spolkne bez problemu, hadam ze je neco spatne na mem stroji...?
Na otázku zatím nikdo bohužel neodpověděl.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.