{"action":"created","issue":{"url":"https://api.github.com/repos/ChaiScript/ChaiScript/issues/313","repository_url":"https://api.github.com/repos/ChaiScript/ChaiScript","labels_url":"https://api.github.com/repos/ChaiScript/ChaiScript/issues/313/labels{/name}","comments_url":"https://api.github.com/repos/ChaiScript/ChaiScript/issues/313/comments","events_url":"https://api.github.com/repos/ChaiScript/ChaiScript/issues/313/events","html_url":"https://github.com/ChaiScript/ChaiScript/issues/313","id":196414206,"number":313,"title":"how to compile and run in header-only way ?","user":{"login":"pubcoder","id":227302,"avatar_url":"https://avatars.githubusercontent.com/u/227302?v=3","gravatar_id":"","url":"https://api.github.com/users/pubcoder","html_url":"https://github.com/pubcoder","followers_url":"https://api.github.com/users/pubcoder/followers","following_url":"https://api.github.com/users/pubcoder/following{/other_user}","gists_url":"https://api.github.com/users/pubcoder/gists{/gist_id}","starred_url":"https://api.github.com/users/pubcoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pubcoder/subscriptions","organizations_url":"https://api.github.com/users/pubcoder/orgs","repos_url":"https://api.github.com/users/pubcoder/repos","events_url":"https://api.github.com/users/pubcoder/events{/privacy}","received_events_url":"https://api.github.com/users/pubcoder/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-19T13:32:20Z","updated_at":"2016-12-19T13:52:46Z","closed_at":"2016-12-19T13:52:46Z","body":" * Compiler Used: g++ 6.2.1-5\r\n * Operating System: Debian GNU Linux\r\n * Architecture (ARM/x86/32bit/64bit/etc): 64bit\r\n \r\nThe project introduction page says that ChaiScript \"uses header-only approach\" and hence I am trying the example \"main.cpp\" from the intro page like this:\r\n\r\n`g++ -std=c++14 -I../ChaiScript-5.8.5/include/ main.cpp`\r\n\r\nand compiler complains that it cannot find implementations for dlsym and dlerror.\r\nSo I try this instead:\r\n\r\n`g++ -std=c++14 -I../ChaiScript-5.8.5/include/ main.cpp -ldl`\r\n\r\nWhen I try to run the `./a.out` it complains that it cannot find `./libchaiscript_stdlib-5.8.5.dll`, `./libchaiscript_stdlib-5.8.5.so` etc.\r\n\r\nSo this does not look like \"header-only\" library, in fact it depends on dynamic libraries, or perhaps I am missing something how to compile it properly?\r\nFrankly, I did not compile anything except this small program. Any help is appreciated.\r\n\r\n### Expected Behavior \r\n\r\ncompile and run as described.\r\n\r\n### Actual Behavior \r\n\r\nasks for dynamic linking library, then asks for dynamically linked library.\r\n\r\n### Minimal Example to Reproduce Behavior\r\n\r\n```\r\n/// main.cpp\r\n\r\n#include <chaiscript/chaiscript.hpp>\r\n\r\ndouble function(int i, double j)\r\n{\r\n  return i * j;\r\n}\r\n\r\nint main()\r\n{\r\n  chaiscript::ChaiScript chai;\r\n  chai.add(chaiscript::fun(&function), \"function\");\r\n\r\n  double d = chai.eval<double>(\"function(3, 4.75);\");\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/ChaiScript/ChaiScript/issues/comments/267968770","html_url":"https://github.com/ChaiScript/ChaiScript/issues/313#issuecomment-267968770","issue_url":"https://api.github.com/repos/ChaiScript/ChaiScript/issues/313","id":267968770,"user":{"login":"pubcoder","id":227302,"avatar_url":"https://avatars.githubusercontent.com/u/227302?v=3","gravatar_id":"","url":"https://api.github.com/users/pubcoder","html_url":"https://github.com/pubcoder","followers_url":"https://api.github.com/users/pubcoder/followers","following_url":"https://api.github.com/users/pubcoder/following{/other_user}","gists_url":"https://api.github.com/users/pubcoder/gists{/gist_id}","starred_url":"https://api.github.com/users/pubcoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pubcoder/subscriptions","organizations_url":"https://api.github.com/users/pubcoder/orgs","repos_url":"https://api.github.com/users/pubcoder/repos","events_url":"https://api.github.com/users/pubcoder/events{/privacy}","received_events_url":"https://api.github.com/users/pubcoder/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T13:52:46Z","updated_at":"2016-12-19T13:52:46Z","body":"argh! I should have tried the second example with `Std_Lib::library()` constructor, sorry for the noise"}}
{"actor":{"display_login":"pubcoder"}}