Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

linux compiling error

clouddon edited this page Mar 29, 2020 · 6 revisions

This page collects all the common linux compiling error. All these problem is caused by the different compiling criteria of linux gcc and windows cl. gcc has a much stricter compiling criteria, so developer in windows should remember these problems to avoid compiling failure in linux. Developer in linux should recognize these problems easily and fix them.

template subclass access properties or methods in template superclass

error: ‘m_position’ was not declared in this scope
   m_position.connect(m_integrator->m_position);

when template subclass try to access the properties or methods in its template superclass, you need to add "this->" before the properties or methods like this

this->m_position.connect(m_integrator->m_position);

use other template function in the method of template class

error: expected primary-expression before ‘>’ token
   m_visModule = this->addConstraintModule<ImplicitViscosity<TDataType>>("viscosity");

if you try to use other irrelevent template function in the implementation of template class's methods, you need to add a keyword "template" like this

m_visModule = this->template addConstraintModule<ImplicitViscosity<TDataType>>("viscosity");

initialize template superclass in template subclass' constructor

error: class ‘Physika::ParticleViscoplasticBody<TDataType>’ does not have any field named ‘ParticleSystem’
   : ParticleSystem(name)

If a template subclass extended a template superclass, then you should initialize superclass with template in the subclass' constructor like

template<typename TDataType>
ParticleViscoplasticBody<TDataType>::ParticleViscoplasticBody(std::string name)
	: ParticleSystem<TDataType>(name)

Cannot find lGL lGLU

First of all, update and upgrade apt-get.

# Add repo and update
$ sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
$ sudo apt-get update
$ sudo apt-get upgrade

Next install needed libraries.

$sudo apt-get install libx11-dev xorg-dev libglu1-mesa-dev libglu1-mesa libglu1-mesa-dev libgl1-mesa-glx libgl1-mesa-dev