[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
XP: cannot get hostname when mixing GNU C and GNU Fortran
From: |
Cottonwood |
Subject: |
XP: cannot get hostname when mixing GNU C and GNU Fortran |
Date: |
24 May 2006 03:02:39 -0700 |
User-agent: |
G2/0.2 |
In genuine GNU Fortran 95 (2003 standard) The function `hostnm' works
fine.
When I call my Fortran modules from a C main everything works with no
problems - except the function hostnm. The line
i=hostnm(hostname)
leads to a message that says that the entry point `CreateFileA' could
not be found in the dll `WS2_32.DLL'. What I heard about that was that
the entry point `CreateFileA' should be in the dll `WS2.DLL'. But this
I think belongs to Windows CE and not to XP. Anyhow, I don't have the
lib.
Now I tried the same in genuine C environment:
#include <winsock2.h>
#include <unistd.h>
int main(void) {
char host_name[255] = {0};
int ccode;
if (( ccode = gethostname( host_name, sizeof( host_name))) != 0) {
printf( "gethostname failed, ccode = %d\n", ccode);
return EXIT_FAILURE;
}
printf( "host name: %s\n", host_name);
return EXIT_SUCCESS;
}
That leads to a message that says that the entry point `FindAtomA'
could not be found in the dll `WS2_32.DLL'.
What can I do?
- XP: cannot get hostname when mixing GNU C and GNU Fortran,
Cottonwood <=