undefined-symbol

Compiling a SWIG Python wrapper for a static library?

≡放荡痞女 提交于 2020-01-01 07:20:10
问题 This is a noob question. I'm trying to learn how to use SWIG to make a python interface for a C++ library. The library is a proprietary 3rd party library; it comes to me in the form of a header file (foo.h) and a static archive (libfoo.a). To simplify matters, I've cooked up an example which I think has the same pathology. Same error messages anyways. /* foo.hpp */ class TC { public: TC(); int i; private: }; For reference, here's foo.c. I only have the header and archive files for the real

nm symbol both “U” and “T”, what does that mean?

孤人 提交于 2019-12-24 17:03:55
问题 I am having an undefined symbol error at runtime, and when I look for the symbol in the relevant library, I get the result: nm -C -D /home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/pyscannerbit/libScannerBitCAPI.so | grep empty_ U YAML::detail::node_data::empty_scalar[abi:cxx11] 00000000002b5860 T YAML::detail::node_data::empty_scalar[abi:cxx11]() But how is that possible? The symbol is both undefined, and also in the library? What? Or are these actually different symbols?

Python console: ImportError PyUnicodeUCS4_FromString

限于喜欢 提交于 2019-12-24 15:39:37
问题 Can anyone help me to figure out what is happening and how to solve this error? The following message happens when I try to import a module I compiled before: Python 3.1.4 (default, Mar 8 2012, 09:13:26) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pypt Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: /usr/local/lib/python3.1/site-packages/pypt.so: undefined symbol: PyUnicodeUCS4_FromString 来源: https

ImportError igraph: undefined symbol

假装没事ソ 提交于 2019-12-23 12:38:57
问题 After installing python-igraph with pip, I still can't import it. I've encountered such error around the internet but most solutions I've found were about reinstalling the module, which I already did. Any suggestions on how to fix this would be greatly appreciated. Thanks >>> import igraph Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.5/site-packages/igraph/__init__.py", line 34, in <module> from igraph._igraph import * ImportError: /usr/lib

How do I compile and link C++ code with compiled C code?

こ雲淡風輕ζ 提交于 2019-12-23 09:24:03
问题 I want to be able to use Cmockery to mock C functions called from C++ code I'm testing. As a step towards that, I've renamed the Cmockery example run_tests.c to run_tests.cpp, and am attempting to compile and link it with cmockery.c: g++ -m32 -DHAVE_CONFIG_H -DPIC -I ../cmockery-0.1.2 -I /usr/include/malloc -c run_tests.cpp -o obj/run_tests.o gcc -m32 -DHAVE_CONFIG_H -DPIC -Wno-format -I ../cmockery-0.1.2 -I /usr/include/malloc -c ../cmockery-0.1.2/cmockery.c -o obj/cmockery.o g++ -m32 -o run

How can I resolve single symbol link error when dynamically linking XCode project to lib4cxx library?

心不动则不痛 提交于 2019-12-23 04:35:25
问题 I'm writing in C++ under XCode 4.6 on Mountain Lion. I'm trying to add and use the Apache log4cxx library. I installed the library this morning via Brew. I'm linking against liblog4cxx.dylib. I'm getting a link error that just one symbol can't be found: Undefined symbols for architecture x86_64: "log4cxx::Logger::forcedLog(log4cxx::helpers::ObjectPtrT const&, std::__1::basic_string, std::__1::allocator > const&, log4cxx::spi::LocationInfo const&) const", referenced from: I know it's finding

what does the $ld$add$os10.4$ prefix mean when I use nm to look at a symbol list on a Mac?

╄→尐↘猪︶ㄣ 提交于 2019-12-22 20:09:08
问题 I'm having some problems with my iPhone app not linking for the iPhone Simulator. It tells me there are undefined symbols: Undefined symbols for architecture i386: ".objc_class_name_NSRunLoop", referenced from: pointer-to-literal-objc-class-name in SampleBrowser.cpp.o ".objc_class_name_NSDate", referenced from: pointer-to-literal-objc-class-name in SampleBrowser.cpp.o ".objc_class_name_NSAutoreleasePool", referenced from: pointer-to-literal-objc-class-name in SampleBrowser.cpp.o pointer-to

Makefile with STXXL

♀尐吖头ヾ 提交于 2019-12-13 20:53:10
问题 I need to use the STXXL library for a software project I am working on, but for some reason, I am having trouble compiling a test file. I am not very familiar with makefiles, so I might have mixed up in linking some of the libraries together. The dummy files I am using are Draw.h, Draw.cpp, and driver.cpp. As you can imagine, Draw.h declares a method draw() that is implemented in Draw.cpp, and driver.cpp contains the main function, and includes Draw.h and calls draw(). The makefile I am using

C++ Undefined symbols for architecture x86_64 with user defined function

╄→尐↘猪︶ㄣ 提交于 2019-12-13 03:38:43
问题 I'm getting the following error message at compilation. Undefined symbols for architecture x86_64: "LSMDP2<HC_Base, HC_Base, Sine>::LSMDP2(int, int, std::unique_ptr<Forward, std::default_delete<Forward> >&, std::unique_ptr<BrownianMotionIncGenerator, std::default_delete<BrownianMotionIncGenerator> >&, std::unique_ptr<Driver, std::default_delete<Driver> >&, Sine&&, gsl_vector*, std::unique_ptr<Regression, std::default_delete<Regression> >&, std::unique_ptr<UniformSims, std::default_delete

Undefined Symbol in C++ When Loading a Python Shared Library

五迷三道 提交于 2019-12-12 10:30:02
问题 I have been trying to get a project of mine to run but I have run into trouble. After much debugging I have narrowed down the problem but have no idea how to proceed. Some background, I am using a python script inside C++ code. This is somewhat documented on Python, and I managed to get it running very well in my basic executable. #include and a -lpython2.6 and everything was grand. However, difficulty has arisen when running this python script from a shared library(.so). This shared library