{"action":"created","issue":{"url":"https://api.github.com/repos/urho3d/Urho3D/issues/1562","repository_url":"https://api.github.com/repos/urho3d/Urho3D","labels_url":"https://api.github.com/repos/urho3d/Urho3D/issues/1562/labels{/name}","comments_url":"https://api.github.com/repos/urho3d/Urho3D/issues/1562/comments","events_url":"https://api.github.com/repos/urho3d/Urho3D/issues/1562/events","html_url":"https://github.com/urho3d/Urho3D/issues/1562","id":174890564,"number":1562,"title":"How to create Lua bindings in downstream project?","user":{"login":"KonstantinTomashevich","id":19854474,"avatar_url":"https://avatars.githubusercontent.com/u/19854474?v=3","gravatar_id":"","url":"https://api.github.com/users/KonstantinTomashevich","html_url":"https://github.com/KonstantinTomashevich","followers_url":"https://api.github.com/users/KonstantinTomashevich/followers","following_url":"https://api.github.com/users/KonstantinTomashevich/following{/other_user}","gists_url":"https://api.github.com/users/KonstantinTomashevich/gists{/gist_id}","starred_url":"https://api.github.com/users/KonstantinTomashevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KonstantinTomashevich/subscriptions","organizations_url":"https://api.github.com/users/KonstantinTomashevich/orgs","repos_url":"https://api.github.com/users/KonstantinTomashevich/repos","events_url":"https://api.github.com/users/KonstantinTomashevich/events{/privacy}","received_events_url":"https://api.github.com/users/KonstantinTomashevich/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/urho3d/Urho3D/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-03T10:31:44Z","updated_at":"2016-09-03T15:21:48Z","closed_at":"2016-09-03T14:34:55Z","body":"I want to write my game's core on C++ and my game's \"frontend\" on Lua. But I don't found any information about integrating Lua in **Urho3D downstream** project. I'm trying to implement it this way:\r\n\r\n1. Create empty downstream project and add sample class to it. Link urho3d's tolua++ to my project's target.\r\n```cmake\r\nset (TARGET_NAME Urho3DApplication)\r\ndefine_source_files ()\r\nsetup_main_executable ()\r\ntarget_link_libraries (Urho3DApplication tolua++)\r\n```\r\n\r\n2. Create .pkg for my sample class and run Urho3D's tolua++ tool.\r\n```bash\r\ntolua++ -o generated/tolua_SampleClass.cpp pkgs/SampleClass.pkg\r\n```\r\n\r\n3. Add this include's to my Urho3DApplication.cpp:\r\n```c++\r\n#include \"generated/tolua++.h\"\r\n#include <Urho3D/LuaScript/ToluaUtils.h>\r\n#include \"generated/tolua_SampleClass.cpp\"\r\n```\r\n\r\nAnd I get this error in linking step:\r\n```\r\n[ 66%] Linking CXX executable ..\\bin\\Urho3DApplication.exe\r\nD:/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: \r\ncannot find -ltolua++\r\n\r\nsources\\CMakeFiles\\Urho3DApplication.dir\\build.make:124: recipe for target 'bin/Urho3DApplication.exe' failed\r\nD:/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: \r\ncannot find -ltolua++\r\n\r\ncollect2.exe: error: ld returned 1 exit status\r\nCMakeFiles\\Makefile2:84: recipe for target 'sources/CMakeFiles/Urho3DApplication.dir/all' failed\r\nmakefile:93: recipe for target 'all' failed\r\nmingw32-make[2]: *** [bin/Urho3DApplication.exe] Error 1\r\nmingw32-make[1]: *** [sources/CMakeFiles/Urho3DApplication.dir/all] Error 2\r\nmingw32-make: *** [all] Error 2\r\n```\r\n\r\nGithub repository:\r\nhttps://github.com/KonstantinTomashevich/urho3d-cxx-and-lua-intergration\r\nHow I can fix it?\r\n"},"comment":{"url":"https://api.github.com/repos/urho3d/Urho3D/issues/comments/244552346","html_url":"https://github.com/urho3d/Urho3D/issues/1562#issuecomment-244552346","issue_url":"https://api.github.com/repos/urho3d/Urho3D/issues/1562","id":244552346,"user":{"login":"weitjong","id":5548048,"avatar_url":"https://avatars.githubusercontent.com/u/5548048?v=3","gravatar_id":"","url":"https://api.github.com/users/weitjong","html_url":"https://github.com/weitjong","followers_url":"https://api.github.com/users/weitjong/followers","following_url":"https://api.github.com/users/weitjong/following{/other_user}","gists_url":"https://api.github.com/users/weitjong/gists{/gist_id}","starred_url":"https://api.github.com/users/weitjong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weitjong/subscriptions","organizations_url":"https://api.github.com/users/weitjong/orgs","repos_url":"https://api.github.com/users/weitjong/repos","events_url":"https://api.github.com/users/weitjong/events{/privacy}","received_events_url":"https://api.github.com/users/weitjong/received_events","type":"User","site_admin":false},"created_at":"2016-09-03T15:21:48Z","updated_at":"2016-09-03T15:21:48Z","body":"Glad to hear that. You should be able to setup your own project to create your own SHARED library which your own application depends on. Your SHARED lib depends on Urho3D STATIC library. Alternatively, you will have to modify Urho3D's build system to suit your need."}}
{"actor":{"display_login":"weitjong"}}