Bitcoin core libbitcoin_server_a-httpserver.o Error - c++

I'm trying to install a custom fork of bitcoin core from HERE And when compiling, I get the following error:
I have installed all the prerequisites i think
Making all in src
make[1]: Entering directory '/home/muhammad/Programs/SimorghCoin/src'
make[2]: Entering directory '/home/muhammad/Programs/SimorghCoin/src'
CXX bitcoind-bitcoind.o
CXX libbitcoin_server_a-addrdb.o
CXX libbitcoin_server_a-addrman.o
CXX libbitcoin_server_a-bloom.o
CXX libbitcoin_server_a-blockencodings.o
CXX libbitcoin_server_a-blockfilter.o
CXX libbitcoin_server_a-chain.o
CXX libbitcoin_server_a-checkpoints.o
CXX consensus/libbitcoin_server_a-tx_verify.o
CXX libbitcoin_server_a-httprpc.o
CXX libbitcoin_server_a-httpserver.o
httpserver.cpp:74:10: error: ‘deque’ in namespace ‘std’ does not name a template type
74 | std::deque<std::unique_ptr<WorkItem>> queue;
| ^~~~~
httpserver.cpp:33:1: note: ‘std::deque’ is defined in header ‘<deque>’; did you forget to ‘#include <deque>’?
32 | #include <support/events.h>
+++ |+#include <deque>
33 |
httpserver.cpp: In member function ‘bool WorkQueue<WorkItem>::Enqueue(WorkItem*)’:
httpserver.cpp:92:13: error: ‘queue’ was not declared in this scope; did you mean ‘Enqueue’?
92 | if (queue.size() >= maxDepth) {
| ^~~~~
| Enqueue
httpserver.cpp:95:9: error: ‘queue’ was not declared in this scope; did you mean ‘Enqueue’?
95 | queue.emplace_back(std::unique_ptr<WorkItem>(item));
| ^~~~~
| Enqueue
httpserver.cpp: In member function ‘void WorkQueue<WorkItem>::Run()’:
httpserver.cpp:106:35: error: ‘queue’ was not declared in this scope; did you mean ‘Enqueue’?
106 | while (running && queue.empty())
| ^~~~~
| Enqueue
httpserver.cpp:110:31: error: ‘queue’ was not declared in this scope; did you mean ‘Enqueue’?
110 | i = std::move(queue.front());
| ^~~~~
| Enqueue
make[2]: *** [Makefile:6520: libbitcoin_server_a-httpserver.o] Error 1
make[2]: Leaving directory '/home/muhammad/Programs/SimorghCoin/src'
make[1]: *** [Makefile:10888: all-recursive] Error 1
make[1]: Leaving directory '/home/muhammad/Programs/SimorghCoin/src'
make: *** [Makefile:774: all-recursive] Error 1
and this is my configuration:
Options used to compile and link:
with wallet = yes
with gui / qt = no
with zmq = yes
with test = yes
with bench = yes
with upnp = auto
use asm = yes
sanitizers =
debug enabled = no
gprof enabled = no
werror = no
target os = linux
build os =
My OS is Manjaro 20.0.3 Lysia and i use gcc (GCC) 10.1.0.
Can anyone help me?

The include for deque is missing in /home/muhammad/Programs/SimorghCoin/src/httpserver.cpp. You can add a line
#include <deque>
after line 32.

Related

Node addon module with OpenCV4 C++

I am trying to reuse my C++ (OpenCV 4) program in my web app. To do that I am trying to compile a very basic C++ OpenCV code which just returns the version of the OpenCV. But I am facing some compilation issues shown below.
For reference here is my code repository: https://github.com/KishoreKaushal/nodeopencv
Given below is my code which I want to compile as a node add-on module.
#include <node.h>
#include <bits/stdc++.h>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
void print_opencv_version(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate();
string s = "OpenCV version : ";
s += CV_VERSION ;
v8::Local<v8::String> version =
v8::String::NewFromUtf8(isolate, s.c_str(), v8::String::kNormalString);
args.GetReturnValue().Set(version);
}
void Sum(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate();
double a = 3.14159, b = 2.718;
for (int i = 0; i < 100000; ++i) {
a += b;
}
auto total = v8::Number::New(isolate, a);
args.GetReturnValue().Set(total);
}
// this exports your custom function just like your module.exports in JS
void Initialize(v8::Local<v8::Object> exports) {
NODE_SET_METHOD(exports, "sum", Sum);
NODE_SET_METHOD(exports, "print_opencv_version", print_opencv_version);
}
NODE_MODULE(addon, Initialize)
This is my binding.gyp file:
{
"targets" : [
{
"target_name" : "addon",
"cflags" : ["`pkg-config --cflags opencv4`", '-std=c++11'],
"link_settings" : {
"libraries" : ["`pkg-config --libs opencv4`"]
},
"sources" : ["addon.cc"]
}
]
}
And I am compiling it using this command: node-gyp clean configure build --verbose
And I am getting the following error:
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/kaushal/Documents/git/nodeopencv/build'
g++ -o Release/obj.target/addon/addon.o ../addon.cc '-DNODE_GYP_MODULE_NAME=addon' '-DUSING_UV_SHARED=1'
'-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS'
'-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS'
'-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/home/kaushal/.cache/node-gyp/12.18.2/include/node -I/home/kaushal/.cache/node-gyp/12.18.2/src -I/home/kaushal/.cache/node-gyp/12.18.2/deps/openssl/config
-I/home/kaushal/.cache/node-gyp/12.18.2/deps/openssl/openssl/include -I/home/kaushal/.cache/node-gyp/12.18.2/deps/uv/include
-I/home/kaushal/.cache/node-gyp/12.18.2/deps/zlib -I/home/kaushal/.cache/node-gyp/12.18.2/deps/v8/include
-fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 `pkg-config --cflags opencv4` -std=c++11 -O3
-fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF ./Release/.deps/Release/obj.target/addon/addon.o.d.raw -c
In file included from /usr/local/include/opencv4/opencv2/flann/params.h:35,
from /usr/local/include/opencv4/opencv2/flann/flann_base.hpp:42,
from /usr/local/include/opencv4/opencv2/flann.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:65,
from ../addon.cc:10:
/usr/local/include/opencv4/opencv2/flann/any.h: In member function ‘virtual const std::type_info& cvflann::anyimpl::typed_base_any_policy<T>::type()’:
/usr/local/include/opencv4/opencv2/flann/any.h:60:71: error: cannot use ‘typeid’ with ‘-fno-rtti’
60 | virtual const std::type_info& type() CV_OVERRIDE { return typeid(T); }
| ^
/usr/local/include/opencv4/opencv2/flann/any.h: In member function ‘T& cvflann::any::cast()’:
/usr/local/include/opencv4/opencv2/flann/any.h:276:39: error: cannot use ‘typeid’ with ‘-fno-rtti’
276 | if (policy->type() != typeid(T)) throw anyimpl::bad_any_cast();
| ^
/usr/local/include/opencv4/opencv2/flann/any.h: In member function ‘const T& cvflann::any::cast() const’:
/usr/local/include/opencv4/opencv2/flann/any.h:285:39: error: cannot use ‘typeid’ with ‘-fno-rtti’
285 | if (policy->type() != typeid(T)) throw anyimpl::bad_any_cast();
| ^
/usr/local/include/opencv4/opencv2/flann/any.h: In member function ‘bool cvflann::any::empty() const’:
/usr/local/include/opencv4/opencv2/flann/any.h:293:59: error: cannot use ‘typeid’ with ‘-fno-rtti’
293 | return policy->type() == typeid(anyimpl::empty_any);
| ^
/usr/local/include/opencv4/opencv2/flann/any.h: In member function ‘bool cvflann::any::has_type()’:
/usr/local/include/opencv4/opencv2/flann/any.h:313:42: error: cannot use ‘typeid’ with ‘-fno-rtti’
313 | return policy->type() == typeid(T);
| ^
In file included from /usr/local/include/opencv4/opencv2/flann/flann_base.hpp:43,
from /usr/local/include/opencv4/opencv2/flann.hpp:48,
from /usr/local/include/opencv4/opencv2/opencv.hpp:65,
from ../addon.cc:10:
/usr/local/include/opencv4/opencv2/flann/saving.h: In function ‘cvflann::IndexHeader cvflann::load_header(FILE*)’:
/usr/local/include/opencv4/opencv2/flann/saving.h:115:63: error: exception handling disabled, use ‘-fexceptions’ to enable
115 | throw FLANNException("Invalid index file, cannot read");
| ^
../addon.cc: In function ‘void print_opencv_version(const v8::FunctionCallbackInfo<v8::Value>&)’:
../addon.cc:22:82: warning: ‘static v8::Local<v8::String> v8::String::NewFromUtf8(v8::Isolate*, const char*, v8::String::NewStringType, int)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
22 | v8::String::NewFromUtf8(isolate, s.c_str(), v8::String::kNormalString);
| ^
In file included from /home/kaushal/.cache/node-gyp/12.18.2/include/node/v8-internal.h:14,
from /home/kaushal/.cache/node-gyp/12.18.2/include/node/v8.h:27,
from /home/kaushal/.cache/node-gyp/12.18.2/include/node/node.h:67,
from ../addon.cc:8:
/home/kaushal/.cache/node-gyp/12.18.2/include/node/v8.h:3032:21: note: declared here
3032 | Local<String> NewFromUtf8(Isolate* isolate, const char* data,
| ^~~~~~~~~~~
/home/kaushal/.cache/node-gyp/12.18.2/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
328 | declarator __attribute__((deprecated(message)))
| ^~~~~~~~~~
../addon.cc:22:82: warning: ‘static v8::Local<v8::String> v8::String::NewFromUtf8(v8::Isolate*, const char*, v8::String::NewStringType, int)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
22 | v8::String::NewFromUtf8(isolate, s.c_str(), v8::String::kNormalString);
| ^
In file included from /home/kaushal/.cache/node-gyp/12.18.2/include/node/v8-internal.h:14,
from /home/kaushal/.cache/node-gyp/12.18.2/include/node/v8.h:27,
from /home/kaushal/.cache/node-gyp/12.18.2/include/node/node.h:67,
from ../addon.cc:8:
/home/kaushal/.cache/node-gyp/12.18.2/include/node/v8.h:3032:21: note: declared here
3032 | Local<String> NewFromUtf8(Isolate* isolate, const char* data,
| ^~~~~~~~~~~
/home/kaushal/.cache/node-gyp/12.18.2/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
328 | declarator __attribute__((deprecated(message)))
| ^~~~~~~~~~
In file included from ../addon.cc:8:
../addon.cc: At global scope:
/home/kaushal/.cache/node-gyp/12.18.2/include/node/node.h:608:43: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
608 | (node::addon_register_func) (regfunc), \
| ^
/home/kaushal/.cache/node-gyp/12.18.2/include/node/node.h:642:3: note: in expansion of macro ‘NODE_MODULE_X’
642 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
| ^~~~~~~~~~~~~
../addon.cc:49:1: note: in expansion of macro ‘NODE_MODULE’
49 | NODE_MODULE(addon, Initialize)
| ^~~~~~~~~~~
make: *** [addon.target.mk:113: Release/obj.target/addon/addon.o] Error 1
make: Leaving directory '/home/kaushal/Documents/git/nodeopencv/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.4.0-40-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "clean" "configure" "build" "--verbose"
gyp ERR! cwd /home/kaushal/Documents/git/nodeopencv
gyp ERR! node -v v12.18.2
gyp ERR! node-gyp -v v7.0.0
gyp ERR! not ok
Looks like there is some error related to -fno-rttii.
Does anyone have any idea of what is going on here?

Boost bootstrap throwing errors

Premise: I'm new to this. Anyway, I'm trying to bootstrap the boost library through the command bootstrap.bat mingw. As you guessed, I'm on windows 64-bit and using the MinGW toolchain. But when I run the command, the output is
Building Boost.Build engine
builtins.cpp: In function 'FILE* windows_popen_wrapper(const char*, const char*)':
builtins.cpp:2483:18: error: '_popen' was not declared in this scope; did you mean '_lopen'?
2483 | result = _popen( command, "r" );
| ^~~~~~
| _lopen
builtins.cpp: In function 'LIST* builtin_shell(FRAME*, int)':
builtins.cpp:2418:20: error: '_pclose' was not declared in this scope; did you mean '_lclose'?
2418 | #define pclose _pclose
| ^~~~~~~
builtins.cpp:2549:19: note: in expansion of macro 'pclose'
2549 | exit_status = pclose( p );
| ^~~~~~
debugger.cpp: In function 'char* debug_string_read(FILE*)':
debugger.cpp:110:14: error: 'strdup' was not declared in this scope; did you mean 'strcmp'?
110 | result = strdup( buf->value );
| ^~~~~~
| strcmp
debugger.cpp: In function 'void debug_init_handles(const char*, const char*)':
debugger.cpp:1073:21: error: '_fdopen' was not declared in this scope; did you mean '_wsopen'?
1073 | command_input = _fdopen( read_fd, "r" );
| ^~~~~~~
| _wsopen
debugger.cpp: In function 'void init_parent_handles(HANDLE, HANDLE)':
debugger.cpp:1091:21: error: '_fdopen' was not declared in this scope; did you mean '_wsopen'?
1091 | command_child = _fdopen( _open_osfhandle( (intptr_t)in, _O_RDONLY ), "r" );
| ^~~~~~~
| _wsopen
execnt.cpp: In function 'int is_parent_child(DWORD, DWORD)':
execnt.cpp:1085:23: error: 'stricmp' was not declared in this scope; did you mean 'strncmp'?
1085 | if ( !stricmp( pinfo.szExeFile, "csrss.exe" ) &&
| ^~~~~~~
| strncmp
execnt.cpp:1088:23: error: 'stricmp' was not declared in this scope; did you mean 'strncmp'?
1088 | if ( !stricmp( pinfo.szExeFile, "smss.exe" ) &&
| ^~~~~~~
| strncmp
jam.cpp: In function 'int main(int, char**, char**)':
jam.cpp:200:22: error: 'environ' was not declared in this scope; did you mean 'union'?
200 | # define use_environ environ
| ^~~~~~~
jam.cpp:561:37: note: in expansion of macro 'use_environ'
561 | var_defines( root_module(), use_environ, 1 );
| ^~~~~~~~~~~
jam.cpp: In function 'char* executable_path(const char*)':
jam.cpp:729:54: error: 'strdup' was not declared in this scope; did you mean 'strcmp'?
729 | return ( !ret || ret == sizeof( buf ) ) ? NULL : strdup( buf );
| ^~~~~~
| strcmp
sysinfo.cpp: In function 'unsigned int {anonymous}::std_thread_hardware_concurrency()':
sysinfo.cpp:93:21: error: 'std::thread' has not been declared
93 | return std::thread::hardware_concurrency();
| ^~~~~~
File Not Found
Failed to build Boost.Build engine.
Please consult bootstrap.log for further diagnostics.
Contents of bootstrap.log:
'###
'###Using 'mingw' toolset.
'###
C:\Users\lenerdv\Desktop\cpp\training\lib\boost_1_72_0\tools\build\src\engine>g++ -x c++ -std=c++11 -s -O3 -o b2.exe -DNDEBUG builtins.cpp class.cpp command.cpp compile.cpp constants.cpp cwd.cpp debug.cpp debugger.cpp execcmd.cpp execnt.cpp filent.cpp filesys.cpp frames.cpp function.cpp glob.cpp hash.cpp hcache.cpp hdrmacro.cpp headers.cpp jam.cpp jambase.cpp jamgram.cpp lists.cpp make.cpp make1.cpp md5.cpp mem.cpp modules.cpp native.cpp object.cpp option.cpp output.cpp parse.cpp pathnt.cpp pathsys.cpp regexp.cpp rules.cpp scan.cpp search.cpp strings.cpp subst.cpp sysinfo.cpp timestamp.cpp variable.cpp w32_getreg.cpp modules/order.cpp modules/path.cpp modules/property-set.cpp modules/regex.cpp modules/sequence.cpp modules/set.cpp
C:\Users\lenerdv\Desktop\cpp\training\lib\boost_1_72_0\tools\build\src\engine>dir *.exe
Volume in drive C is Windows
Volume Serial Number is 727E-472A
Directory of C:\Users\lenerdv\Desktop\cpp\training\lib\boost_1_72_0\tools\build\src\engine
C:\Users\lenerdv\Desktop\cpp\training\lib\boost_1_72_0\tools\build\src\engine>copy /b .\b2.exe .\bjam.exe
The system cannot find the file specified.
BTW, I'm following this tutorial
Download MinGW_w64 instead.
Looks like support for MinGW has dropped while boost has continued active. For latest versions of boost use MinGW_w64.
I removed MinGW path and added a new MinGW_64 containing the files from https://winlibs.com/#download-release in C:\MinGW_64 and added to PATH. Could build the b2.exe afterwards.

boost::python linking error (undefined reference to numpy::empty and numpy::detail::get_float_dtype<64>()) when using templates

I'm experiencing difficulties working with boost::python and boost::python::numpy, with python 2.7, boost 1.67.0, and Eigen3.3. My compiler is g++ (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0.
I'm trying to convert Eigen::Matrix types to python ndarray and back (vector_list.hpp):
#ifndef VECTOR_PYLIST_HH
#define VECTOR_PYLIST_HH
#include<iostream>
#include<vector>
#include<boost/python.hpp>
#include<Eigen/Dense>
#include<typeinfo>
#include<boost/python/numpy.hpp>
namespace myutil {
template<class T>
boost::python::list to_py_list(Eigen::Matrix<T, Eigen::Dynamic,Eigen::Dynamic> matrix)
{
boost::python::list list;
boost::python::list helplist;
if (matrix.cols() > 1) {
for (int j = 0; j < matrix.cols(); j++) {
helplist = to_py_list<T>(matrix.col(j));
list.append(helplist);
}
} else {
for (int i = 0; i < matrix.rows(); i++) {
list.append(matrix(i,0));
}
}
return list;
}
template<class T>
boost::python::numpy::ndarray to_py_array(Eigen::Matrix<T, Eigen::Dynamic,Eigen::Dynamic> matrix)
{
int cols = matrix.cols();
int rows = matrix.rows();
boost::python::tuple tu = boost::python::make_tuple(rows,cols);
boost::python::numpy::dtype dtype = boost::python::numpy::dtype::get_builtin<T>();
boost::python::numpy::ndarray arr = boost::python::numpy::empty(tu, dtype);
for (int i; i < rows; i++) {
for (int j = 0; j < cols; j++) {
arr[i][j] = matrix(i,j);
}
}
return arr;
}
#endif
My test programme (eigen_ndarray_eigen.cpp) looks as follows:
#include<vector_list.hpp>
#include<iostream>
#include<typeinfo>
int main()
{
Py_Initialize();
np::initialize();
Eigen::Matrix<double,3,2> m;
m << 1,2,3,4,5,6;
std::cout<<m<<std::endl;
boost::python::numpy::ndarray l = myutil::to_py_array<double>(m);
Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> n = myutil::to_eigen<double>(l);
std::cout<<n<<std::endl;
return 0;
}
And my CMakeLists.txt:
cmake_minimum_required(VERSION 2.8)
project(myutil)
set(CMAKE_BUILD_TYPE "Debug")
set(BOOST_ROOT "$ENV{BOOST_ROOT}")
find_package(PythonLibs 2.7 REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
find_package(Boost 1.61.0 COMPONENTS python REQUIRED)
find_package(Eigen3 3.3 REQUIRED NO_MODULE)
include_directories(${Boost_INCLUDE_DIR} include)
add_executable(test_eigen_ndarray_eigen test/eigen_ndarray_eigen.cpp)
target_link_libraries(test_eigen_ndarray_eigen Eigen3::Eigen ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
I get an error when compiling:
[ 50%] Building CXX object CMakeFiles/test_eigen_ndarray_eigen.dir/test/eigen_ndarray_eigen.cpp.o
[100%] Linking CXX executable test_eigen_ndarray_eigen
CMakeFiles/test_eigen_ndarray_eigen.dir/test/eigen_ndarray_eigen.cpp.o:In function `boost::python::numpy::ndarray myutil::to_py_array<double>(Eigen::Matrix<double, -1, -1, 0, -1, -1>)':
/home/usr/devel/myutil/include/vector_list.hpp:70: undefined reference to `boost::python::numpy::empty(boost::python::tuple const&, boost::python::numpy::dtype const&)'
CMakeFiles/test_eigen_ndarray_eigen.dir/test/eigen_ndarray_eigen.cpp.o: In function `boost::python::numpy::detail::builtin_dtype<double, false>::get()':
/usr/include/boost/python/numpy/dtype.hpp:98: undefined reference to `boost::python::numpy::dtype boost::python::numpy::detail::get_float_dtype<64>()'
collect2: error: ld returned 1 exit status
CMakeFiles/test_eigen_ndarray_eigen.dir/build.make:96: recipe for target 'test_eigen_ndarray_eigen' failed
make[2]: *** [test_eigen_ndarray_eigen] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/test_eigen_ndarray_eigen.dir/all' failed
make[1]: *** [CMakeFiles/test_eigen_ndarray_eigen.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
It's clearly a linking problem but I am already linking my executable against all boost libraries, and I can't figure out what might be wrong. Has anyone experienced something similar? Any tips?
Thanks for your input.
Edit: I was asked for the full error message when compiled with VERBOSE=1:
/usr/bin/cmake -H/home/usr/devel/myutil -B/home/usr/devel/myutil/build --check-build-system CMakeFiles/Makefile.cmake 1
/usr/bin/cmake -E cmake_progress_start /home/usr/devel/myutil/build/CMakeFiles /home/usr/devel/myutil/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/usr/devel/myutil/build'
make -f CMakeFiles/test_eigen_ndarray_eigen.dir/build.make CMakeFiles/test_eigen_ndarray_eigen.dir/depend
make[2]: Entering directory '/home/usr/devel/myutil/build'
cd /home/usr/devel/myutil/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/usr/devel/myutil /home/usr/devel/myutil /home/usr/devel/myutil/build /home/usr/devel/myutil/build /home/usr/devel/myutil/build/CMakeFiles/test_eigen_ndarray_eigen.dir/DependInfo.cmake --color=
Dependee "../include/vector_list.hpp" is newer than depender "CMakeFiles/test_eigen_ndarray_eigen.dir/test/eigen_ndarray_eigen.cpp.o".
Clearing dependencies in "/home/usr/devel/myutil/build/CMakeFiles/test_eigen_ndarray_eigen.dir/depend.make".
Scanning dependencies of target test_eigen_ndarray_eigen
make[2]: Leaving directory '/home/usr/devel/myutil/build'
make -f CMakeFiles/test_eigen_ndarray_eigen.dir/build.make CMakeFiles/test_eigen_ndarray_eigen.dir/build
make[2]: Entering directory '/home/usr/devel/myutil/build'
[ 50%] Building CXX object CMakeFiles/test_eigen_ndarray_eigen.dir/test/eigen_ndarray_eigen.cpp.o
/usr/bin/c++ -I/usr/include/python2.7 -I/home/usr/devel/myutil/include -isystem /home/usr/devel/src/eigen-git-mirror -g -o CMakeFiles/test_eigen_ndarray_eigen.dir/test/eigen_ndarray_eigen.cpp.o -c /home/usr/devel/myutil/test/eigen_ndarray_eigen.cpp
[100%] Linking CXX executable test_eigen_ndarray_eigen
/usr/bin/cmake -E cmake_link_script CMakeFiles/test_eigen_ndarray_eigen.dir/link.txt --verbose=1
/usr/bin/c++ -g CMakeFiles/test_eigen_ndarray_eigen.dir/test/eigen_ndarray_eigen.cpp.o -o test_eigen_ndarray_eigen -rdynamic -lboost_python -lpython2.7
CMakeFiles/test_eigen_ndarray_eigen.dir/test/eigen_ndarray_eigen.cpp.o: In function `boost::python::numpy::ndarray myutil::to_py_array<double>(Eigen::Matrix<double, -1, -1, 0, -1, -1>)':
/home/usr/devel/myutil/include/vector_list.hpp:70: undefined reference to `boost::python::numpy::empty(boost::python::tuple const&, boost::python::numpy::dtype const&)'
CMakeFiles/test_eigen_ndarray_eigen.dir/test/eigen_ndarray_eigen.cpp.o: In function `boost::python::numpy::detail::builtin_dtype<double, false>::get()':
/usr/include/boost/python/numpy/dtype.hpp:98: undefined reference to `boost::python::numpy::dtype boost::python::numpy::detail::get_float_dtype<64>()'
collect2: error: ld returned 1 exit status
CMakeFiles/test_eigen_ndarray_eigen.dir/build.make:96: recipe for target 'test_eigen_ndarray_eigen' failed
make[2]: *** [test_eigen_ndarray_eigen] Error 1
make[2]: Leaving directory '/home/usr/devel/myutil/build'
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/test_eigen_ndarray_eigen.dir/all' failed
make[1]: *** [CMakeFiles/test_eigen_ndarray_eigen.dir/all] Error 2
make[1]: Leaving directory '/home/usr/devel/myutil/build'
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
`'
I checked some answers regarding similar problems (here). Apparently boost_numpy doesn't call the right libraries automatically and sometimes you have to include them manually:
#define BOOST_LIB_NAME "boost_numpy"
#include <boost/config/auto_link.hpp>
I tried this but it didn't work for me...

Connecting OpenCV with netbeans 7.3.1

I'm trying to use OpenCV with Netbeans 7.3.1. I have tried following the various tutorials and blogs but cannot run any of the files. The following code was listed as good example code to check the opencv installation:
#include <cstdlib>
using namespace std;
#include "opencv.hpp"
#include "opencv_modules.hpp"
int main ( int argc, char **argv ) {
cvNamedWindow( "My Window", 1 );
IplImage *img = cvCreateImage( cvSize( 640, 480 ), IPL_DEPTH_8U, 1 );
CvFont font;
double hScale = 1.0;
double vScale = 1.0;
int lineWidth = 1;
cvInitFont( &font, CV_FONT_HERSHEY_SIMPLEX | CV_FONT_ITALIC, hScale, vScale, 0, lineWidth );
cvPutText( img, "Hello World!, I can now code openCV ", cvPoint( 0, 200 ), &font, Scalar
(255, 255, 0 ) );
cvPutText( img, "in a kickass IDE ", cvPoint( 150, 300 ), &font, cvScalar( 255, 255, 0 ) );
cvShowImage( "My Window", img );
cvWaitKey();
return 0;
}
The code results in the following error:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory /cygdrive/c/Users/Daniel/Documents/NetBeansProjects/CppApplication_4'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_1-Windows/cppapplication_4.exe
make[2]: Entering directory/cygdrive/c/Users/Daniel/Documents/NetBeansProjects/CppApplication_4'
mkdir -p build/Debug/Cygwin_1-Windows
rm -f build/Debug/Cygwin_1-Windows/main.o.d
g++ -c -g -I../../../../../Program\ Files/OpenCV/build/include/opencv2 -MMD -MP -MF build/Debug/Cygwin_1-Windows/main.o.d -o build/Debug/Cygwin_1-Windows/main.o main.cpp
In file included from main.cpp:11:
../../../../../Program Files/OpenCV/build/include/opencv2/opencv.hpp:46:33: opencv2/core/core_c.h: No such file or directory
../../../../../Program Files/OpenCV/build/include/opencv2/opencv.hpp:47:33: opencv2/core/core.hpp: No such file or directory
../../../../../Program Files/OpenCV/build/include/opencv2/opencv.hpp:48:39: opencv2/flann/miniflann.hpp: No such file or directory
../../../../../Program Files/OpenCV/build/include/opencv2/opencv.hpp:49:39: opencv2/imgproc/imgproc_c.h: No such file or directory
../../../../../Program Files/OpenCV/build/include/opencv2/opencv.hpp:50:39: opencv2/imgproc/imgproc.hpp: No such file or directory
../../../../../Program Files/OpenCV/build/include/opencv2/opencv.hpp:51:35: opencv2/photo/photo.hpp: No such file or directory
../../../../../Program Files/OpenCV/build/include/opencv2/opencv.hpp:52:35: opencv2/video/video.hpp: No such file or directory
../../../../../Program Files/OpenCV/build/include/opencv2/opencv.hpp:53:45: opencv2/features2d/features2d.hpp: No such file or directory
../../../../../Program Files/OpenCV/build/include/opencv2/opencv.hpp:54:43: opencv2/objdetect/objdetect.hpp: No such file or directory
../../../../../Program Files/OpenCV/build/include/opencv2/opencv.hpp:55:39: opencv2/calib3d/calib3d.hpp: No such file or directory
../../../../../Program Files/OpenCV/build/include/opencv2/opencv.hpp:56:29: opencv2/ml/ml.hpp: No such file or directory
../../../../../Program Files/OpenCV/build/include/opencv2/opencv.hpp:57:39: opencv2/highgui/highgui_c.h: No such file or directory
../../../../../Program Files/OpenCV/build/include/opencv2/opencv.hpp:58:39: opencv2/highgui/highgui.hpp: No such file or directory
../../../../../Program Files/OpenCV/build/include/opencv2/opencv.hpp:59:39: opencv2/contrib/contrib.hpp: No such file or directory
main.cpp: In function int main(int, char**)':
main.cpp:14: error:cvNamedWindow' undeclared (first use this function)
main.cpp:14: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:15: error: IplImage' undeclared (first use this function)
main.cpp:15: error:img' undeclared (first use this function)
main.cpp:15: error: cvSize' undeclared (first use this function)
main.cpp:15: error:IPL_DEPTH_8U' undeclared (first use this function)
main.cpp:15: error: cvCreateImage' undeclared (first use this function)
main.cpp:16: error:CvFont' undeclared (first use this function)
main.cpp:16: error: expected ;' before "font"
main.cpp:17: error:font' undeclared (first use this function)
main.cpp:17: error: CV_FONT_HERSHEY_SIMPLEX' undeclared (first use this function)
main.cpp:17: error:CV_FONT_ITALIC' undeclared (first use this function)
main.cpp:17: error: cvInitFont' undeclared (first use this function)
main.cpp:18: error:cvPoint' undeclared (first use this function)
main.cpp:18: error: cvScalar' undeclared (first use this function)
main.cpp:18: error:cvPutText' undeclared (first use this function)
main.cpp:20: error: cvShowImage' undeclared (first use this function)
main.cpp:21: error:cvWaitKey' undeclared (first use this function)
nbproject/Makefile-Debug.mk:86: recipe for target build/Debug/Cygwin_1-Windows/main.o' failed
make[2]: *** [build/Debug/Cygwin_1-Windows/main.o] Error 1
make[2]: Leaving directory/cygdrive/c/Users/Daniel/Documents/NetBeansProjects/CppApplication_4'
nbproject/Makefile-Debug.mk:59: recipe for target .build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory/cygdrive/c/Users/Daniel/Documents/NetBeansProjects/CppApplication_4'
nbproject/Makefile-impl.mk:39: recipe for target `.build-impl' failed
make: * [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
Could anyone help with providing a clear set of instructions or at least pointing to a concise guide?
Thanks,
Daniel
Assuming your include path contains C:\Program Files\OpenCV\include, and that the include files really are located there, replace
#include "opencv.hpp"
with
#include "opencv2/opencv.hpp"
You can probably do without #include "opencv_modules.hpp", otherwise it should be #include "opencv2/opencv_modules.hpp"

Programs configured to use dmalloc bail-out citing header file error

While trying to compile lynx, I used the 'with-dmalloc' configure option. But compilation aborted, producing this error:
/usr/include/dmalloc.h:460: error: expected identifier or '(' before '__extension__'
> /usr/include/dmalloc.h:484: error: expected identifier or '(' before '__extension__'
> make[1]: *** [HTParse.o] Error 1
> make[1]: Leaving directory `/tmp/lynx2-8-8/WWW/Library/Implementation'
> make: *** [all] Error 2
This is what the errant lines in dmalloc.h hold:
> Line 460: char *strdup(const char *string);
> Linu 484: char *strndup(const char *string, const DMALLOC_SIZE len);
The file can also be viewed at http://www.filewatcher.com/p/dmalloc-5.5.2.tbz.467309/include/dmalloc.h.html
Development on dmalloc has pretty much stopped, so not really expecting a fix from upstream. Any help?
I faced with the similar problem while installing dmalloc on Fedora 21 x86_64:
dmalloc-5.5.2]$ make
rm -f dmalloc.h dmalloc.h.t
cat ./dmalloc.h.1 dmalloc.h.2 ./dmalloc.h.3 > dmalloc.h.t
mv dmalloc.h.t dmalloc.h
rm -f arg_check.o
gcc -g -O2 -DHAVE_STDARG_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 - DHAVE_UNISTD_H=1 -DHAVE_SYS_MMAN_H=1 -DHAVE_SYS_TYPES_H=1 - DHAVE_W32API_WINBASE_H=0 -DHAVE_W32API_WINDEF_H=0 -DHAVE_SYS_CYGWIN_H=0 - DHAVE_SIGNAL_H=1 -I. -I. -c arg_check.c -o ./arg_check.o
In file included from /usr/include/string.h:634:0,
from arg_check.c:33:
dmalloc.h:484:7: error: expected identifier or ‘(’ before ‘__extension__’
char *strndup(const char *string, const DMALLOC_SIZE len);
^
Makefile:362: recipe for target 'arg_check.o' failed
make: *** [arg_check.o] Error 1
Solved it by altering dmalloc-5.5.2/dmalloc.h.3:
- 432 | extern
- 433 | char *strndup(const char *string, const DMALLOC_SIZE len);
+ 432 | #undef strndup
+ 433 | extern
+ 434 | char *strndup(const char *string, const DMALLOC_SIZE len);
The source of wisdom: https://dev.openwrt.org/browser/packages/devel/dmalloc/patches/400-undef-strndup.patch?rev=31253
I encountered something like this and found that this was caused by the dmalloc.h was included before e.g. <unistd.h> et. al so that the macro identifiers from dmalloc.h mangled the declarations for the real valloc/realloc/memdup etc.
Could this be what you are seeing?