I am developing an app using electron.
I have setup an addon that uses c++ code and translated it into nodejs code using NAPI.
Now I want to include an external .so library (with a .h file) but can't find any documents that achieve any success.
I keep getting error: undefined symbol: Some_Function_Name
you can specifiy libraries to link against in the binding.gyp, details is in Node-gyp/C++ import shared library (.so) and How to build nodejs C++ addon depending on a shared library with relative location. when using NAPI you use node-gyp as the toolchain to compile automatically, is a dependency of NAPI
Related
Are there any supported alternatives to the approach presented on the Tensorflow C++ guide that instead allows you to separately build Tensorflow and link your C++ application to it as an external library?
I've managed to compile libtensorflow_cc.so and link to it. But where can I get valid header-files. Just grabbing the header-files from source gives errors and I have to manually adjust the paths, which I'd rather avoid.
I use this https://github.com/FloopCZ/tensorflow_cc repository and add find_package(TensorflowCC REQUIRED) in cmake and there is no issue with include file and not with lib target_link_libraries(project_name TensorflowCC::Shared)
or check that you include file path is correct to the path to you TF installation
I have created a C++ library on Windows using Qt and it works well. Now I want to build the same C++ library on OS X/Mac using Qt, and after running the same steps as how I made this C++ library on Windows, I’m not sure which generated files is the library I need on OS X.
On Windows, I can use the library in other C++ project through the following files: .dll, object file library and the header file. I can find the first two files generated in the target folder:
But on Mac, after checking the same folder I found the generated files as below:
Which files are the library that I made? And how to use the generated library in other C++ project on OS X?
I try to find some step-by-step guide but with no luck so far, so if there’s any useful link that will be of help.
Thank you in advance!
The library is
libsdk.1.0.0.dylib
all other libsdk*.dylib are links to the library (compatibility reasons, some applications look for libsdk.dylib). You use these library as you would use any other dynamic library. Supply the library and the header files to the local path or install them system wide (DYLD_LIBRARY_PATH).
See How to use dylib in Mac OS X (C++) for more information.
How to include flandmark library in dev c++? I need to find landmark points for eye.
There are no proper example for using flanmark in dev c++. When i included the header files in the project directory i still get linkage error.
it seems that there is still no official support for generating project for dev c++ in CMake. However, you can of course still use it. From your question it is not clear whether you have compiled flandmark library already and now want to create an external project in dev c++ using the library or if you want to compile flandmark library itself using dev c++.
If you have already successfully compiled flandmark and want to use it in external project, then besides setting the include directory and include the header files, you also need to specify linking directory and link flandmark libary to your project. See e.g. the CMakeLists.txt line 65 file for getting the idea what to include and what to link.
In case you want to use dev c++ for compiling the flandmark library, you need to link the OpenCV libraries and includes and specify the include directory with flandmark headers. For the OpenCV on linux works the command:
pkg-config --cflags --libs opencv
at the end of the g++ line.
I would like it to operate similarly to how the normal test framework works - if you the tests from the Product->Run tests menu item, the output should appear in the left sidebar window.
I found a guide for using xcode 3 with boost test, but couldn't figure out how to translate those instructions for xcode 4 (if it is even possible).
Finally, I'm building an iPhone application. I could get boost running using the #include <boost/test/included/unit_test.hpp>, however it is pretty slow. Using the standard #include <boost/test/unit_test.hpp> results in link errors due to the library being built for the wrong architecture.
You should build the boost library to a static library ".a" using .configure and make.
According to this:
No special build options or macro definitions are required to build
the static library. Using the Boost.Build system you can build the
static library with the following command from libs/test/build
directory:
bjam [-sTOOLS=] {-sBUILD=boost_unit_test_framework}
This library or libraries and their respective headers need to be added to the project. (Two built versions are needed, one i386 for the simulator and one ARM for devices).
The static library is imported from Link Binary with Libraries in
Build Phases.
Also you need to tell XCode which of these to use, you
can do this by setting contidional build settings in `Build settings-
Library search paths. Above this line is where you add the Header
Search Path to the boost header files.
After this you should be able to include the headers (Added above) in C++ or objective-C++ code of yours. (To make Obj-C files Obj-C++ files you need to change all deppendent .m files to .mm)
If there is a some problems after this, switching Compiler or standard library for C++ in Build Settings might help.
I have an application written in platform-independent C++ which has been primarily developed on Windows. I'm now trying to get it up and running on a Mac but I seem to be lost in how to link to the Mac version of a third-party library I'm using. I added the library's include and lib folders to header and library search paths respectively and it compiles/links but upon running dies with the following:
dyld: Library not loaded: #executable_path/../Frameworks/libsfml-system-d.2.dylib
Referenced from: /Users/jdoe/Library/Developer/Xcode/DerivedData/Foobar-fonhiddwdwvgqygcegiffqkontxi/Build/Products/Debug/Foobar.app/Contents/MacOS/Foobar
Reason: image not found
I can get it to run by putting the dylibs in /usr/lib but I don't think this is a good idea for distribution. How can I include the dylib inside my app bundle?
Add a copy-files build phase that copies the dylib into the Frameworks folder inside the app bundle. (When you Get Info on a copy files build phase, Frameworks is one of the destination choices.)