Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Gethostname, `FindAtomA' could not be found

Reply
Thread Tools

Gethostname, `FindAtomA' could not be found

 
 
Cottonwood
Guest
Posts: n/a
 
      05-25-2006
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?

 
Reply With Quote
 
 
 
 
Ico
Guest
Posts: n/a
 
      05-25-2006
In comp.lang.c 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 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
 
Reply With Quote
 
 
 
 
jacob navia
Guest
Posts: n/a
 
      05-25-2006
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.
 
Reply With Quote
 
Cottonwood
Guest
Posts: n/a
 
      05-25-2006
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.

.
.
.
> >
> > 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'.



> 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.


Thank you very much. I didn't recognize that.
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?

 
Reply With Quote
 
Jonathan Mcdougall
Guest
Posts: n/a
 
      05-25-2006
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

 
Reply With Quote
 
Cottonwood
Guest
Posts: n/a
 
      05-26-2006

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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Could C each other, but could not connect vijaiakumar@gmail.com Computer Support 3 06-25-2007 05:00 AM
Could not connect to mail server System.Web Could not access 'CDO.Message' object. ????? Adam Knight ASP .Net 1 12-05-2005 05:38 AM
host pop3 could not be found, outlook not working fully jboniza181 Computer Support 4 09-25-2004 02:05 PM
Error Message: Outlook Express Could Not Be Started Because Msoe.dll Could Not Be Loaded Dutch Treat Computer Support 4 06-21-2004 02:01 PM
Project could not be opened because a language-specific compiler could not be instantieted Roxanne ASP .Net 0 07-04-2003 10:22 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57