Episodes
Friday May 25, 2007
undefined reference to "function name"
Friday May 25, 2007
Friday May 25, 2007
If you get the error messge -- undefined reference to "function name"-- when you compile a program. This means the compiler can not find the object file which hosts the function during the link stage. You probably forgot put the object file in Makefile. If Myclass.cpp has the "function". Change your Makefile and add MyClass.o as following, it will compile properly. MyProgram: HelloWorld.o MyClass.o $(CCLINKER) $(CFLAGS) -o myProgram helloWorld.o MyClass.o
Version: 20240320
Comments (0)
To leave or reply to comments, please download free Podbean or
No Comments
To leave or reply to comments,
please download free Podbean App.