-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static Build ViSP with 3rd parties #1457
Comments
By ‘3rd parties’ do you mean the 3rd parties in ViSP's 3rdparty folder, or also external 3rd parties such as eigen, opencv... |
Actually the 3rd party i mentioned is OPENCV. What I wanna do is integrate opencv .a files and my visp code into a single .dll. Then I can use it as a plugin in unity (expose some of functions called by c#) and deploy them into mobile side without opencv installation (android, ios...). Thanks for your kindly reply. |
It seems that I located the problem: I use pkg-config to find those:
But i don't know how to add those linkers to visp CMakeLists, could you please help? (I am using MACOS, opencv4.10 with contrib modules) cmake errors here (all of these errors are related to extra 3rd parties from opencv):
|
This is because In your
that should set the following output vars |
Thanks a lot! I have tried it but encounter another question:
Then I rebuild opencv without opencv_wechat_qrcode module, then try to build visp again:
I searched it and found this: https://forum.crystal-lang.org/t/cannot-compile-statically-ld-library-not-found-for-lcrt0-o/4070/2, have you ever met this? My modification:
modify https://github.com/lagadic/visp/blob/master/cmake/templates/VISPConfig.cmake.in#L377 to:
More information:
output:
Thanks again! |
Hi @fspindle , I some more updates about this issue. I just solved the 'lcrt0.o' problem by disable building all the executable program (with main() entry) like example, test, tutorial. Only keep building the visp components and my own code, then obtain a .bundle file which contains opencv components + visp components + my own code and it works well now when called by C# side. But because of this 'lcrt0.o', I cannot static compile any executable file, which means I cannot debug. Is there any solution about this? https://forum.crystal-lang.org/t/cannot-compile-statically-ld-library-not-found-for-lcrt0-o/4070/2 https://developer.apple.com/library/archive/qa/qa1118/_index.html people here say MACOS does not support pure static build, but I don't get why I can static build visp base on a dynamic opencv, then ofc I would get a .bundle including visp components by doing so but need prepare opencv additionally. Thanks a lot! |
No idea concerning |
Really thanks, I successfully built the static .so and the .bundle. I am still wondering that what extra steps I need to do if I want use the static .so/.bundle to write C# in unity, then build the whole unity project into ios/android side. For example in ios, do I need to build a specific visp version for ios? and opencv for ios? or I need to disable some modules from visp or opencv? Do you have any advice for this? For now the phone side just connot load the dll after I built the ios project, it says DllNotFoundException: Unable to load DLL 'UnityWrapper'. Tried the load the following dynamic libraries: Unable to load dynamic library '/UnityWrapper' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen(/UnityWrapper, 0x0005): tried: '/UnityWrapper' (no such file), '/private/preboot/Cryptexes/OS/UnityWrapper' (no such file), '/UnityWrapper' (no such file) Thanks a lot in advance!! |
While testing ViSP for the first time, i'm having the exact same error in the XCode's. This is happening when testing the Unity Visp wrapper tutorial project build for ios platform. In editor works just fine though. What it missing to generate an app that works on ios from unity? |
Hello, I am trying writing a application with visp, but I want to integrate all the 3rd party's .a and visp .a into a single .dll. Because I wanna make it work in another machine where doesn't have the environment for installing 3rd-parties.
I have successfully integrate visp .a into one single dll by building visp and my code staticlly, the details: set BUILD_SHARED_LIBS=OFF, and build my program just like tutorial program.
May I know if there is a way to integrate 3rd parties .a files into my dll? just like opencv. Thanks!!
The text was updated successfully, but these errors were encountered: