<div dir="ltr">Hi Sylvain,<div><br></div><div>Thanks for taking time to look into the issue. For a purely different purpose, I uninstalled both of Postgres and PostGIS, did <b>make distclean maintainer-clean</b> in Postgres, then installed Postgres/PostGIS and Eclipse was able to figure out the configurations without adding flags!</div><div><br></div><div>For reference: I run postgresql-9.4.4 and postgis-2.2.0devĀ </div><div><br></div><div>Best,</div><div>Ruby</div>















</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 6, 2015 at 7:24 PM, Sylvain Racine <span dir="ltr"><<a href="mailto:sracine@igreffe.net" target="_blank">sracine@igreffe.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Ruby,<br>
<br>
I programmed this afternoon a postGIS query test in C++ with Eclipse. I encountered some issues with the compiler and the linker in order to add libpq library to my project. If it is yours, please refers to this page:<br>
<a href="http://www.postgresql.org/docs/9.1/static/libpq-build.html" rel="noreferrer" target="_blank">http://www.postgresql.org/docs/9.1/static/libpq-build.html</a><br>
<br>
I had to add three flags to Eclipse Mars 1 release 4.5.1 to get a perfect compilation. One is located in Project/Properties/C/C++ Build/Settings/GCC C++ Compiler/Miscellaneous/Other flags. I added '-c -I/usr/include/postgresql ' where /usr/include/postgresql is path returned by typing in a shell pg_config --includedir. The other one is located in Project/Properties/C/C++ Build/Settings/GCC C++ Linker/Libraries/Library search path. I added '/usr/lib/x86_64-linux-gnu' where this path is returned by typing in a shell pg_config --libdir. The last one is located in Project/Properties/C/C++ Build/Settings/GCC C++ Linker/Miscellaneous/Other object . I added '-lpq'.<br>
<br>
After that, I programmed a parametric query with both non-spatial and spatial fields. Notice that with libpq library, there are two modes to return result: binary and text modes. I chose text mode. Everything worked fine without any error message.<br>
<br>
I don't know which language that you program in Eclipse.<br>
<br>
Hope that this hint will help you<br>
<span class=""><br>
Regards<br>
<br>
Sylvain Racine<br>
<br>
<br>
----------------original message-----------------<br>
De: "Ruby Tahboub" <a href="mailto:ruby.tahboub@gmail.com">ruby.tahboub@gmail.com</a><br>
</span>A: "PostGIS Users Discussion"<br>
Date: Thu, 5 Nov 2015 17:33:02 -0500<br>
-------------------------------------------------<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
> I can run Postgres/ PostGIS from command line. No, I'm not using plugins, I<br>
> use eclipse to debug the backend code, it works for Postgresql queries but<br>
> it gives error for anything spatial. I suspect it's an eclipse<br>
> configuration.<br>
><br>
> On Thu, Nov 5, 2015 at 4:41 PM, Sylvain Racine <a href="mailto:sracine@igreffe.net">sracine@igreffe.net</a> wrote:<br>
><br>
>> Hi Ruby,<br>
>><br>
>> Do you talk about compiling PostGIS in C++ with Eclipse or to access<br>
>> PostgreSQL DB with a SQL plugin in Eclipse? If yes, please indicate the<br>
>> name of your plugin.<br>
>><br>
>> Regards<br>
>><br>
>> Sylvain Racine<br>
>><br>
>><br>
>> ----------------original message-----------------<br>
>> De: "Ruby Tahboub" <a href="mailto:ruby.tahboub@gmail.com">ruby.tahboub@gmail.com</a><br>
>> A: <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
>> Date: Thu, 5 Nov 2015 15:15:31 -0500<br>
>> -------------------------------------------------<br>
>><br>
>><br>
>> > Dear All,<br>
>> ><br>
>> > I need help with configuring PostGIS to run from Eclipse. I already have<br>
>> > Postgres/PostGIS installed, and I can run Postgres from Eclipse.<br>
>> ><br>
>> > When I type a query with a spatial predicate, I get the following error<br>
>> > from parser:<br>
>> ><br>
>> > ERROR: could not access file "$libdir/postgis-2.2": No such file or<br>
>> > directory<br>
>> ><br>
>> > Thanks!<br>
>> ><br>
>> > Ruby<br>
>> ><br>
>><br>
>> __________________________________________________<br>
>> > _______________________________________________<br>
>> > postgis-users mailing list<br>
>> > <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
>> > <a href="http://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
>><br>
>> --<br>
>><br>
>><br>
>> _______________________________________________<br>
>> postgis-users mailing list<br>
>> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
><br>
<br>
__________________________________________________<br>
> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
<br>
--<br>
<br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/postgis-users</a></div></div></blockquote></div><br></div>