nickgillian / grt

gesture recognition toolkit
853 stars 286 forks source link

build issues on Ubuntu 18.04 #161

Open divsdotsrivs opened 5 years ago

divsdotsrivs commented 5 years ago

Hi, I am trying to get GRT working on ubuntu 18.04. When following the linux osx build instructions, I run into an issue when I go to compile the GRT library and examples. I get the following error:

[ 73%] Building CXX object CMakeFiles/GaussianMixtureModelsExample.dir/home/username/grt/examples/ClusteringModulesExamples/GaussianMixtureModelsExample/GaussianMixtureModelsExample.cpp.o /home/username/grt/examples/ClusteringModulesExamples/GaussianMixtureModelsExample/GaussianMixtureModelsExample.cpp: In function ‘int main(int, const char**)’: /home/username/grt/examples/ClusteringModulesExamples/GaussianMixtureModelsExample/GaussianMixtureModelsExample.cpp:62:25: error: cannot bind non-const lvalue reference of type ‘std::fstream& {aka std::basic_fstream&}’ to an rvalue of type ‘std::fstream {aka std::basic_fstream}’ if( !gmm.save( std::fstream("GMM.grt") ) ){ ^~~~~~ In file included from /home/username/grt/build/../examples/../GRT/ClassificationModules/GMM/GMM.h:30:0, from /home/username/grt/build/../examples/../GRT/GRT.h:129, from /home/username/grt/examples/ClusteringModulesExamples/GaussianMixtureModelsExample/GaussianMixtureModelsExample.cpp:27: /home/username/grt/build/../examples/../GRT/ClassificationModules/GMM/../../ClusteringModules/GaussianMixtureModels/GaussianMixtureModels.h:123:18: note: initializing argument 1 of ‘virtual bool GRT::GaussianMixtureModels::save(std::fstream&) const’ virtual bool save( std::fstream &file ) const; ^~~~ /home/username/grt/examples/ClusteringModulesExamples/GaussianMixtureModelsExample/GaussianMixtureModelsExample.cpp:68:25: error: cannot bind non-const lvalue reference of type ‘std::fstream& {aka std::basic_fstream&}’ to an rvalue of type ‘std::fstream {aka std::basic_fstream}’ if( !gmm.load( std::fstream("GMM.grt") ) ){ ^~~~~~ In file included from /home/username/grt/build/../examples/../GRT/ClassificationModules/GMM/GMM.h:30:0, from /home/username/grt/build/../examples/../GRT/GRT.h:129, from /home/username/grt/examples/ClusteringModulesExamples/GaussianMixtureModelsExample/GaussianMixtureModelsExample.cpp:27: /home/username/grt/build/../examples/../GRT/ClassificationModules/GMM/../../ClusteringModules/GaussianMixtureModels/GaussianMixtureModels.h:132:18: note: initializing argument 1 of ‘virtual bool GRT::GaussianMixtureModels::load(std::fstream&)’ virtual bool load( std::fstream &file ) ; ^~~~ [ 73%] Linking CXX executable GaussianMixtureModelsExample c++: error: CMakeFiles/GaussianMixtureModelsExample.dir/home/username/grt/examples/ClusteringModulesExamples/GaussianMixtureModelsExample/GaussianMixtureModelsExample.cpp.o: No such file or directory Copying GaussianMixtureModelsExample to examples directory Error copying file "/home/username/grt/build/tmp/GaussianMixtureModelsExample" to "/home/username/grt/build/examples/GaussianMixtureModelsExample".

When I run make -i -k, I see that later on, the same problem occurs for the ClusterTreeExample. Any advice?

jamiebullock commented 4 years ago

This issue is fixed in pull request #165