<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Building PostGIS using Visual C++</title>
	<atom:link href="http://mateusz.loskot.net/2009/03/29/building-postgis-using-visual-cpp/feed/" rel="self" type="application/rss+xml" />
	<link>http://mateusz.loskot.net/2009/03/29/building-postgis-using-visual-cpp/</link>
	<description>mloskot&#039;s life, programming, c++, geo and adventures</description>
	<lastBuildDate>Tue, 24 Jan 2012 22:38:47 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: mloskot</title>
		<link>http://mateusz.loskot.net/2009/03/29/building-postgis-using-visual-cpp/comment-page-1/#comment-2494</link>
		<dc:creator>mloskot</dc:creator>
		<pubDate>Sun, 18 Oct 2009 14:10:18 +0000</pubDate>
		<guid isPermaLink="false">http://mateusz.loskot.net/?p=326#comment-2494</guid>
		<description>Try to compile your program as &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/032xwy55%28VS.71%29.aspx&quot; rel=&quot;nofollow&quot;&gt;C not C++&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Try to compile your program as <a href="http://msdn.microsoft.com/en-us/library/032xwy55%28VS.71%29.aspx" rel="nofollow">C not C++</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: baluku</title>
		<link>http://mateusz.loskot.net/2009/03/29/building-postgis-using-visual-cpp/comment-page-1/#comment-2490</link>
		<dc:creator>baluku</dc:creator>
		<pubDate>Thu, 15 Oct 2009 08:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://mateusz.loskot.net/?p=326#comment-2490</guid>
		<description>hi gurus,
  i have trouble compiling a c style program ( filename with extension cpp) written for visual C++.
When i added the following #includes,
&gt;&gt;&gt; #include &quot;spi.h&quot;
&gt;&gt;&gt; #include &quot;trigger.h&quot;
compilation errors say &quot;error C2899: typename cannot be used outside a template declaration&quot;.
I need the above includes for postgres triggers.

If the above #includes were removed, leaving behind  
&gt;&gt;&gt;#include &quot;postgres.h&quot;
&gt;&gt;&gt;#include &quot;fmgr.h&quot;
then there is no compilation error.

A check on msdn reveals that the error is because in visual c++, the word &quot;typename&quot; is a keyword.
Unfortunately, it happens ( coincidence) that postgres also uses the word &quot;typename&quot; in its header files, as in below - 
typedef struct ColumnDef
{
	NodeTag		type;
	char	   *colname;		/* name of column */
	TypeName   *typename;		/* type of column */
...
}

I have thought of making visual c++ of not recognizing &quot;typename&quot; as a keyword, say, by turning some compiler options to forced c mode ( rather than c++).
Is there indeed such an option? If not, is there a way to resolve my problem as described above?

