c++ - Makefile won't be created -
i new c++, , trying following. using mac, have xcode installed , trying create makefile. have following files in folder:
main.cpp
foo.cpp
foo.hpp
i step folder , try command make. gives me following:
make: *** no targets specified , no makefile found. stop.
i tried "make main" gave:
ld: symbol(s) not found architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation) make: *** [main] error 1
and other stuff above that. new makefile , not sure how create it. however, when sent files friend has ubuntu, typed in make , compiled immediately, not understand why not get.
positive response , explanation how 1 procedures create makefile. supposed generated automatically, isn't it? or have write myself?
i tried create makefile, , follow example, threw me error talking indents.
thank you!
you not create makefile running make
, not create foo.cpp
running c++ compiler. create makefile writing in editor, create foo.cpp
so create makefile need learn how write one, in language of make
, accomplish want to, needed learn c++ write foo.cpp
.
once have written makefile, can run make
process makefile , carry out tasks have coded in makefile. these tasks automate building of software have written in such way (re)building can done minimum work in minimum time.
different versions of make
have broadly similar yet different languages. find out version of make
using ($ make -v
) , study documentation , online tutorials it. language of make
simpler c++, still sufficiently complex cannot learn guesswork.
the used version gnu make. here an introductory tutorial. authoritative documentation, here the manual
Comments
Post a Comment