Connecting Tech Pros Worldwide Forums | Help | Site Map

Gethostname, `FindAtomA' could not be found

Cottonwood
Guest
 
Posts: n/a
#1: May 25 '06
I have a problem to retrieve th hostname of my pc.
I'm using Windows XP SP2 with the last updates and GNU Dev C++ 4.9.9.2.
Here my little test program:

#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;

}

Used Libraries:
"../../Compiler lcc-win32/lcc/lib/ws2_32.lib"
"../../Compiler lcc-win32/lcc/lib/kernel32.lib"
"../../Compiler lcc-win32/lcc/lib/user32.lib"

Linking makes no problems. But when executing I get the message
the entry point `FindAtomA' could not be found in the dll `WS2_32.DLL'.


What am I doing wrong?


Ico
Guest
 
Posts: n/a
#2: May 25 '06

re: Gethostname, `FindAtomA' could not be found


In comp.lang.c Cottonwood <google@c-d-j.de> wrote:[color=blue]
> I have a problem to retrieve th hostname of my pc.
> I'm using Windows XP SP2 with the last updates and GNU Dev C++ 4.9.9.2.
> Here my little test program:
>
> #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;
>
> }
>
> Used Libraries:
> "../../Compiler lcc-win32/lcc/lib/ws2_32.lib"
> "../../Compiler lcc-win32/lcc/lib/kernel32.lib"
> "../../Compiler lcc-win32/lcc/lib/user32.lib"
>
> Linking makes no problems. But when executing I get the message
> the entry point `FindAtomA' could not be found in the dll `WS2_32.DLL'.
>
>
> What am I doing wrongn?[/color]

You are asking the question in the wrong newsgroup. Your problem seems
to be 100% windows related, and clc only discusses ANSI-C. Please go to
the proper comp.windows.* group and ask again.


Thank you.


--
:wq
^X^Cy^K^X^C^C^C^C
jacob navia
Guest
 
Posts: n/a
#3: May 25 '06

re: Gethostname, `FindAtomA' could not be found


Cottonwood a écrit :[color=blue]
> I have a problem to retrieve th hostname of my pc.
> I'm using Windows XP SP2 with the last updates and GNU Dev C++ 4.9.9.2.
> Here my little test program:
>
> #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;
>
> }
>
> Used Libraries:
> "../../Compiler lcc-win32/lcc/lib/ws2_32.lib"
> "../../Compiler lcc-win32/lcc/lib/kernel32.lib"
> "../../Compiler lcc-win32/lcc/lib/user32.lib"
>
> Linking makes no problems. But when executing I get the message
> the entry point `FindAtomA' could not be found in the dll `WS2_32.DLL'.
>
>
> What am I doing wrong?
>[/color]

You are using the lcc-win32 libraries but do you use the
lcc-win32 compiler?

GNU Dev C++ is NOT the lcc-win32 compiler. Please do
not mix compilers because it will lead to failures.
Cottonwood
Guest
 
Posts: n/a
#4: May 25 '06

re: Gethostname, `FindAtomA' could not be found


jacob navia wrote:[color=blue]
> Cottonwood wrote :[color=green]
> > I have a problem to retrieve th hostname of my pc.
> > I'm using Windows XP SP2 with the last updates and GNU Dev C++ 4.9.9.2.[/color][/color]
Jonathan Mcdougall
Guest
 
Posts: n/a
#5: May 25 '06

re: Gethostname, `FindAtomA' could not be found


Cottonwood wrote:[color=blue]
> There are so a lot of libs in the GNU Dev-CPP directories. Is there
> anywhere a list to find out what they are for? Or do you know which one
> I have to include?[/color]

This discussion is off-topic in comp.lang.c++ and, I suspect, in
comp.lang.c. Followup set to gnu.g++.help (please respect it).


Jonathan

Cottonwood
Guest
 
Posts: n/a
#6: May 26 '06

re: Gethostname, `FindAtomA' could not be found



Cottonwood wrote:[color=blue]
> I have a problem to retrieve th hostname of my pc.
> I'm using Windows XP SP2 with the last updates and GNU Dev C++ 4.9.9.2.
> Here my little test program:
>
> #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;
>
> }
>
> Used Libraries:
> "../../Compiler lcc-win32/lcc/lib/ws2_32.lib"
> "../../Compiler lcc-win32/lcc/lib/kernel32.lib"
> "../../Compiler lcc-win32/lcc/lib/user32.lib"
>
> Linking makes no problems. But when executing I get the message
> the entry point `FindAtomA' could not be found in the dll `WS2_32.DLL'.
>
>
> What am I doing wrong?[/color]

File closed. I used the lcc-win libraries instead of the GCC ones.
Sorry but I'm just beginning with C.

Closed Thread


Similar C / C++ bytes