Re: GMT 5 API simple question

Paul Wessel <[email protected]>
Newsgroups gmane.comp.gis.gmt.user
Message-ID <[email protected]>
Mikhail-

Unless Joaquim has tried I don't think anyone has tried this under Windows yet.  Thanks for being our first!

If it dies in GMT_Create_Session then it would be interesting to run it in debug and see what goes on.  Probably something simple that just has not been tested.  Given your print_func you might as well just pass NULL instead, but doubt that would make a difference
Joaquim, could you try this and see what is happening?

-p

On Nov 18, 2013, at 3:41 PM, Mikhail Tchernychev <[email protected]> wrote:

> Hi,
> 
> I am just trying to compile very simple example with GMT 5.0 API
> using VS 2010 Express. Here is the code:
> 
> // sample1.cpp : Defines the entry point for the console application.
> //
> 
> #include <stdio.h>
> #include <stdlib.h>
> 
> #include "gmt.h"
> 
> int print_func(FILE * dat, const char * msg) {
>     fprintf(stderr,"Message: %s\n", msg);
>     return 1;
> }
> 
> 
> int main(int argc, char ** )
> {
> 
>     fprintf(stderr,"Point 1\n");
>     void *API = GMT_Create_Session ("Session name", 2, 0, print_func);
>     if(API) {
>         fprintf(stderr,"Created GMT API!\n");
>     }
>     return 0;
> }
> 
> Everything compiles and runs just fine after I added GMT dlls in the PATH.
> 
> But functions GMT_Create_Session just does hard exit no matter what
> (Point "Created GMT API!" never reached).
> 
> Am I missing something simple?  Is there any examples if API based code?
> 
> I am using binary file "gmt-5.1.0-win32.exe"
> 
> That you!
> 
> Mikhail
> 
> 
> 
> 
> 
> 
> 
> 
> 
> PLEASE NOTE: This message, including any attachments, may 
> include privileged, confidential and/or inside information. Any 
> dissemination, distribution or copy of this communication by   
> anyone other than the intended recipient is strictly 
> prohibited. If you are not the intended recipient, please 
> notify the sender by replying to this message and then delete 
> it from your system. Information provided via electronic media 
> is not guaranteed against defects including translation and 
> transmission errors. The company accepts no liability for any 
> damage caused by any virus transmitted by this email.
>   
> Geometrics Inc.
> 2190 Fortune Drive
> San Jose, CA 95131 USA
> 
> 
> 
> 
> To unsubscribe, send the message "signoff gmt-help" to [email protected]


To unsubscribe, send the message "signoff gmt-help" to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.