home › Forums › # Technical Support › Regarding Problem Running Example
- This topic has 4 replies, 3 voices, and was last updated 8 years, 6 months ago by
Juan Rada-Vilela (admin).
-
AuthorPosts
-
March 21, 2015 at 04:57 #1709
Unknown
MemberHello Juan,
First off, thanks for an amazing product. Things looked really great and I feel like I will be able to do some quite interesting stuff with your product. I just have a quick question tho.
I am trying to run the sample code for fuzzylite 3.1 from the google code repo’s wiki and I get the following error.
/tmp/cchDy11d.o: In function `main’:
sample.cpp:(.text+0x4e): undefined reference to `fl::Engine::Engine(std::string const&)’
sample.cpp:(.text+0x244): undefined reference to `fl::InputVariable::InputVariable(std::string const&, double, double)’
sample.cpp:(.text+0x347): undefined reference to `fl::Triangle::Triangle(std::string const&, double, double, double)’
sample.cpp:(.text+0x3db): undefined reference to `fl::Triangle::Triangle(std::string const&, double, double, double)’
sample.cpp:(.text+0x46b): undefined reference to `fl::Triangle::Triangle(std::string const&, double, double, double)’
sample.cpp:(.text+0x512): undefined reference to `fl::OutputVariable::OutputVariable(std::string const&, double, double, bool)’
sample.cpp:(.text+0x629): undefined reference to `fl::Centroid::Centroid(int)’
sample.cpp:(.text+0x6dd): undefined reference to `fl::Triangle::Triangle(std::string const&, double, double, double)’
sample.cpp:(.text+0x771): undefined reference to `fl::Triangle::Triangle(std::string const&, double, double, double)’
sample.cpp:(.text+0x801): undefined reference to `fl::Triangle::Triangle(std::string const&, double, double, double)’
sample.cpp:(.text+0x888): undefined reference to `fl::RuleBlock::RuleBlock(std::string const&)’
sample.cpp:(.text+0x9d1): undefined reference to `fl::FuzzyRule::parse(std::string const&, fl::Engine const*)’
sample.cpp:(.text+0xa3d): undefined reference to `fl::FuzzyRule::parse(std::string const&, fl::Engine const*)’
sample.cpp:(.text+0xaa9): undefined reference to `fl::FuzzyRule::parse(std::string const&, fl::Engine const*)’
/tmp/cchDy11d.o: In function `fl::Any::Any()’:
sample.cpp:(.text._ZN2fl3AnyC2Ev[_ZN2fl3AnyC5Ev]+0x16): undefined reference to `vtable for fl::Any’
/tmp/cchDy11d.o: In function `fl::Extremely::Extremely()’:
sample.cpp:(.text._ZN2fl9ExtremelyC2Ev[_ZN2fl9ExtremelyC5Ev]+0x16): undefined reference to `vtable for fl::Extremely’
/tmp/cchDy11d.o: In function `fl::Not::Not()’:
sample.cpp:(.text._ZN2fl3NotC2Ev[_ZN2fl3NotC5Ev]+0x16): undefined reference to `vtable for fl::Not’
/tmp/cchDy11d.o: In function `fl::Seldom::Seldom()’:
sample.cpp:(.text._ZN2fl6SeldomC2Ev[_ZN2fl6SeldomC5Ev]+0x16): undefined reference to `vtable for fl::Seldom’
/tmp/cchDy11d.o: In function `fl::Somewhat::Somewhat()’:
sample.cpp:(.text._ZN2fl8SomewhatC2Ev[_ZN2fl8SomewhatC5Ev]+0x16): undefined reference to `vtable for fl::Somewhat’
/tmp/cchDy11d.o: In function `fl::Very::Very()’:
sample.cpp:(.text._ZN2fl4VeryC2Ev[_ZN2fl4VeryC5Ev]+0x16): undefined reference to `vtable for fl::Very’
/tmp/cchDy11d.o: In function `fl::Maximum::Maximum()’:
sample.cpp:(.text._ZN2fl7MaximumC2Ev[_ZN2fl7MaximumC5Ev]+0x16): undefined reference to `vtable for fl::Maximum’
/tmp/cchDy11d.o: In function `fl::Minimum::Minimum()’:
sample.cpp:(.text._ZN2fl7MinimumC2Ev[_ZN2fl7MinimumC5Ev]+0x16): undefined reference to `vtable for fl::Minimum’
collect2: error: ld returned 1 exit status
[Finished in 0.6s with exit code 1]I’ve been trying to fix it, but am shallow in my understanding of programming fix it on the fly and have struggled for quite a bit of time now. I was wondering if you experienced this before or have any suggestions on how to possibly fix this.
Thanks!
March 23, 2015 at 10:28 #1710Juan Rada-Vilela (admin)
KeymasterHi,
thank you for your post.
It seems that you may have built (and maybe installed) fuzzylite using floats instead of doubles, that is, with compiler option
-DFL_USE_FLOAT
.You have to make sure that the library you are linking against is built without
-DFL_USE_FLOAT
. Moreover, please check if you have installed fuzzylite in your system (e.g./usr/local/[include|lib]/
), that is, if at some point you didsudo make install
fuzzylite.If you are going to be using floats instead of doubles, then you have to pass the compiler option
-DFL_USE_FLOAT
to your project too because you#include <fl/Headers.h>
.Let me know if this helps.
Cheers.
May 14, 2015 at 16:50 #1808Unknown
MemberHello Ruan, I have the same issue using fuzzylite 4.0… how can I set the option -DFL_USE_FLOAT during installation?
May 14, 2015 at 17:45 #1809Unknown
Member[UPDATE] So, i managed to install v5.0 and now I’m using it… but the same problem still remains.
In my case I am using float in my c++ program but when I tried to modify the CMakeFile line 15 to:
option(FL_USE_FLOAT “Use fl::scalar as float” ON)
it keeps building the library with -FL_USE_FLOAT=OFFany solution?
May 14, 2015 at 18:11 #1810Juan Rada-Vilela (admin)
KeymasterHi,
Modifying the
CMakeLists.txt
will not change the flag. You need to pass-DFL_USE_FLOAT=ON
to CMake on command line.For example,
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFL_BACKTRACE=ON -DFL_USE_FLOAT=ON -DFL_CPP11=ON
Or if you are using
build.sh|bat
, please modify such lines accordingly.Let me know if you make it work.
For more information, please visit: http://fuzzylite.com/cpp/#Advanced_building_options
Cheers.
-
AuthorPosts
- You must be logged in to reply to this topic.