Re: GMT 5 API simple question

Mikhail Tchernychev <[email protected]>
Newsgroups gmane.comp.gis.gmt.user
Message-ID <[email protected]>
Hi,

File "startup_win.bat" did not define GMT5_SHAREDIR or GMT_SHAREDIR
It might be declared  system-wide by installer, but I did not let it do it.

I would expect BAT file to declare it locally.

Also,  either of  GMT5_SHAREDIR or GMT_SHAREDIR make 
GMT_Create_Session() work.

Best Regards,

Mikhail


On 11/19/2013 2:22 AM, Joaquim Luis wrote:
> The Windows installers declare the GMT5_SHAREDIR variable. We use 
> GMT5_... because a GMT_SHAREDIR may exist if GMT4 is installed but it 
> should otherwise play exactly the same role. If it doesn't, than we 
> have a bug.
>
> Joaquim
>
>
>> Yes, if I set under windows GMT_SHAREDIR=C:\gmt5\share (my gmt5 
>> location) API object  is
>> created.
>>
>> But it means that all GMT based programs must have GMT share dir, and 
>> possibly have coatsline
>> files as well (?)
>>
>> It also appeared that GMT shell created by the installer does not 
>> have this variable,
>> because my example cannot create API object if it is ran under that 
>> cmd window.
>>
>> Mikhail
>>
>> On 11/18/2013 11:00 PM, Mikhail Tchernychev wrote:
>>> I was debugging this issue and found that it is related to 
>>> "GMT_SHAREDIR", VERSION file
>>> and fonts and could be something else. All these variables should be 
>>> set correctly for API program to work (I did not make it so far).
>>> Despite excessive diagnostic in GMT code there is nothing which 
>>> comes to stderr.
>>>
>>> I was debugging under Linux
>>>
>>> Would be it possible to enable all that build-in diagnostic for API?
>>>
>>> Best Regards
>>>
>>> Mikhail
>>>
>>> On 11/18/2013 10:18 PM, Mikhail Tchernychev wrote:
>>>> Hi Paul,
>>>>
>>>> Unfortunately it did not look like "windows only" problem.
>>>> I've just re-compiled under Linux using one of the latest dev packages
>>>> and got the same.
>>>>
>>>> I used command to compile:
>>>>
>>>>  c++ -o mytest -I ../src  mytest.cpp -L ../build/src/ -lgmt
>>>>
>>>> then
>>>>
>>>> export LD_LIBRARY_PATH=../build/src/
>>>>
>>>> Everything compiles  and runs, but apparently GMT_Create_Session just
>>>> exits the program.
>>>>
>>>> I tried "NULL" in place function pointer; result is the same.
>>>>
>>>> Do we need some #define setting to compile it?
>>>>
>>>> Best Regards
>>>> Mikhail
>>>>
>>>> On 11/18/2013 6:52 PM, Paul Wessel wrote:
>>>>> 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] <mailto:[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 
>>>>>> <http://gmt.soest.hawaii.edu/files/download?name=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] <mailto:[email protected]> 
>>>>>
>>>>> To unsubscribe, send the message "signoff gmt-help" to 
>>>>> [email protected] 
>>>>
>>>>
>>>> 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] 
>>>
>>>
>>> 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] 
>>
>>
>> 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] 
>



<html>
<body>
<FONT face=  "Arial" size=  "-1">
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
</FONT>
</body>
</html>

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.