{"id":760,"date":"2022-08-30T15:06:43","date_gmt":"2022-08-30T15:06:43","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/gcc-undefined-reference-between-libraries-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:06:43","modified_gmt":"2022-08-30T15:06:43","slug":"gcc-undefined-reference-between-libraries-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/gcc-undefined-reference-between-libraries-collection-of-common-programming-errors\/","title":{"rendered":"gcc undefined reference between libraries-Collection of common programming errors"},"content":{"rendered":"<p>At linking time, I&#8217;m getting the following:<\/p>\n<pre><code>libMain.a(Object.o): In function `Object': \nObject.cpp(44): undefined reference to `Transform::MakeIdentity()'\n<\/code><\/pre>\n<p>It is definitely seen from using <code>nm --defined-only libSystem.a<\/code><\/p>\n<pre><code>Transform.o:\n00000000 T Transform::MakeIdentity()\n<\/code><\/pre>\n<p>Both libSystem.a and libMain.a are being input appropriately. Linker command line options:<\/p>\n<blockquote>\n<p>-o &#8220;Game.so&#8221; -shared -Wl,-z,noexecstack &#8220;-lstdc++&#8221; &#8220;-lsupc++&#8221; &#8220;-lgnustl_static&#8221; &#8220;-lgcc&#8221; &#8220;libSystem.a&#8221; &#8220;libMain.a&#8221; -nostdlib -l&#8221;c&#8221; -l&#8221;m&#8221; -l&#8221;log&#8221; -l&#8221;gcc&#8221; -Wl,-soname,&#8221;libGame&#8221; -Wl,&#8211;no-undefined<\/p>\n<\/blockquote>\n<p id=\"rop\"><small>Originally posted 2013-11-09 22:39:34. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>At linking time, I&#8217;m getting the following: libMain.a(Object.o): In function `Object&#8217;: Object.cpp(44): undefined reference to `Transform::MakeIdentity()&#8217; It is definitely seen from using nm &#8211;defined-only libSystem.a Transform.o: 00000000 T Transform::MakeIdentity() Both libSystem.a and libMain.a are being input appropriately. Linker command line options: -o &#8220;Game.so&#8221; -shared -Wl,-z,noexecstack &#8220;-lstdc++&#8221; &#8220;-lsupc++&#8221; &#8220;-lgnustl_static&#8221; &#8220;-lgcc&#8221; &#8220;libSystem.a&#8221; &#8220;libMain.a&#8221; -nostdlib -l&#8221;c&#8221; -l&#8221;m&#8221; -l&#8221;log&#8221; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-760","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/760","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=760"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/760\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}