473,327 Members | 2,118 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

how to include htons

hi,
which header files do i need to include for using htons in linux
i had used
#include <netinet/in.h>
but i am still getting the error
undefined reference to `htons(unsigned short)'

cheers,
jegan
Jan 30 '08 #1
4 7797
iceman wrote:
hi,
which header files do i need to include for using htons in linux
Try a Linux group, htons isn't a standard C++ function. Your man pages
should have told you.

--
Ian Collins.
Jan 30 '08 #2
iceman wrote:
i have pasted the errors below
<lots or stuff snipped>

The code and errors you posted appear to have nothing to do with htons.
You appear to be missing either a library or an object file in your link.

--
Ian Collins.
Jan 30 '08 #3
On Jan 30, 12:26 pm, Ian Collins <ian-n...@hotmail.comwrote:
iceman wrote:
i have pasted the errors below

<lots or stuff snipped>

The code and errors you posted appear to have nothing to do with htons.
You appear to be missing either a library or an object file in your link.

--
Ian Collins.
I had gone through the preprocessor output and the vector etc have
been resolved.
I just cannot put my finger on the mistake.Any clues about about how I
can go about debugging this issue?
--
Jan 30 '08 #4
iceman wrote:
On Jan 30, 12:26 pm, Ian Collins <ian-n...@hotmail.comwrote:
>iceman wrote:
>>i have pasted the errors below
<lots or stuff snipped>

The code and errors you posted appear to have nothing to do with htons.
You appear to be missing either a library or an object file in your link.
*Please* don't quote signatures.
>
I had gone through the preprocessor output and the vector etc have
been resolved.
I just cannot put my finger on the mistake.Any clues about about how I
can go about debugging this issue?
Find the library(s) or object file(s) that is missing from your link and
add it. As I said, check your man pages for htons.

--
Ian Collins.
Jan 30 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Womble | last post by:
Hi, I need to work out the length of a message in network byte order. Does PHP have an equivalent function of htons and ntohs? I've searched all the PHP documentation but have so far drawn a...
60
by: Derrick Coetzee | last post by:
It seems like, in every C source file I've ever seen, there has been a very definite include order, as follows: - include system headers - include application headers - include the header...
7
by: shalu | last post by:
Hi, Iam trying to understand Socket programming. I couldnt understand the functions htons() and htonl(). What is the difference between host byte order and network byte order ? Thanks, Shal
9
by: zolli | last post by:
Hi, I've been banging my head against this for a while now. Hoping someone here can shed some light on what's going on. On including stdlib.h in a file, I'm seeing the following errors: ...
5
by: David Mathog | last post by:
One thing that can make porting C code from one platform to another miserable is #include. In particular, the need to either place the path to an included file within the #include statement or to...
1
by: ya man | last post by:
when i use #include <iostream.h> in some files i get lots of error messages of the kind 'ambiguous symbol this is solved when i use #include <iostream why is that ? and can i use #include...
3
by: Arpi Jakab | last post by:
I have a main project that depends on projects A and B. The main project's additional include directories list is: ...\ProjectA\Dist\Include ...\ProjectB\Dist\Include Each of the include...
4
by: bobfilar | last post by:
I am working on a port enumerator and I am coming up with a problem. Here is the part of my code that is giving me fits right now: for (int i=0; i < (int) pTcpTable->dwNumEntries; i++) {...
7
by: Giancarlo Bassi | last post by:
Please, what are here the 11 include files (found over the internet)? */mozzarella.c /* #include #include #include #include #include #include
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.