Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I suddenly got a compiler error message says the following: /usr/bin/ld: /tmp/ccYM4KZU.o: in function `main': main.cpp:(.text+0x23): undefined reference to `Election::Election()' collect2: error: ld returned 1
I suddenly got a compiler error message says the following:
/usr/bin/ld: /tmp/ccYM4KZU.o: in function `main': main.cpp:(.text+0x23): undefined reference to `Election::Election()' collect2: error: ld returned 1 exit status make: *** [Makefile:10: main] Error 1
This happens when I try to declare an Election object. I did not have this problem before. Can't figure out why because I believe my Election object should not need a user-defined constructor. The object only has a vector of candidates as the private data member
class Election public: Election(); void Registration(int,string); candidate getCandidate(int); void campaign(ElectoralMap&,int,int); private: vectorStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started