<?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>Wed, 25 Apr 2012 21:10:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</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>
 <p><a href="http://soledadpenades.com/?flattrss_redirect&amp;id=2193&amp;md5=b74130a758b683fde9b9667f356a1fa0" title="Flattr" target="_blank"><img src="http://soledadpenades.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></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>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=8399&amp;amp;url=http%3A%2F%2Fsoledadpenades.com%2F2009%2F11%2F25%2Fnetbeans-unable-to-resolve-identifier-std-error%2F&amp;amp;language=en_GB&amp;amp;category=text&amp;amp;title=NetBeans%26%238217%3B+%26%238220%3BUnable+to+resolve+identifier+std%26%238221%3B+error&amp;amp;description=Tried+to+use+some+C%2B%2B+STL+includes+to+no+avail.+But+it+was+odd%2C+NetBeans+was+underlining+my+include%27s+with+a+red+groovy+line%2C+and+still+managed+to+compile+successfully+%28obvious%2C+because+gcc+is+the+compiler%2C+not+NB%29.%0D%0A%0D%0ASo+this%3A%0D%0A%0D%0A%0D%0A%23include+%0D%0A%0D%0A%0D%0Aand%0D%0A%0D%0A%0D%0Astd%3A%3Astring+m_strTest%3B%0D%0A%0D%0A%0D%0Awere+both+underlined%2C+and+a+%22Unable+to+resolve+identifier+std%22+error+appeared+to+the+left%2C+with+the+classic+question+mark+with+red+background+signal.%0D%0A%0D%0AI+was+using+NB+6.7%3B+tried+with+NB+6.8+Beta+and+the+problem+persisted.%0D%0A%0D%0ABut+turns+out+it+was+a+very+simple+fix.+Thanks+to+this+post+which+suggested+to+use+CTRL%2BALT+when+hovering+over+include%27s%2C+I+found+out+that+several+include+paths+such+as+%2Fusr%2Flib%2Finclude%2Fc%2B%2B%2F4.3+weren%27t+found+%28they+were+marked+in+red%2C+not+surprisingly%29.+So+if+netbeans+couldn%27t+find+those+directories%2C+it+wasn%27t+able+to+determine+whether+std%3A%3A+was+a+proper+identifier+or+not.%0D%0A%0D%0ASimple+test%3A%0D%0A%0D%0A%0D%0Asole%40courgette%3A%7E%24+ls+-la+%2Fusr%2Finclude%2Fc%2B%2B%0D%0Atotal+20%0D%0Adrwxr-xr-x++3+root+root++4096+2009-11-01+11%3A47+.%0D%0Adrwxr-xr-x+65+root+root+12288+2009-11-24+17%3A18+..%0D%0Adrwxr-xr-x+10+root+root++4096+2009-11-01+11%3A22+4.4%0D%0Alrwxrwxrwx++1+root+root+++++3+2009-11-01+11%3A22+4.4.1+-%3E+4.4%0D%0A%0D%0A%0D%0Aahh+so+it%27s+not+4.3+but+4.4%21%0D%0A%0D%0ASo+I+went+to+Tools+-%3E+Options+-%3E+C%2FC%2B%2B+-%3E+Code+Assistance+and+replaced+the+occurrences+of+4.3+with+4.4+where+appropriate.+All+worked+perfectly+from+that+point+onwards.%0D%0A%0D%0AIt%27s+strange%3B+I+don%27t+remember+having+updated+GCC+recently+%28apart+from+the+update+to+Karmic+Koala%29.+In+any+case+I+hadn%27t+been+using+NetBeans+with+C%2B%2B+and+std+recently+either%2C+so+maybe+the+problem+was+there+waiting+for+me+to+stumble+upon+it+%3A-%29&amp;amp;tags=cpp%2Cnetbeans%2Cstl%2Cblog" type="text/html" />
	</item>
	</channel>
</rss>

