{"action":"created","issue":{"url":"https://api.github.com/repos/leethomason/tinyxml2/issues/498","repository_url":"https://api.github.com/repos/leethomason/tinyxml2","labels_url":"https://api.github.com/repos/leethomason/tinyxml2/issues/498/labels{/name}","comments_url":"https://api.github.com/repos/leethomason/tinyxml2/issues/498/comments","events_url":"https://api.github.com/repos/leethomason/tinyxml2/issues/498/events","html_url":"https://github.com/leethomason/tinyxml2/issues/498","id":189311887,"number":498,"title":"GetErrorStr1 and GetErrorStr2 cause undefined reference to GetStr() during linking on Ubuntu","user":{"login":"amit133","id":10413604,"avatar_url":"https://avatars.githubusercontent.com/u/10413604?v=3","gravatar_id":"","url":"https://api.github.com/users/amit133","html_url":"https://github.com/amit133","followers_url":"https://api.github.com/users/amit133/followers","following_url":"https://api.github.com/users/amit133/following{/other_user}","gists_url":"https://api.github.com/users/amit133/gists{/gist_id}","starred_url":"https://api.github.com/users/amit133/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amit133/subscriptions","organizations_url":"https://api.github.com/users/amit133/orgs","repos_url":"https://api.github.com/users/amit133/repos","events_url":"https://api.github.com/users/amit133/events{/privacy}","received_events_url":"https://api.github.com/users/amit133/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-15T06:38:57Z","updated_at":"2016-12-29T19:31:50Z","closed_at":"2016-12-29T19:31:50Z","body":"I tried on two different machines with g++ 4.8 and g++ 5.4 and the result was same.\r\n\r\nI downloaded the latest code from github and built using cmake. My application code is throwing following error each time:\r\n\r\n  **/usr/local/include/tinyxml2.h:1769: undefined reference to `tinyxml2::StrPair::GetStr()'**\r\n\r\nThe library is getting referenced correctly as I tested for other methods to make sure that there is no problem with path of the lib.\r\n\r\n**Root cause:** I found that the functions GetErrorStr1() and GetErrorStr2() are inline and somehow the linker is not able to see the function body of GetStr().\r\n\r\n**My workaround:** I separated the declaration and definition. Moved the definition to the tinyxml2.cpp file and now there is no error.\r\n\r\nCould someone please explain this behaviour. If this is a bug, I request the maintainer of the code to fix it.\r\n"},"comment":{"url":"https://api.github.com/repos/leethomason/tinyxml2/issues/comments/269680843","html_url":"https://github.com/leethomason/tinyxml2/issues/498#issuecomment-269680843","issue_url":"https://api.github.com/repos/leethomason/tinyxml2/issues/498","id":269680843,"user":{"login":"leethomason","id":699925,"avatar_url":"https://avatars.githubusercontent.com/u/699925?v=3","gravatar_id":"","url":"https://api.github.com/users/leethomason","html_url":"https://github.com/leethomason","followers_url":"https://api.github.com/users/leethomason/followers","following_url":"https://api.github.com/users/leethomason/following{/other_user}","gists_url":"https://api.github.com/users/leethomason/gists{/gist_id}","starred_url":"https://api.github.com/users/leethomason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leethomason/subscriptions","organizations_url":"https://api.github.com/users/leethomason/orgs","repos_url":"https://api.github.com/users/leethomason/repos","events_url":"https://api.github.com/users/leethomason/events{/privacy}","received_events_url":"https://api.github.com/users/leethomason/received_events","type":"User","site_admin":false},"created_at":"2016-12-29T19:31:50Z","updated_at":"2016-12-29T19:31:50Z","body":"No way to address / test. Would accept a PR."}}
{"actor":{"display_login":"leethomason"}}