Deutsch   English   Français   Italiano  
<vl6ttj$3gjs7$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Lynn McGuire <lynnmcguire5@gmail.com>
Newsgroups: comp.lang.fortran
Subject: Re: how do you send a fortran character string from GCC to GFortran ?
Date: Thu, 2 Jan 2025 14:45:36 -0600
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <vl6ttj$3gjs7$1@dont-email.me>
References: <vl5ima$38li7$1@dont-email.me> <vl5og3$39nmu$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 02 Jan 2025 21:45:42 +0100 (CET)
Injection-Info: dont-email.me; posting-host="a597348658c577a106018179e3bd4feb";
	logging-data="3690375"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/xTrQQbtSXir+cB9dqB4KpKiLtujq7ON0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:oEsvdCCTzY2X9M1pq/lB9SXEoaA=
In-Reply-To: <vl5og3$39nmu$2@dont-email.me>
Content-Language: en-US
Bytes: 2357

On 1/2/2025 4:06 AM, Thomas Koenig wrote:
> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>> How do you send a fortran character string from GCC to GFortran ?
>>
>> I cannot get this to link.  I can do the reverse, send a fortran
>> character string from Gfortran to GCC.
> 
> A full, self-contained example would be helpful for somebody trying to
> help (especially since you say "link", which seems weird).
> 
> But take a look at
> 
> https://gcc.gnu.org/onlinedocs/gfortran/Naming-and-argument-passing-conventions.html
> 
>> I do have the additional complication that I do not know the length of
>> the fortran character string being sent from GCC to Gfortran at compile
>> time, only run time.  So that is a character*(*) string.
>>
>> I am not using the ISO C binding.
> 
> It is generally a good idea to use ISO C binding in new code, it
> is what it was introduced for.
> 
> But you might also find
> 
> https://gcc.gnu.org/onlinedocs/gfortran/Interoperability-Options.html
> 
> of interest.

Thanks !  When I was writing the reply to you, I figured out the 
problem.  I forgot to put 'extern "C"' in front of the function 
declaration for my fortran code.  That fixed my link.

It is the little things that get you.

Thanks,
Lynn