Note that there are some explanatory texts on larger screens.

plurals
  1. POVery simple program not working in c++?
    primarykey
    data
    text
    <p>I can't figure out why this isn't working...</p> <p>I am working in Linux</p> <p>g++ doesn't do anything</p> <p>gcc prints the following:</p> <pre><code>/tmp/ccyg7NDd.o: In function `main': test.cc:(.text+0x14): undefined reference to `std::cout' test.cc:(.text+0x19): undefined reference to `std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp; std::operator&lt;&lt; &lt;std::char_traits&lt;char&gt; &gt;(std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;, char const*)' test.cc:(.text+0x21): undefined reference to `std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp; std::endl&lt;char, std::char_traits&lt;char&gt; &gt;(std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;)' test.cc:(.text+0x29): undefined reference to `std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;::operator&lt;&lt;(std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp; (*)(std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;))' /tmp/ccyg7NDd.o: In function `__static_initialization_and_destruction_0(int, int)': test.cc:(.text+0x51): undefined reference to `std::ios_base::Init::Init()' test.cc:(.text+0x56): undefined reference to `std::ios_base::Init::~Init()' /tmp/ccyg7NDd.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status </code></pre> <p>Code:</p> <pre><code>#include&lt;iostream&gt; #include&lt;stdio.h&gt; int main(){ std::cout&lt;&lt;"test "&lt;&lt;std::endl; return 0; }; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload