online-multiclass-lpboost icon indicating copy to clipboard operation
online-multiclass-lpboost copied to clipboard

errors in "make"

Open yu15129214430 opened this issue 8 years ago • 8 comments

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.

yu15129214430 avatar Jun 27 '16 04:06 yu15129214430

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.

amirsaffari avatar Jun 27 '16 08:06 amirsaffari

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::char_traits, 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

yu15129214430 avatar Jun 28 '16 03:06 yu15129214430

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

amirsaffari avatar Jun 28 '16 08:06 amirsaffari

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

yu15129214430 avatar Sep 13 '16 06:09 yu15129214430

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

StatML avatar Aug 07 '17 15:08 StatML

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

admfisher14 avatar Apr 27 '18 07:04 admfisher14

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!

RuixiangMa avatar Oct 16 '18 15:10 RuixiangMa

Thank you, @admfisher14 ! Worked!!

hatemalamir avatar May 18 '20 21:05 hatemalamir