amirsaffari / online-multiclass-lpboost

Online Multi-Class LPBoost and Gradient Boosting
http://www.ymer.org/amir/software/online-multiclass-lpboost/
MIT License
66 stars 33 forks source link

errors in "make" #2

Open yu15129214430 opened 8 years ago

yu15129214430 commented 8 years ago

src/utilities.h: In function ‘double randDouble()’: src/utilities.h:48:47: error: ‘getpid’ was not declared in this scope srand(TV.tv_sec * TV.tv_usec + getpid() + getDevRandom()); ^ Makefile:31: recipe for target 'src/online_rf.o' failed make: *\ [src/online_rf.o] Error 1 even I installed eigen2 and libconfig-1.5.

amirsaffari commented 8 years ago

I believe you need to look for getpid in your platform and check which header has it. This is unrelated to eigen and libconfig.

Alternatively, remove the getpid() from that line.

yu15129214430 commented 8 years ago

Thank you for your reply. I have added

include <unistd.h>

to utilities.h. But ,there are more problems in here : src/hyperparameters.o:在函‘Hyperparameters::Hyperparameters(std::__cxx11::basic_string<char, std::chartraits, std::allocator > const&)’中: hyperparameters.cpp:(.text+0xe5):对‘libconfig::Config::Config()’未定义的引用 hyperparameters.cpp:(.text+0xef):对‘libconfig::Config::readFile(char const)’未定义的引用 hyperparameters.cpp:(.text+0xfc):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x104):对‘libconfig::Setting::operator int() const’未定义的引用 hyperparameters.cpp:(.text+0x114):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x11c):对‘libconfig::Setting::operator int() const’未定义的引用 hyperparameters.cpp:(.text+0x12b):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x133):对‘libconfig::Setting::operator int() const’未定义的引用 hyperparameters.cpp:(.text+0x143):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x14b):对‘libconfig::Setting::operator int() const’未定义的引用 hyperparameters.cpp:(.text+0x15b):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x163):对‘libconfig::Setting::operator double() const’未定义的引用 hyperparameters.cpp:(.text+0x173):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x17b):对‘libconfig::Setting::operator int() const’未定义的引用 hyperparameters.cpp:(.text+0x18b):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x193):对‘libconfig::Setting::operator int() const’未定义的引用 hyperparameters.cpp:(.text+0x1a3):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x1ab):对‘libconfig::Setting::operator double() const’未定义的引用 hyperparameters.cpp:(.text+0x1bb):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x1c3):对‘libconfig::Setting::operator int() const’未定义的引用 hyperparameters.cpp:(.text+0x1d3):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x1db):对‘libconfig::Setting::operator double() const’未定义的引用 hyperparameters.cpp:(.text+0x1eb):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x1f3):对‘libconfig::Setting::operator int() const’未定义的引用 hyperparameters.cpp:(.text+0x203):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x20b):对‘libconfig::Setting::operator double() const’未定义的引用 hyperparameters.cpp:(.text+0x21b):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x223):对‘libconfig::Setting::operator double() const’未定义的引用 hyperparameters.cpp:(.text+0x233):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x23b):对‘libconfig::Setting::operator double() const’未定义的引用 hyperparameters.cpp:(.text+0x24b):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x253):对‘libconfig::Setting::operator double() const’未定义的引用 hyperparameters.cpp:(.text+0x263):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x26b):对‘libconfig::Setting::operator int() const’未定义的引用 hyperparameters.cpp:(.text+0x27b):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x283):对‘libconfig::Setting::operator int() const’未定义的引用 hyperparameters.cpp:(.text+0x293):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x29b):对‘libconfig::Setting::operator int() const’未定义的引用 hyperparameters.cpp:(.text+0x2ab):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x2b3):对‘libconfig::Setting::operator char const() const’未定义的引用 hyperparameters.cpp:(.text+0x2dd):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x2e5):对‘libconfig::Setting::operator char const() const’未定义的引用 hyperparameters.cpp:(.text+0x312):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x31a):对‘libconfig::Setting::operator char const() const’未定义的引用 hyperparameters.cpp:(.text+0x34a):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x352):对‘libconfig::Setting::operator char const() const’未定义的引用 hyperparameters.cpp:(.text+0x382):对‘libconfig::Config::lookup(char const) const’未定义的引用 hyperparameters.cpp:(.text+0x38a):对‘libconfig::Setting::operator char const() const’未定义的引用 hyperparameters.cpp:(.text+0x3ba):对‘libconfig::Config::lookup(char const_) const’未定义的引用 hyperparameters.cpp:(.text+0x3c2):对‘libconfig::Setting::operator int() const’未定义的引用 hyperparameters.cpp:(.text+0x419):对‘libconfig::Config::~Config()’未定义的引用 hyperparameters.cpp:(.text+0x479):对‘libconfig::Config::~Config()’未定义的引用 collect2: error: ld returned 1 exit status Makefile:28: recipe for target 'OMCBoost' failed make: *\ [OMCBoost] Error 1

what's wrong? thanks for you time

amirsaffari commented 8 years ago

I think the linker is not able to find libconfig. Make sure that you install the correct version of the libconfig .

yu15129214430 commented 8 years ago

So, where should I install the libconfig to a correct linker? Thank you.

StatML commented 7 years ago

Hi @amirsaffari I met the same libconfig++ linking errors. Specifying the path (/usr/lib/x86_64-linux-gnu) of libconfig++.so in Makefile does not help. I am using Ubuntu 16.04.4, G++ 5.4.0, libconfig++ 9.2.0

admfisher14 commented 6 years ago

Move the reference to the library to the end of the line in the make file e.g move -libconf++ to the end of the line it is in

RuixiangMa commented 6 years ago

I also suffer from the same problem, it is as follow: Makefile:28: recipe for target 'OMCBoost' failed make: *** [OMCBoost] Error 1 The version of Libconfig is 1.4.4, it is consistent with the recommended version, can you give me a solution to this problem? Thanks!

hatemalamir commented 4 years ago

Thank you, @admfisher14 ! Worked!!