{"action":"opened","issue":{"url":"https://api.github.com/repos/opencv/opencv/issues/8681","repository_url":"https://api.github.com/repos/opencv/opencv","labels_url":"https://api.github.com/repos/opencv/opencv/issues/8681/labels{/name}","comments_url":"https://api.github.com/repos/opencv/opencv/issues/8681/comments","events_url":"https://api.github.com/repos/opencv/opencv/issues/8681/events","html_url":"https://github.com/opencv/opencv/issues/8681","id":225413045,"number":8681,"title":"Link error occurred when trying to build cross-platform app with opencv and react-native","user":{"login":"yenshih","id":14069488,"avatar_url":"https://avatars0.githubusercontent.com/u/14069488?v=3","gravatar_id":"","url":"https://api.github.com/users/yenshih","html_url":"https://github.com/yenshih","followers_url":"https://api.github.com/users/yenshih/followers","following_url":"https://api.github.com/users/yenshih/following{/other_user}","gists_url":"https://api.github.com/users/yenshih/gists{/gist_id}","starred_url":"https://api.github.com/users/yenshih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yenshih/subscriptions","organizations_url":"https://api.github.com/users/yenshih/orgs","repos_url":"https://api.github.com/users/yenshih/repos","events_url":"https://api.github.com/users/yenshih/events{/privacy}","received_events_url":"https://api.github.com/users/yenshih/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-01T09:55:08Z","updated_at":"2017-05-01T09:55:08Z","closed_at":null,"body":"Sorry for asking question directly in this issue. But I got confused for a long time and I couldn't find any answer in this [site](http://answers.opencv.org/questions/)\r\nFirstly, Here is my [repo](https://github.com/yenshih/Dehaze).\r\n\r\n### Introduction about my project\r\nI'm trying to build a cross-platform image processing app with this following techniques:\r\n - [React Native](https://facebook.github.io/react-native/): Building cross-platform view with React.\r\n - [Djinni](https://github.com/dropbox/djinni): A tool for generating cross-language type declarations and interface bindings. It's designed to connect C++ with either Java or Objective-C.\r\n - opencv: \r\n    - pass uri from react native, invoke imread\r\n    - do some stuff using opencv, including guidedFilter in [opencv_contrib](https://github.com/opencv/opencv_contrib)\r\n    - invoke imwrite to save the image after processing, and return new uri\r\n\r\nSo I build a development environment including React Native, Djinni and C++ without opencv, it works well. I can transfer message (pass a string as parameter and get the return string) between React Native and C++.\r\n\r\n### Errors occurred while linking opencv\r\nNow I'd like to include opencv in my app and run this project in iOS Simulator first. In order to use guidedFilter in ximgproc, I need to compile my own opencv bundle from source code with this following commands.\r\n```bash\r\ngit clone https://github.com/opencv/opencv.git\r\ngit clone https://github.com/opencv/opencv_contrib.git\r\ncp -R ./opencv_contrib/modules/ximgproc ./opencv/modules\r\npython ./opencv/platforms/ios/build_framework.py /usr/local/opencv\r\n```\r\nI built opencv2.framework and included it in xcodeproj, then compiled.\r\nSome errors occurred. You can reproduce this errors by:\r\n```bash\r\ngit clone --recursive https://github.com/yenshih/Dehaze.git\r\ncd Dehaze\r\nnpm install\r\nmake\r\nmake ios\r\n```\r\n'make' may takes a few minutes downloading and compiling scala source code in Djinni.\r\nAnd maybe you need to install [nodejs](https://nodejs.org/en/) and [npm](https://docs.npmjs.com/getting-started/installing-node) previously.\r\n<img width=\"1280\" alt=\"2017-05-01 5 02 17\" src=\"https://cloud.githubusercontent.com/assets/14069488/25576309/6f049194-2e90-11e7-870b-e39c4e9d00bc.png\">\r\n<img width=\"1280\" alt=\"2017-05-01 5 02 48\" src=\"https://cloud.githubusercontent.com/assets/14069488/25576310/6f158e86-2e90-11e7-8f43-46d1e7b1b5c7.png\">\r\n\r\nIt seems that errors occurred while linking opencv static library, and I have no ideas about it.\r\n\r\n### Environment\r\n - opencv: Built from source code.\r\n - OS: macOS Sierra 10.12.3\r\n - compiler: clang in xcode\r\n    - Apple LLVM version 8.1.0 (clang-802.0.35)\r\n    - Target: x86_64-apple-darwin16.4.0\r\n    - Thread model: posix\r\n    - InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin\r\n\r\n### Key File Description\r\n - /android ---- React Native Android project\r\n - /ios ---- React Native iOS project\r\n - /src\r\n    - /js ---- React Native code.\r\n    - /cpp ---- C++ code with opencv\r\n- /generated-src ---- generated bridge code by Djinni\r\n- dehaze.djinni ---- Djinni type declaration file\r\n- run_djinni.sh ---- run Djinni to generate bridge code\r\n- libdehaze.gyp ---- Djinni configuration\r\n- index.android.js ---- React Native Android entry code\r\n- index.ios.js ---- React Native iOS entry code\r\n\r\n### Conclusion\r\nI was just wondering if someone could tell my how to solve the problem above. I would really appreciate your help!\r\nI will keep tracking this issue, if someone has any problem about my project, just ask me.\r\nThanks again!"}}
{"actor":{"display_login":"yenshih"}}