{"id":47107,"date":"2024-04-02T19:06:15","date_gmt":"2024-04-02T19:06:15","guid":{"rendered":"https:\/\/www.oracletutoring.ca\/blog\/?p=47107"},"modified":"2024-04-02T19:06:16","modified_gmt":"2024-04-02T19:06:16","slug":"computer-science-compilation-games","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/computer-science-compilation-games\/","title":{"rendered":"Computer science: compilation games"},"content":{"rendered":"\n<h2>Self-tutoring about computer science: the tutor mentions an observation.<\/h2>\n<p>\nI am working on a project that uses an external library. To begin, I wanted to test if the library would compile as presented. I wrote a program that includes its header file and its own libraries but doesn&#8217;t directly use it, just to see if it would compile.<\/p>\n<p>\nInterestingly, it didn&#8217;t. Moreover, I got an error message complaining a certain entity wasn&#8217;t defined which I could see defined in the lead header file.<\/p>\n<p>\nSituations like this aren&#8217;t uncommon in computer science, because there are often subtleties to how things work. I was unfamiliar with this compiler.<\/p>\n<p>\nIt turns out that the compiler may let go of a function not invoked by the program being compiled. Because I had added a header file that my program wasn&#8217;t using, the compiler decided to drop a function from it. That function was needed by a downstream dependency, which complained it couldn&#8217;t find it. Yet, my program never invoked that dependency. Therefore, the compiler wouldn&#8217;t successfully compile my program.<\/p>\n<p>\nI added functionality to my program so that it did invoke a function from the included library. Then, it compiled. Interesting, eh?<\/p>\n<p>Source:<\/p>\n<p><a href=\"https:\/\/litaotju.github.io\/c++\/2020\/07\/24\/Whole-Archive-in-static-lib\/\">Tao&#8217;s Blog<\/a><\/p>\nJack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.\n\n","protected":false},"excerpt":{"rendered":"<p>Self-tutoring about computer science: the tutor mentions an observation. I am working on a project that uses an external library. To begin, I wanted to test if the library would compile as presented. I wrote a program that includes its &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/computer-science-compilation-games\/\"> <span class=\"screen-reader-text\">Computer science: compilation games<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105],"tags":[],"class_list":["post-47107","post","type-post","status-publish","format-standard","hentry","category-computer-science"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/47107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/comments?post=47107"}],"version-history":[{"count":3,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/47107\/revisions"}],"predecessor-version":[{"id":47110,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/47107\/revisions\/47110"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=47107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=47107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=47107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}