Hello Can someone help me with this code I'm new to c ++
#include & lt; Stdio.h & gt; # Include & lt; Iostream & gt; using namespace std; Nishtha Manish {double meaning (double A, double B); } Double meaning (double a, double b) {return (a + b) / 2; } I want to create a stable library for this, I use the command G ++ calc_mean.cpp -o mean.o this gives me the following error < Pre> / usr / lib / gcc / x86_64-linux-gnu / 4.4.3 /../../../ lib / crt1.o: in function `_start ': (.text + 0x20): Undefined Reference `main ' Can anyone tell me what I am doing wrong? Or how to create a namespace for a function so that its name can be used in another location by using the space "post-text" itemprop = "text">
-If this means that the compiler expects to make the files a complete program. However, a full program should have a main () function. You should use:
G ++ -c calc_mean.cpp If you do not have the main function.
Comments
Post a Comment