errors in "make"
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.
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.
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
I think the linker is not able to find libconfig. Make sure that you install the correct version of the libconfig .
So, where should I install the libconfig to a correct linker? Thank you.
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
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
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!
Thank you, @admfisher14 ! Worked!!