Thavarshan / gym

🏋️ Gym membership package purchase and invoice generator made using C++.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to compile program

Thavarshan opened this issue · comments

Divided up the program in to seperate files, main.cpp, 'menu.cpp' and menu.h; When compiling linker complaints about "symbol(s) not found".

  1. menu.cpp - Contains declaration of the displayMenu function.
  2. menu.h - Contains only declaration and not the body of displayMenu function.
  3. main.cpp - Uses displayMenu function inside the main funciton.

Screenshot 2021-02-23 at 11 27 12 AM

The issue is you're not compiling the menu.cpp, though you have included "menu.h" in your code. First you need to compile menu.cpp with additional flag -c and with output as menu.o also do the same for main.cpp as well at last,

clang++ main.o menu.o -o app

Also, better we have a makefile created. I think you don't need to do these if you're directly compiling with Viscose c++ toolchain ryt?