I have 2 cpp and 3 header files in my project. When I compile them in VS it works smoothly and I get no error message. But when I try to compile it on SSH network by this line:
g++ -o program.cpp lineoperations.cpp customer.h transaction.h lineoperations.h
It says:
In function `_start':
(.text+0x20): undefined reference to `main'
Do not say "do not forget to write main function" because it is already there and my project works on VS. What to do then?
Here is related part from my codes. Program.cpp until main:
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include "lineoperations.h"
using namespace std;
line bankline;
bool operate(char);
void search(char[]);
void add(char[]);
void removee(char[]);
void transaction();
void printline();
int main(){
bankline.create();
bool end = false;
while (!end) {
end = bankline.decideFunction();
}
bankline.close();
return EXIT_SUCCESS;
}
It goes on but it is not necessary to paste them I guess. If you need to see other cpp file or header files I'll paste them as well.