{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/3046","labels_url":"https://api.github.com/repos/nodejs/node/issues/3046/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/3046/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/3046/events","html_url":"https://github.com/nodejs/node/pull/3046","id":108071976,"number":3046,"title":"src: export Agent's constructor and destructor","user":{"login":"zcbenz","id":639601,"avatar_url":"https://avatars.githubusercontent.com/u/639601?v=3","gravatar_id":"","url":"https://api.github.com/users/zcbenz","html_url":"https://github.com/zcbenz","followers_url":"https://api.github.com/users/zcbenz/followers","following_url":"https://api.github.com/users/zcbenz/following{/other_user}","gists_url":"https://api.github.com/users/zcbenz/gists{/gist_id}","starred_url":"https://api.github.com/users/zcbenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zcbenz/subscriptions","organizations_url":"https://api.github.com/users/zcbenz/orgs","repos_url":"https://api.github.com/users/zcbenz/repos","events_url":"https://api.github.com/users/zcbenz/events{/privacy}","received_events_url":"https://api.github.com/users/zcbenz/received_events","type":"User","site_admin":true},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/c++","name":"c++","color":"e11d21"},{"url":"https://api.github.com/repos/nodejs/node/labels/debugger","name":"debugger","color":"bfd4f2"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-24T07:05:14Z","updated_at":"2015-09-25T05:15:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/3046","html_url":"https://github.com/nodejs/node/pull/3046","diff_url":"https://github.com/nodejs/node/pull/3046.diff","patch_url":"https://github.com/nodejs/node/pull/3046.patch"},"body":"Since `node::Environment` includes `node::debugger::Agent` as a member data, and the constructor and destructor of `node::Environment` are inlined, we have to export `Agent`'s constructor and destructor, otherwise when Node is built as shared library we will get following error:\r\n\r\n```\r\nelectron_lib.lib(electron_lib.node_main.obj) : error LNK2019: unresolved external symbol \"public: __cdecl node::debugger::Agent::~Agent(void)\" (??1Agent@debugger@node@@QEAA@XZ) referenced in function \"private: __cdecl node::Environment::~Environment(void)\" (??1Environment@node@@AEAA@XZ)\r\nelectron_lib.lib(electron_lib.atom_renderer_client.obj) : error LNK2001: unresolved external symbol \"public: __cdecl node::debugger::Agent::~Agent(void)\" (??1Agent@debugger@node@@QEAA@XZ)\r\nelectron_lib.lib(electron_lib.atom_renderer_client.obj) : error LNK2019: unresolved external symbol \"public: __cdecl node::debugger::Agent::Agent(class node::Environment *)\" (??0Agent@debugger@node@@QEAA@PEAVEnvironment@2@@Z) referenced in function \"private: __cdecl node::Environment::Environment(class v8::Local<class v8::Context>,struct uv_loop_s *)\" (??0Environment@node@@AEAA@V?$Local@VContext@v8@@@v8@@PEAUuv_loop_s@@@Z)\r\n```"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/143129184","html_url":"https://github.com/nodejs/node/pull/3046#issuecomment-143129184","issue_url":"https://api.github.com/repos/nodejs/node/issues/3046","id":143129184,"user":{"login":"rvagg","id":495647,"avatar_url":"https://avatars.githubusercontent.com/u/495647?v=3","gravatar_id":"","url":"https://api.github.com/users/rvagg","html_url":"https://github.com/rvagg","followers_url":"https://api.github.com/users/rvagg/followers","following_url":"https://api.github.com/users/rvagg/following{/other_user}","gists_url":"https://api.github.com/users/rvagg/gists{/gist_id}","starred_url":"https://api.github.com/users/rvagg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvagg/subscriptions","organizations_url":"https://api.github.com/users/rvagg/orgs","repos_url":"https://api.github.com/users/rvagg/repos","events_url":"https://api.github.com/users/rvagg/events{/privacy}","received_events_url":"https://api.github.com/users/rvagg/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T05:15:42Z","updated_at":"2015-09-25T05:15:42Z","body":"@trevnorris, @bnoordhuis, @indutny any of you care to give this a quick look?"}}