thanks and regards,
baluku</description>
		<content:encoded><![CDATA[<p>hi gurus,<br />
  i have trouble compiling a c style program ( filename with extension cpp) written for visual C++.<br />
When i added the following #includes,<br />
&gt;&gt;&gt; #include &#8220;spi.h&#8221;<br />
&gt;&gt;&gt; #include &#8220;trigger.h&#8221;<br />
compilation errors say &#8220;error C2899: typename cannot be used outside a template declaration&#8221;.<br />
I need the above includes for postgres triggers.</p>
<p>If the above #includes were removed, leaving behind<br />
&gt;&gt;&gt;#include &#8220;postgres.h&#8221;<br />
&gt;&gt;&gt;#include &#8220;fmgr.h&#8221;<br />
then there is no compilation error.</p>
<p>A check on msdn reveals that the error is because in visual c++, the word &#8220;typename&#8221; is a keyword.<br />
Unfortunately, it happens ( coincidence) that postgres also uses the word &#8220;typename&#8221; in its header files, as in below &#8211;<br />
typedef struct ColumnDef<br />
{<br />
	NodeTag		type;<br />
	char	   *colname;		/* name of column */<br />
	TypeName   *typename;		/* type of column */<br />
&#8230;<br />
}</p>
<p>I have thought of making visual c++ of not recognizing &#8220;typename&#8221; as a keyword, say, by turning some compiler options to forced c mode ( rather than c++).<br />
Is there indeed such an option? If not, is there a way to resolve my problem as described above?</p>
<p>thanks and regards,<br />
baluku</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mloskot</title>
		<link>http://mateusz.loskot.net/2009/03/29/building-postgis-using-visual-cpp/comment-page-1/#comment-2343</link>
		<dc:creator>mloskot</dc:creator>
		<pubDate>Mon, 06 Apr 2009 11:38:10 +0000</pubDate>
		<guid isPermaLink="false">http://mateusz.loskot.net/?p=326#comment-2343</guid>
		<description>If you are using PostgreSQL 8.3, what I&#039;ve understood from the fact you are reading docs for 8.3 and these functions do not work for you with MinGW buid as well as Visual C++ build, then something is wrong with these functions in the manual or you are doing something wrong.

Anyway, it seems to has nothing to do with Visual C++ build I explained in this post. Likely, you need some support about PostgreSQL, so write to the mailing list or step in IRC channel #postgresql and ask PostgreSQL folks.

Sorry, but I&#039;m not here to provide you with general support about PostgreSQL, there are community tools for that purpose.</description>
		<content:encoded><![CDATA[<p>If you are using PostgreSQL 8.3, what I&#8217;ve understood from the fact you are reading docs for 8.3 and these functions do not work for you with MinGW buid as well as Visual C++ build, then something is wrong with these functions in the manual or you are doing something wrong.</p>
<p>Anyway, it seems to has nothing to do with Visual C++ build I explained in this post. Likely, you need some support about PostgreSQL, so write to the mailing list or step in IRC channel #postgresql and ask PostgreSQL folks.</p>
<p>Sorry, but I&#8217;m not here to provide you with general support about PostgreSQL, there are community tools for that purpose.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GIS_CORE</title>
		<link>http://mateusz.loskot.net/2009/03/29/building-postgis-using-visual-cpp/comment-page-1/#comment-2342</link>
		<dc:creator>GIS_CORE</dc:creator>
		<pubDate>Mon, 06 Apr 2009 09:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://mateusz.loskot.net/?p=326#comment-2342</guid>
		<description>I have checked several function of the postgis that i build using Mateusz Loskot build solution, all works fine. the problem are if i create any a new function similar to the examples in the Postgresql documentation
 
http://www.postgresql.org/docs/8.3/interactive/xfunc-c.html

the functions bring error when i create it in the database. the only data type that works with no error are int32.

Is there any direction to solve the problem, its the same problem i faced when i try to create GIS function for postgresql using MinGW. the function i wrote like the above example is exactly from the Postgresql documentation.</description>
		<content:encoded><![CDATA[<p>I have checked several function of the postgis that i build using Mateusz Loskot build solution, all works fine. the problem are if i create any a new function similar to the examples in the Postgresql documentation</p>
<p><a href="http://www.postgresql.org/docs/8.3/interactive/xfunc-c.html" rel="nofollow">http://www.postgresql.org/docs/8.3/interactive/xfunc-c.html</a></p>
<p>the functions bring error when i create it in the database. the only data type that works with no error are int32.</p>
<p>Is there any direction to solve the problem, its the same problem i faced when i try to create GIS function for postgresql using MinGW. the function i wrote like the above example is exactly from the Postgresql documentation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mloskot</title>
		<link>http://mateusz.loskot.net/2009/03/29/building-postgis-using-visual-cpp/comment-page-1/#comment-2341</link>
		<dc:creator>mloskot</dc:creator>
		<pubDate>Sun, 05 Apr 2009 23:00:22 +0000</pubDate>
		<guid isPermaLink="false">http://mateusz.loskot.net/?p=326#comment-2341</guid>
		<description>I think this error is not related to the function you added. It&#039;s something wrong with PostGIS installation. Perhaps PostgreSQL vs PostGIS vs GEOS versions are incompatible.
Have you checked if PostGIS functions work, like version reporting ones?

There is &lt;a href=&quot;http://postgis.refractions.net/pipermail/postgis-users/2006-January/010668.html&quot; rel=&quot;nofollow&quot;&gt;something&lt;/a&gt; about similar problem on PostGIS mailing list.
I really doubt this simple function causes problems, especially that very similar function is presented in the PostgreSQL manual.</description>
		<content:encoded><![CDATA[<p>I think this error is not related to the function you added. It&#8217;s something wrong with PostGIS installation. Perhaps PostgreSQL vs PostGIS vs GEOS versions are incompatible.<br />
Have you checked if PostGIS functions work, like version reporting ones?</p>
<p>There is <a href="http://postgis.refractions.net/pipermail/postgis-users/2006-January/010668.html" rel="nofollow">something</a> about similar problem on PostGIS mailing list.<br />
I really doubt this simple function causes problems, especially that very similar function is presented in the PostgreSQL manual.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GIS_CORE</title>
		<link>http://mateusz.loskot.net/2009/03/29/building-postgis-using-visual-cpp/comment-page-1/#comment-2340</link>
		<dc:creator>GIS_CORE</dc:creator>
		<pubDate>Sun, 05 Apr 2009 12:44:28 +0000</pubDate>
		<guid isPermaLink="false">http://mateusz.loskot.net/?p=326#comment-2340</guid>
		<description>I have added the function in the definition, the function can be added, however when trying to execute, the following error comes

ERROR:  invalid memory alloc request size 4294967293


********** Fehler **********

ERROR: invalid memory alloc request size 4294967293
SQL Status:XX000



my function is really simple and here it is

PG_FUNCTION_INFO_V1(CORE_TEST);
Datum CORE_TEST(PG_FUNCTION_ARGS)
{
    /* The macros for FLOAT8 hide its pass-by-reference nature. */
    float8   arg = PG_GETARG_FLOAT8(0);

    PG_RETURN_FLOAT8(arg + 1.0);

}


should i modify any other files.
Thanks</description>
		<content:encoded><![CDATA[<p>I have added the function in the definition, the function can be added, however when trying to execute, the following error comes</p>
<p>ERROR:  invalid memory alloc request size 4294967293</p>
<p>********** Fehler **********</p>
<p>ERROR: invalid memory alloc request size 4294967293<br />
SQL Status:XX000</p>
<p>my function is really simple and here it is</p>
<p>PG_FUNCTION_INFO_V1(CORE_TEST);<br />
Datum CORE_TEST(PG_FUNCTION_ARGS)<br />
{<br />
    /* The macros for FLOAT8 hide its pass-by-reference nature. */<br />
    float8   arg = PG_GETARG_FLOAT8(0);</p>
<p>    PG_RETURN_FLOAT8(arg + 1.0);</p>
<p>}</p>
<p>should i modify any other files.<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mloskot</title>
		<link>http://mateusz.loskot.net/2009/03/29/building-postgis-using-visual-cpp/comment-page-1/#comment-2339</link>
		<dc:creator>mloskot</dc:creator>
		<pubDate>Sun, 05 Apr 2009 12:19:40 +0000</pubDate>
		<guid isPermaLink="false">http://mateusz.loskot.net/?p=326#comment-2339</guid>
		<description>Hi GIS_CORE,
I&#039;m glad you&#039;ve found it helpful.

I suppose that you have not added the new function to postgis/postgis.def file. I configured PostGIS build to &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/d91k01sh(VS.80).aspx&quot; rel=&quot;nofollow&quot;&gt;export functions using DEF file&lt;/a&gt;.

BTW, if you&#039;ll find a bug or something misconfigurated, reports are welcome.</description>
		<content:encoded><![CDATA[<p>Hi GIS_CORE,<br />
I&#8217;m glad you&#8217;ve found it helpful.</p>
<p>I suppose that you have not added the new function to postgis/postgis.def file. I configured PostGIS build to <a href="http://msdn.microsoft.com/en-us/library/d91k01sh(VS.80).aspx" rel="nofollow">export functions using DEF file</a>.</p>
<p>BTW, if you&#8217;ll find a bug or something misconfigurated, reports are welcome.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GIS_CORE</title>
		<link>http://mateusz.loskot.net/2009/03/29/building-postgis-using-visual-cpp/comment-page-1/#comment-2338</link>
		<dc:creator>GIS_CORE</dc:creator>
		<pubDate>Sun, 05 Apr 2009 12:16:02 +0000</pubDate>
		<guid isPermaLink="false">http://mateusz.loskot.net/?p=326#comment-2338</guid>
		<description>I was able to compile and successfully create the data base as stated above, many thanks to Mateusz Loskot.
I am trying to add a new function to the dll library, however, after successfully compiling the postgis with the new function added, copying the  dll back to the lib directory, the function faild to be recognized or added.
Would you please assist me to add my own functions correctly to the library   so they will be recognized, I mean if there is some kind of steps to follow or the files needs to be modified in order to add my new function.

Thanks</description>
		<content:encoded><![CDATA[<p>I was able to compile and successfully create the data base as stated above, many thanks to Mateusz Loskot.<br />
I am trying to add a new function to the dll library, however, after successfully compiling the postgis with the new function added, copying the  dll back to the lib directory, the function faild to be recognized or added.<br />
Would you please assist me to add my own functions correctly to the library   so they will be recognized, I mean if there is some kind of steps to follow or the files needs to be modified in order to add my new function.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>

