<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>soledad penadés &#187; stl</title>
	<atom:link href="http://soledadpenades.com/tag/stl/feed/" rel="self" type="application/rss+xml" />
	<link>http://soledadpenades.com</link>
	<description>repeat 4[fd 100 rt 90]</description>
	<lastBuildDate>Sun, 29 Jan 2012 23:03:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>NetBeans&#8217; &#8220;Unable to resolve identifier std&#8221; error</title>
		<link>http://soledadpenades.com/2009/11/25/netbeans-unable-to-resolve-identifier-std-error/</link>
		<comments>http://soledadpenades.com/2009/11/25/netbeans-unable-to-resolve-identifier-std-error/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 14:50:17 +0000</pubDate>
		<dc:creator>sole</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[stl]]></category>

		<guid isPermaLink="false">http://soledadpenades.com/?p=2193</guid>
		<description><![CDATA[Tried to use some C++ STL includes to no avail. But it was odd, NetBeans was underlining my include&#8217;s with a red groovy line, and still managed to compile successfully (obvious, because gcc is the compiler, not NB). So this: #include &#60;string&#62; and std::string m_strTest; were both underlined, and a &#8220;Unable to resolve identifier std&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Tried to use some C++ STL includes to no avail. But it was odd, NetBeans was underlining my include&#8217;s with a red groovy line, and still managed to compile successfully (obvious, because gcc is the compiler, not NB).</p>
<p>So this:</p>
<div class="syhi_block"><code><span style="color: #339900;">#include &lt;string&gt;</span></code></div>
<p>and</p>
<div class="syhi_block"><code>std<span style="color: #008080;">::</span><span style="color: #007788;">string</span> m_strTest<span style="color: #008080;">;</span></code></div>
<p>were both underlined, and a &#8220;Unable to resolve identifier std&#8221; error appeared to the left, with the classic question mark with red background signal.</p>
<p>I was using NB 6.7; tried with NB 6.8 Beta and the problem persisted.</p>
<p>But turns out it was a very simple fix. Thanks to <a href="http://forums.netbeans.org/topic9958.html">this post</a> which suggested to use CTRL+ALT when hovering over include&#8217;s, I found out that several include paths such as <strong>/usr/lib/include/c++/4.3</strong> weren&#8217;t found (they were marked in red, not surprisingly). So if netbeans couldn&#8217;t find those directories, it wasn&#8217;t able to determine whether std:: was a proper identifier or not.</p>
<p>Simple test:</p>
<div class="syhi_block"><code>sole<span style="color: #000000; font-weight: bold;">@</span>courgette:~$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-la</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">c++</span><br />
total <span style="color: #000000;">20</span><br />
drwxr-xr-x &nbsp;<span style="color: #000000;">3</span> root root &nbsp;<span style="color: #000000;">4096</span> <span style="color: #000000;">2009</span>-<span style="color: #000000;">11</span>-01 <span style="color: #000000;">11</span>:<span style="color: #000000;">47</span> .<br />
drwxr-xr-x <span style="color: #000000;">65</span> root root <span style="color: #000000;">12288</span> <span style="color: #000000;">2009</span>-<span style="color: #000000;">11</span>-<span style="color: #000000;">24</span> <span style="color: #000000;">17</span>:<span style="color: #000000;">18</span> ..<br />
drwxr-xr-x <span style="color: #000000;">10</span> root root &nbsp;<span style="color: #000000;">4096</span> <span style="color: #000000;">2009</span>-<span style="color: #000000;">11</span>-01 <span style="color: #000000;">11</span>:<span style="color: #000000;">22</span> <span style="color: #000000;">4.4</span><br />
lrwxrwxrwx &nbsp;<span style="color: #000000;">1</span> root root &nbsp; &nbsp; <span style="color: #000000;">3</span> <span style="color: #000000;">2009</span>-<span style="color: #000000;">11</span>-01 <span style="color: #000000;">11</span>:<span style="color: #000000;">22</span> 4.4.1 -<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;">4.4</span></code></div>
<p>ahh so it&#8217;s not 4.<strong>3</strong> but 4.<strong>4</strong>!</p>
<p>So I went to <strong>Tools -> Options -> C/C++ -> Code Assistance</strong> and replaced the occurrences of 4.3 with 4.4 where appropriate. All worked perfectly from that point onwards.</p>
<p>It&#8217;s strange; I don&#8217;t remember having updated GCC recently (apart from the update to Karmic Koala). In any case I hadn&#8217;t been using NetBeans with C++ and std recently either, so maybe the problem was there waiting for me to stumble upon it :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://soledadpenades.com/2009/11/25/netbeans-unable-to-resolve-identifier-std-error/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

