I am trying to compile a program which contains #include <net/hton.h> using g++. The code was compiled successfully on Visual C++ by someone else, but when I try compiling it, it says that there is no such file /net/hton.h. I couldn't find any information about it on the web, so does anyone know how to fix this?
The hton.h file is a Linux/Unix header file. If this DID compile under Visual C++, there would have been a warning that hton.h did not exist. Just comment it out.
The code was more than likely developing for a Linux/Unix platform, so it may not compile correctly without some modifications on a Windows platform.
The hton*() and ntoh*() functions are very common, but they are not part of any standard AFAIK, so each platform and/or compiler will require different headers to use them.
Usually, if you are including the stuff you need to play with sockets then you've included the stuff you need to use those functions.
tsk tsk @ original author for not putting the #include in #ifdef statements to prevent this. Especially when using a Minix specific header (I mean who uses Minix? :P)