I need to use the Single Shot Multibox Detector implemented in Caffe. After cloning the repository, I've switched to the correct branch and I've installed all the dependencies required (by following the guide on caffe website). Unfortunately, when I compile at certain point I get this error:
.build_release/lib/libcaffe.so: undefined reference to "boost::re_detail_106200::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const"
But boost is installed. How can I resolve?
Add boost_regex to LIBRARIES variable in Makefile in case you use Makefile.config compilation, or to find_package(Boost 1.54 REQUIRED COMPONENTS system thread filesystem) line in caffe/cmake/Dependencies.cmake
Related
Im trying to compile my code with a new version of protobuf (currently it was compiled with custom version, and i would like to compile it with the version that comes with the ubuntu via apt-get)
in the project settings i'v added -lprotobuf
.obj/Test.pb.o: In function `test_ns::protobuf_AssignDesc_Test_2eproto()':
<<path to file>>/Test.pb.cc:115: undefined reference to `google::protobuf::DescriptorPool::FindFileByName(std::string const&) const'
the line with the error('Test.pb.cc'):
void protobuf_AssignDesc_Test_2eproto() {
protobuf_AddDesc_Test_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"Test.proto");
i can see that the error caused when trying to locate the file "Test.proto", but it exist in another directory, and it was used by the protoc command to generate Test.pb.cc and Test.pb.h files
Just fund the reason, the protobuff provided by the ubuntu compiled with different ABI, matching the ABI in our project fixed the issue
I'm trying to build the basemap toolkit, from source, for matplotlib to run on my MacBook Pro under OS X 10.8. The C and C++ compiler are those included with the latest Xcode package. The package includes the geos-3.3.3 package which needs to be built separately and installed before the main basemap python package is built. When I do this, using the supplied Makefile, I get the following error when the makefile attempts to build the libgeos.dylib library:
Undefined symbols for architecture x86_64:
"std::auto_ptr<geos::geom::Envelope>::auto_ptr(std::auto_ptr_ref<geos::geom::Envelope>)", referenced from:
virtual thunk to geos::geom::GeometryCollection::computeEnvelopeInternal() constin libgeom.a(GeometryCollection.o)
"__ZNSt8auto_ptrIN4geos4geom8EnvelopeEEcvSt12auto_ptr_refIT_EIS2_EEv", referenced from:
virtual thunk to geos::geom::GeometryCollection::computeEnvelopeInternal() constin libgeom.a(GeometryCollection.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
On a Fedora 17 machine, with gcc 4.7, this library builds successfully so there is obviously something going on with the Mac compiler/linker. However, I have no idea how to decode this message. What, for instance, is a "virtual thunk"? Any insight on how I can compile and build this on the Mac?
I used a different compiler and the problem went away. Try:
make CXX=c++
Worked for me. OSX 10.8.3, XCode 4.6.1.
I have the below in a Cmake file:
add_library(stasm STATIC IMPORTED)
set_property(TARGET stasm PROPERTY
IMPORTED_LOCATION /media/Data/sdks/stasm3.1/linux/libstasm.a)
target_link_libraries( StasmOpencvExample ${OpenCV_LIBS} stasm)
I generated the libstasm.a by doing:
How to create a static library with g++? , the first answer, taking all of the .o files from the linux folder and putting it into an archive.
but when i run make on my project i get:
Scanning dependencies of target StasmOpencvExample
[100%] Building CXX object CMakeFiles/StasmOpencvExample.dir/stasm_opencv_example.cpp.o
Linking CXX executable StasmOpencvExample
CMakeFiles/StasmOpencvExample.dir/stasm_opencv_example.cpp.o: In function `main':
stasm_opencv_example.cpp:(.text+0x9a): undefined reference to `AsmSearchDll(int*, int*, char const*, char const*, int, int, int, char const*, char const*)'
collect2: ld returned 1 exit status
has anyone gotten a cmake project to work with stasm on linux before? I also had to remove a n include "windows.h" from stasm_dll.cpp, and other windows specific code that wasn't properly done to allow working on linux.
I have already gotten the linux folder to generate the binaries and they work great, now I just need to incorporate this functionality into my own project..
It seems that the reason was that Stasm was created to make executables on Windows that did Image processing. Stasm DOES NOT act like a library, I'm currently making my own static and shared library that will act like a library that you can use to import into a random project and specify the parameters.
Basically modifiying main.cpp to another class and taking out the testing/unecessary code and get a thin processing version.
I get this error on my Mac OS Lion when I use gcc make:
dyld: Symbol not found: _iconv
Referenced from: /usr/lib/libcups.2.dylib
Expected in: /opt/local/lib/libiconv.2.dylib
in /usr/lib/libcups.2.dylib
dyld: Symbol not found: _iconv
Referenced from: /usr/lib/libcups.2.dylib
Expected in: /opt/local/lib/libiconv.2.dylib
in /usr/lib/libcups.2.dylib
./configure.sh: line 364: 18386 Trace/BPT trap: 5 $QTDIR/bin/qmake "$SRCDIR/$product.pro"
qmake failed
Note: I installed Macports in my machine. This used to work before, is this a known issue with MacPorts?
you can use the built in libiconv by selecting your target, going to the Build Phases tab and adding it to the link libraries and frameworks build phase.
as a general rule if you are missing linker symbols you can look up the symbol in your project and see what header they are from, and you can then usually figure out the appropriate library or framework.
in this case it tells you what library it is expecting...
you will want to use the built in version for a dynamic library, because with default linker flags, if this built product were to get moved to another computer it would try to resolve the symbols at run time in that location, and crash.
i' have downloaded boost 1.45.0, installed Python 3.1.3 on my mac.
I have the build Boost with Python succesfully.
For this i had to edit my "project-config.jam" and add "using python : 3.1 : /Library/Frameworks/Python.framework/Versions/3.1;" into it.
At this point all seems to be allright.
Now when i try to use this lib in an xcode project, i have link errors:
Undefined symbols:
"boost::python::objects::make_nurse_and_patient(_object*, _object*)", referenced from:
_object* boost::python::with_custodian_and_ward_postcall<0ul, 1ul, boost::python::default_call_policies>::postcall<_object*>(_object* const&, _object*)in libFluxCore.a(Python.o)
"boost::python::objects::enum_base::enum_base(char const*, _object* ()(void const), void* (*)(_object*), void (*)(_object*, boost::python::converter::rvalue_from_python_stage1_data*), boost::python::type_info, char const*)", referenced from:
sandbox::BindComponentState() in libFluxCore.a(Python.o)
sandbox::BindCallOptions() in libFluxCore.a(Python.o)
sandbox::BindFrameRate() in libFluxCore.a(Python.o)
And lot of more...
Paths and lib are well set in my project.
Does someone have an idea of what can happen ?
Thanks.
I'v finally found this error. buid boost python with
./bjam toolset=darwin-4.2 architecture=x86 address-model=32 link=static threading=multi runtime-link=static
did the job, as i am on i86 arch.