Compile error: Undefined references to functions relating to class SimulationResults
mmjac10 opened this issue · 2 comments
I have some errors related to undefined references to functions. Following is the complete error log:
sender-logger.o: In function SimulationResults<WhiskerTree> run_simulation_for_results<Rat, WhiskerTree>(WhiskerTree&, NetConfig&, Rat&, unsigned int, unsigned int, double)': /home/collosalkid/Documents/tcp_exMachina_remy/remy/src/sender-logger.cc:36: undefined reference to
SimulationResults::add_run_data(NetConfig const&, double)'
sender-logger.o: In function SimulationResults<FinTree> run_simulation_for_results<Fish, FinTree>(FinTree&, NetConfig&, Fish&, unsigned int, unsigned int, double)': /home/collosalkid/Documents/tcp_exMachina_remy/remy/src/sender-logger.cc:36: undefined reference to
SimulationResults::add_run_data(NetConfig const&, double)'
sender-logger.o: In function void serialize_to_file<FinTree>(SimulationResults<FinTree>&, std::string&)': /home/collosalkid/Documents/tcp_exMachina_remy/remy/src/sender-logger.cc:60: undefined reference to
SimulationResults::DNA() const'
sender-logger.o: In function void serialize_to_file<WhiskerTree>(SimulationResults<WhiskerTree>&, std::string&)': /home/collosalkid/Documents/tcp_exMachina_remy/remy/src/sender-logger.cc:60: undefined reference to
SimulationResults::DNA() const'
collect2: error: ld returned 1 exit status
I checked the undefined error relating to "SimulationResults::add_run_data(NetConfig const&, double) " and found that there is no class SimulationResults as the class template of SimulationResults is defined to . I am probably missing something here so please let me know how to resolve this.
Note: I have removed the flags -Werror and -Weffc++ from all makefiles as it was giving some warnings as errors.
Thankyou
Remy builds out-of-the-box on Ubuntu 14.04 LTS in the continuous-testing environment (Travis-CI) (with g++ 4.9). You can see the .travis.yml file for an exact recipe of how it gets built. It also builds out-of-the-box on Ubuntu 17.10 (with g++ 7.2).
As we wrote a few days ago, we can only help you debug build errors if you post a full log of all the commands you typed to install dependencies, configure remy to find them, and then the full build log.
Okay so I installed the g++4.9 version using the following commands:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50
sudo apt-get install g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /us
Protobuf was installed using the following commands:
-sudo apt-get install autoconf automake libtool curl make g++ unzip
"extracting tarball of latest version"
-cd protobuf
-./autogen.sh
-./configure
-make
-make check
-sudo make install
-sudo ldconfig
Boost was installed with the command:
-sudo apt-get install libboost-all-dev
All this was done on my Ubuntu 14.04. I am still receiving the above errors after running ./autogen.sh, then ./configure and make. Please help me resolve this.
Thanks