On Fri, 2004-09-24 at 22:34, Andreas Langs wrote: > Hi, > > I have a problem when compiling my application with Visual Studio .NET 2003. > > We use some OpenSG Network functions an with it the OSGBinaryMessage. On > some machines when compiling our application (all with .NET 2003) the > Compiler gives us an error: > > htonl: identifier not found... In OSGBinaryMessage.inl and > OSGBinaryDataHandler.inl > > We can get around this error, by including winsock.h befor including > OSGBinaryMessage.h every time we include OSGBinaryMessage.h > This resolves the error on the machines where the upper error message > appears, but generates another error message (I did not remember it exactly, > but something with winsock.h if i`m not totaly wrong) on the machines where > it previously worked. > > I could not figure out what the differences between these machines are (the > machines are very different, but the Visual Studio configuration is the > same, I think). > > I looked into the OpenSG Source Code and found 2 files where the winsock.h > is included: > > OSGDgram.inl > OSGImageFileType.cpp > > In those two files we have the following Code: > ---- cut ---- > // Application declarations > // to get ntons/ntohs > #ifdef WIN32 > #include <winsock.h> > #else > #include <arpa/inet.h> > #endif > ---- cut ---- > > In the OSGBinaryMessage.inl we have only this: > ---- cut ---- > #ifndef WIN32 > #include <arpa/inet.h> > #endif > ---- cut ----
> Should it not be the same as in OSGDgram.inl ? No winsock.h should definitely NEVER be included directly, it is basically wrong in Dgram.inl, besides .inl file should NEVER include anything. We are including windows.h which should be enough as it includes winsock2.h, which contains slightly different declarations from winsock.h and both are not well protected from each other giving a lot of fun if things go wrong. > Or have I to do something different to solve this Problem? As it seems to randomly work on some machine and not on other there should be a different solution. Could you send me a preprocessed file (one is enough) from the machine giving the errors and the same file from a machine not doing so. Without seeing what actually gets compiled it is hard to tell anything. regards, gerrit ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
