<?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>The Error Message &#187; Visual Studio</title>
	<atom:link href="http://www.theerrormessage.com/category/visual-studio/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.theerrormessage.com</link>
	<description>Fix your error</description>
	<lastBuildDate>Tue, 13 Dec 2011 20:16:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>warning C4244: &#8216;argument&#8217; : conversion from &#8216;double&#8217; to &#8216;int&#8217;, possible loss of data</title>
		<link>http://www.theerrormessage.com/2007/08/warning-c4244-argument-conversion-from-double-to-int-possible-loss-of-data/</link>
		<comments>http://www.theerrormessage.com/2007/08/warning-c4244-argument-conversion-from-double-to-int-possible-loss-of-data/#comments</comments>
		<pubDate>Mon, 13 Aug 2007 00:54:06 +0000</pubDate>
		<dc:creator>gbl</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.theerrormessage.com/2007/08/12/warning-c4244-argument-conversion-from-double-to-int-possible-loss-of-data/</guid>
		<description><![CDATA[Full error message: warning C4244: &#8216;argument&#8217; : conversion from &#8216;double&#8217; to &#8216;int&#8217;, possible loss of data Error occured on Visual Studio 2003 when compiling a C++ project. The warning occurred because i was calling the abs function and i did not have included yet the math.h file. The reason that this warning appeared was due [...]]]></description>
			<content:encoded><![CDATA[<p>Full error message: <em>warning C4244: &#8216;argument&#8217; : conversion from &#8216;double&#8217; to &#8216;int&#8217;, possible loss of data</em></p>
<p>Error occured on Visual Studio 2003 when compiling a C++ project.</p>
<p>The warning occurred because i was calling the <strong>abs</strong> function and i did not have included yet the <strong>math.h</strong> file. The reason that this warning appeared was due to the abs function that was already loaded with other libraries (stdlib.h) and it had only one defined as <em>int abs(int)</em> but I needed the <em>double abs(double)</em> overload. This way the compiler needed to let me know about the implicit cast from double to int.</p>
<p>Example:</p>
<pre class="code brush:cpp">double y = 1.2454;
double x = abs((double)y);</pre>
<p>Fix:</p>
<pre class="code brush:cpp">#include &lt;math.h&gt;</pre>
<p>The fix in my case is the following code added to the header of the file <strong>#include &lt;math.h&gt;</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.theerrormessage.com/2007/08/warning-c4244-argument-conversion-from-double-to-int-possible-loss-of-data/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>error C2724: &#8216;ClassName::FunctionName&#8217; : &#8216;static&#8217; should not be used on member functions defined at file scope</title>
		<link>http://www.theerrormessage.com/2007/07/error-c2724-classnamefunctionname-static-should-not-be-used-on-member-functions-defined-at-file-scope/</link>
		<comments>http://www.theerrormessage.com/2007/07/error-c2724-classnamefunctionname-static-should-not-be-used-on-member-functions-defined-at-file-scope/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 10:03:11 +0000</pubDate>
		<dc:creator>gbl</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.theerrormessage.com/2007/07/30/error-c2724-classnamefunctionname-static-should-not-be-used-on-member-functions-defined-at-file-scope/</guid>
		<description><![CDATA[Full error message: error C2724: &#8216;ClassName::FunctionName&#8217; : &#8216;static&#8217; should not be used on member functions defined at file scope Error occurred in Visual Studio 2003 while declaring a static function. Header file: class MyClass { public: static void FunctionName(); }; Source file: static void MyClass::FunctionName() { return 0; } The error occurs because i used [...]]]></description>
			<content:encoded><![CDATA[<p>Full error message:  <em>error C2724: &#8216;ClassName::FunctionName&#8217; : &#8216;static&#8217; should not be used on member functions defined at file scope</em></p>
<p>Error occurred in Visual Studio 2003 while declaring a static function.</p>
<p>Header file:</p>
<pre class="code brush:cpp">class MyClass {
public:
static void FunctionName();
};</pre>
<p>Source file:</p>
<pre class="code brush:cpp">static void MyClass::FunctionName() {
return 0;
}
</pre>
<p>The error occurs because i used the &#8216;static&#8217; modifier in the source file as well as the header file.</p>
<p>The fix is: <strong>Remove the &#8216;static&#8217; modifier from the source file</strong></p>
<p>So the code in the source file will become:</p>
<pre class="code brush:cpp">void MyClass::FunctionName() {
return 0;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.theerrormessage.com/2007/07/error-c2724-classnamefunctionname-static-should-not-be-used-on-member-functions-defined-at-file-scope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>error LNK2001: unresolved external symbol private: static &#8230;</title>
		<link>http://www.theerrormessage.com/2007/07/error-lnk2001-unresolved-external-symbol-private-static/</link>
		<comments>http://www.theerrormessage.com/2007/07/error-lnk2001-unresolved-external-symbol-private-static/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 01:27:20 +0000</pubDate>
		<dc:creator>gbl</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.theerrormessage.com/2007/07/19/error-lnk2001-unresolved-external-symbol-private-static/</guid>
		<description><![CDATA[Full error message: error LNK2001: unresolved external symbol &#8220;private: static &#60;type&#62; * &#60;Class&#62;::&#60;memberVariable&#62;&#8221; (?&#60;memberVariable&#62;@&#60;C@@0PADA) Error occured on Visual Studio 2003 when compiling a C++ project. The error occurred because memberVariable was a static variable and it wasn&#8217;t initialized. Example: class A { static char * filename; static void F(void); } ; Fix: char * A::filename [...]]]></description>
			<content:encoded><![CDATA[<p>Full error message: <em>error LNK2001: unresolved external symbol &#8220;private: static &lt;type&gt; * &lt;Class&gt;::&lt;memberVariable&gt;&#8221; (?&lt;memberVariable&gt;@&lt;C@@0PADA)</em></p>
<p>Error occured on Visual Studio 2003 when compiling a C++ project.</p>
<p>The error occurred because <em>memberVariable </em>was a static variable and it wasn&#8217;t initialized.</p>
<p>Example:</p>
<pre class="code brush:cpp">class A {
static char * filename;
static void F(void);
} ;</pre>
<p>Fix:</p>
<pre class="code brush:cpp">char * A::filename = NULL;</pre>
<p>The fix in my case is the following code added to the implementation of the &lt;Class&gt;:<br />
<strong>&lt;type&gt;  &lt;Class&gt;::&lt;memberVariable&gt; = &lt;initValue&gt;;</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.theerrormessage.com/2007/07/error-lnk2001-unresolved-external-symbol-private-static/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

