compiler error 'undefined reference to G_gisinit(char const*)

4 messages Options
Embed this post
Permalink
KB

compiler error 'undefined reference to G_gisinit(char const*)

Reply Threaded More More options
Print post
Permalink
Hi,
I have installed 6.2.3 version on windows and trying to compile r.example using cygwin. I am using below command from /usr/local/grass-6.2.3 path

gcc -I ./include main.cpp

---------------------
on executing the above command I get an error 'undefined reference to ...' (all function used in r.example). Please help ...
Markus Neteler

Re: compiler error 'undefined reference to G_gisinit(char const*)

Reply Threaded More More options
Print post
Permalink
On Fri, Mar 6, 2009 at 1:39 PM, KB <[hidden email]> wrote:

>
> Hi,
> I have installed 6.2.3 version on windows and trying to compile r.example
> using cygwin. I am using below command from /usr/local/grass-6.2.3 path
>
> gcc -I ./include main.cpp
>
> ---------------------
> on executing the above command I get an error 'undefined reference to ...'
> (all function used in rater.c). Please help ...
> --

You need to add the path to the GRASS include files.

Markus
_______________________________________________
grass-windows mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-windows
KB

RE: [GRASS-windows] compiler error 'undefined reference to G_gisinit(char const*)

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Hi Markus,
 
Thanks for your reply. I have included the following files.
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <grass/gis.h>
#include <grass/Vect.h>
#include <grass/dbmi.h>
#include <grass/gisdefs.h>
 
But still getting the same error. From my understanding, gcc is able to find the definitions of function but not the implementation i.e. it is not able to link to the .dll files. I tried using following command:
 
$ gcc -I ./include -L ./lib/ main.cpp
 
but still getting the same error.
 
-------------------
 
Please suggest how to link .dll files to the sample grass code through cygwin.
 
Thanks in advance.
 
Reagrds,
Kartik
 


From: Markus Neteler (via Nabble) [mailto:[hidden email]]
Sent: Saturday, March 07, 2009 1:18 AM
To: Kartik Ballal (WT01 - Business Technology Services (FS & TMT))
Subject: Re: [GRASS-windows] compiler error 'undefined reference to G_gisinit(char const*)

On Fri, Mar 6, 2009 at 1:39 PM, KB <kartik.ballal@...> wrote:

>
> Hi,
> I have installed 6.2.3 version on windows and trying to compile r.example
> using cygwin. I am using below command from /usr/local/grass-6.2.3 path
>
> gcc -I ./include main.cpp
>
> ---------------------
> on executing the above command I get an error 'undefined reference to ...'
> (all function used in rater.c). Please help ...
> --
You need to add the path to the GRASS include files.

Markus
_______________________________________________
grass-windows mailing list
grass-windows@...
http://lists.osgeo.org/mailman/listinfo/grass-windows

Please do not print this email unless it is absolutely necessary.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

Markus Neteler

Re: compiler error 'undefined reference to G_gisinit(char const*)

Reply Threaded More More options
Print post
Permalink
On Mon, Mar 9, 2009 at 7:47 AM, KB <[hidden email]> wrote:

> Hi Markus,
>
> Thanks for your reply. I have included the following files.
>
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <string.h>
>  #include <grass/gis.h>
> #include <grass/Vect.h>
> #include <grass/dbmi.h>
> #include <grass/gisdefs.h>
>
> But still getting the same error. From my understanding, gcc is able to find
> the definitions of function but not the implementation i.e. it is not able
> to link to the .dll files. I tried using following command:
>
> $ gcc -I ./include -L ./lib/ main.cpp

Are the file like gis.h in
./include/grass/gis.h
?

Otherwise gcc won't find them.

Markus
_______________________________________________
grass-windows mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-windows