{"id":558,"date":"2022-08-30T15:03:21","date_gmt":"2022-08-30T15:03:21","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/gnustep-undefined-reference-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:03:21","modified_gmt":"2022-08-30T15:03:21","slug":"gnustep-undefined-reference-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/gnustep-undefined-reference-collection-of-common-programming-errors\/","title":{"rendered":"GNUStep Undefined reference-Collection of common programming errors"},"content":{"rendered":"<p>I am making a program in GNUStep on windows with the following code:<\/p>\n<pre><code>#import \n#import \n\nint main(int argc, char *argv[]) {\n    NSApplication *myApplication = [NSApplication sharedApplication];\n}\n<\/code><\/pre>\n<p>However, when I compile (with <code>gcc -o hello hello.m -I \/GNUstep\/System\/Library\/Headers -L \/GNUstep\/System\/Library\/Libraries -lobjc -lgnustep-base -fconstant-string-class=NSConstantString -std=c99<\/code>), I get this error:<\/p>\n<pre><code>undefined referenceto `__objc_class_name_NSApplication'\ncollect2: ld returned 1 exit status\n<\/code><\/pre>\n<p>I can <code>#import<\/code> fine, but when I try to call <code>NSApplication<\/code> I get this error. How can I fix this?<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-09 20:51:01. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I am making a program in GNUStep on windows with the following code: #import #import int main(int argc, char *argv[]) { NSApplication *myApplication = [NSApplication sharedApplication]; } However, when I compile (with gcc -o hello hello.m -I \/GNUstep\/System\/Library\/Headers -L \/GNUstep\/System\/Library\/Libraries -lobjc -lgnustep-base -fconstant-string-class=NSConstantString -std=c99), I get this error: undefined referenceto `__objc_class_name_NSApplication&#8217; collect2: ld returned 1 [&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-558","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/558","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=558"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/558\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}