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? 6 2823 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>
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
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.
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.
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
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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rutger Claes |
last post by:
Code and problem are from PHP5:
When I execute the following piece of code, the DomException is thrown with
a message: Not Found Exception.
I assume this means that the node I extracted from the...
|
by: Eric Brunel |
last post by:
Hi all,
I just compiled Python 2.3.2 on Linux Mandrake 8.0, upgrading from Python 2.1. I
have one problem that I can't figure out: when I wanted to get "the" IP address
of the current host with...
|
by: John Ky |
last post by:
Hello:
Building Python works fine. Now I am trying to build my own python
module on Solaris 9, but I'm getting the following conflict:
In file included from...
|
by: Darren teo |
last post by:
Hi! i get an error when my application run at this line of code, please help
DNS.GETHostName
Return Error Msg:
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred
in...
|
by: MSNews |
last post by:
I get the following exception when calling Dns.GetHostName (from C#):
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred
in system.dll
Additional information: An...
|
by: NormD |
last post by:
We have a client-server app using Web Services on an IIS machine. The trace
below shows that .NET is searching around for some things (e.g.,
SystemDrawing.DLL and System.Drawing.EXE) and taking a...
|
by: Cottonwood |
last post by:
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>...
|
by: 7stud |
last post by:
Hi,
I'm experimenting with a basic socket program(from a book), and both
the client and server programs are on my computer. In both programs,
I call socket.gethostname(), but I discovered that...
|
by: sora |
last post by:
Hi,
I've developed a MFC program under VS 6.0. My debugger *was* working fine and I've used it often for my project. Then, one day, the errors below appear and they prevent me from using the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| | |