Portál AbcLinuxu, 9. června 2025 09:55


Dotaz: Gmake nenachazi dependency file v Makefile

20.11.2005 15:24 Voidless
Gmake nenachazi dependency file v Makefile
Přečteno: 224×
Odpovědět | Admin
Zdravim,

ucim se ted bastlit v C++ a mam problem s kompilaci pomoci Makefile - vypada to ze make (gmake) nedokaze z nejakeho duvodu vlozit vytvoreny dependency file pomoci 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...?
Nástroje: Začni sledovat (0) ?Zašle upozornění na váš email při vložení nového komentáře.

Na otázku zatím nikdo bohužel neodpověděl.

Založit nové vláknoNahoru

Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.