470,833 Members | 1,224 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

Gethostname, `FindAtomA' could not be found

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?

May 25 '06 #1
6 2646
What am I doing wrong?


Posting this question to comp.lang.c++.

<url: http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9>
May 25 '06 #2
Ico
In comp.lang.c Cottonwood <go****@c-d-j.de> wrote:
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?


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
May 25 '06 #3
Cottonwood a écrit :
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?


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.
May 25 '06 #4
jacob navia wrote:
Cottonwood wrote :
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.

May 25 '06 #5
Cottonwood wrote:
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?


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

May 25 '06 #6

Cottonwood wrote:
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?


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

May 26 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Darren teo | last post: by
4 posts views Thread by MSNews | last post: by
14 posts views Thread by NormD | last post: by
5 posts views Thread by Cottonwood | last post: by
10 posts views Thread by 7stud | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.