{"id":983,"date":"2017-03-09T07:17:23","date_gmt":"2017-03-09T14:17:23","guid":{"rendered":"http:\/\/somethingk.com\/main\/?p=983"},"modified":"2017-03-09T07:20:38","modified_gmt":"2017-03-09T14:20:38","slug":"error-identifier-cout-is-undefined","status":"publish","type":"post","link":"https:\/\/somethingk.com\/main\/error-identifier-cout-is-undefined\/","title":{"rendered":"Error: identifier &#8220;cout&#8221; is undefined"},"content":{"rendered":"<p>I ran across the following issue when trying to compile my AztecOO source code outside of Trilinous.<\/p>\n<p><code>example\/AztecOO\/adapt_main.cpp(94): error: identifier \"cout\" is undefined<br \/>\ncout &lt;&lt; comm &lt;&lt; endl;<br \/>\n^<br \/>\nexample\/AztecOO\/adapt_main.cpp(94): error: identifier \"endl\" is undefined<br \/>\ncout &lt;&lt; comm &lt;&lt; endl;<br \/>\n^<br \/>\nexample\/AztecOO\/adapt_main.cpp(96): error: identifier \"cerr\" is undefined<br \/>\nif(argc != 2) cerr &lt;&lt; \"error: enter name of data file on command line\" &lt;&lt; endl;<br \/>\n<\/code><\/p>\n<p><a href=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2017\/03\/unnamed-1.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-984\" src=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2017\/03\/unnamed-1.png\" alt=\"\" width=\"692\" height=\"180\" srcset=\"https:\/\/somethingk.com\/main\/wp-content\/uploads\/2017\/03\/unnamed-1.png 692w, https:\/\/somethingk.com\/main\/wp-content\/uploads\/2017\/03\/unnamed-1-300x78.png 300w\" sizes=\"(max-width: 692px) 100vw, 692px\" \/><\/a><\/p>\n<p>Fix<br \/>\nThe compiler doesn\u2019t recognize that these methods come from the standard library. Therefore, I must tell it with the following commands:<\/p>\n<p><code>using std::cout;<br \/>\nusing std::endl;<br \/>\nusing std::cerr;<\/code><\/p>\n<p>Credit goes to <a href=\"http:\/\/stackoverflow.com\/questions\/13208547\/the-includeiostream-exists-but-i-get-an-error-identifier-cout-is-undefine\">http:\/\/stackoverflow.com\/questions\/13208547\/the-includeiostream-exists-but-i-get-an-error-identifier-cout-is-undefine<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I ran across the following issue when trying to compile my AztecOO source code outside of Trilinous. example\/AztecOO\/adapt_main.cpp(94): error: identifier &#8220;cout&#8221; is undefined cout &lt;&lt; comm &lt;&lt; endl; ^ example\/AztecOO\/adapt_main.cpp(94): error: identifier &#8220;endl&#8221; is undefined cout &lt;&lt; comm &lt;&lt; endl; ^ example\/AztecOO\/adapt_main.cpp(96): error: identifier &#8220;cerr&#8221; is undefined if(argc != 2) cerr &lt;&lt; &#8220;error: enter name of data file on command [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[177,6],"tags":[469,303,257,470,475,468],"class_list":["post-983","post","type-post","status-publish","format-standard","hentry","category-development","category-linux","tag-aztecoo","tag-c","tag-compile","tag-compiler-error","tag-standard-library","tag-trilinous"],"_links":{"self":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts\/983","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/comments?post=983"}],"version-history":[{"count":4,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts\/983\/revisions"}],"predecessor-version":[{"id":988,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts\/983\/revisions\/988"}],"wp:attachment":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/media?parent=983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/categories?post=983"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/tags?post=983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}