From: Richard T. <rtroy@ScienceTools.com> - 2001-03-26 18:31:34
|
Hi, I'm new to the list, but have searched the archives for information on this topic. I noted Jeff Sturm had some things to say that interest me (you still on-list, Jeff?), but I didn't see this addressed. So here's my problem/q: I've got a working installation of gcc-2.95.2 on a windows 98 box, along with i386-mingw32 - a fairly recent installation. Up to now, I've done all of my development on Linux and have just copied the source over and compiled it. Some of my programs work fine - I just run make and that's it. Compilation of one of my programs fails because it includes netdb.h and neither it nor I can find netdb.h on my windows system. I do find several on my Linux system, of course. I suspect that there will be other includes I'll stumble across needing too... I searched the mail list archives without result, but maybe because I didn't know what to search on. I presume I can't just move over one of the netdb.h files from my linux system, or is that OK? Is there a downloadable library of more includes? Did I make a mistake using mingw32 (meaning, is there another package I should have used instead)? Please advise! RT P.S. I also enjoyed reading up on c and java interaction - did I interpret what I was reading correctly: I can call my Java code from C or C code from my Java? ...Calling C routines from Java would be VERY useful for me! Also, if someone can point me at a good source of concise reading on cross-compiling with Gnu C, I'd appreciate it. R -- Richard Troy, Chief Scientist Science Tools Corporation rtroy@ScienceTools.com, 510-567-9957, http://ScienceTools.com/ |
From: Georg F. <fu...@is...> - 2001-03-26 19:23:26
|
I agree with you that there is no 'netdb.h' in the mingw-stuff. What for declarations are in netdb.h ? Richard Troy wrote: > > Hi, > > I'm new to the list, but have searched the archives for information on > this topic. I noted Jeff Sturm had some things to say that interest me > (you still on-list, Jeff?), but I didn't see this addressed. So here's my > problem/q: > > I've got a working installation of gcc-2.95.2 on a windows 98 box, along > with i386-mingw32 - a fairly recent installation. Up to now, I've done all > of my development on Linux and have just copied the source over and > compiled it. Some of my programs work fine - I just run make and that's > it. > > Compilation of one of my programs fails because it includes netdb.h and > neither it nor I can find netdb.h on my windows system. I do find several > on my Linux system, of course. I suspect that there will be other includes > I'll stumble across needing too... > > I searched the mail list archives without result, but maybe because I > didn't know what to search on. I presume I can't just move over one of the > netdb.h files from my linux system, or is that OK? Is there a downloadable > library of more includes? Did I make a mistake using mingw32 (meaning, is > there another package I should have used instead)? > > Please advise! > > RT > > P.S. I also enjoyed reading up on c and java interaction - did I interpret > what I was reading correctly: I can call my Java code from C or C code > from my Java? ...Calling C routines from Java would be VERY useful for me! > Also, if someone can point me at a good source of concise reading on > cross-compiling with Gnu C, I'd appreciate it. > R > > -- > Richard Troy, Chief Scientist > Science Tools Corporation > rtroy@ScienceTools.com, 510-567-9957, http://ScienceTools.com/ > > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options at: > http://lists.sourceforge.net/lists/listinfo/mingw-users -- Georg Fusz Technische Universitaet Berlin, Germany Fon: Uni.: +49 30 314 26 884 privat: +49 30 815 30 32 Handy: +49 173 20 10 696 Homepage: http://www.cadlab.tu-berlin.de/~fusz/ |
From: Richard T. <rtroy@ScienceTools.com> - 2001-03-26 19:34:52
|
> I agree with you that there is no 'netdb.h' in the mingw-stuff. > > What for declarations are in netdb.h ? Hi Georg, All I want from netdb.h is to call gethostname(). Apparently it defines, among other things I'm unaware of, the struct hostent used by gethostname(). For more see: http://www.gnu.org/manual/glibc-2.0.6/html_chapter/libc_11.html#SEC191 RT > > I've got a working installation of gcc-2.95.2 on a windows 98 box, along > > with i386-mingw32 - a fairly recent installation. Up to now, I've done all > > of my development on Linux and have just copied the source over and > > compiled it. Some of my programs work fine - I just run make and that's > > it. > > > > Compilation of one of my programs fails because it includes netdb.h and > > neither it nor I can find netdb.h on my windows system. I do find several > > on my Linux system, of course. I suspect that there will be other includes > > I'll stumble across needing too... > > > > I searched the mail list archives without result, but maybe because I > > didn't know what to search on. I presume I can't just move over one of the > > netdb.h files from my linux system, or is that OK? Is there a downloadable > > library of more includes? Did I make a mistake using mingw32 (meaning, is > > there another package I should have used instead)? > > > > Please advise! > > > > RT > > > > P.S. I also enjoyed reading up on c and java interaction - did I interpret > > what I was reading correctly: I can call my Java code from C or C code > > from my Java? ...Calling C routines from Java would be VERY useful for me! > > Also, if someone can point me at a good source of concise reading on > > cross-compiling with Gnu C, I'd appreciate it. > > R > > > > -- > > Richard Troy, Chief Scientist > > Science Tools Corporation > > rtroy@ScienceTools.com, 510-567-9957, http://ScienceTools.com/ > > > > _______________________________________________ > > MinGW-users mailing list > > Min...@li... > > > > You may change your MinGW Account Options at: > > http://lists.sourceforge.net/lists/listinfo/mingw-users > > |
From: <dan...@ya...> - 2001-03-26 20:57:55
|
--- Richard Troy <rtroy@ScienceTools.com> wrote: > > > > I agree with you that there is no 'netdb.h' in the mingw-stuff. > > > > What for declarations are in netdb.h ? > > Hi Georg, > > All I want from netdb.h is to call gethostname(). Apparently it defines, > among other things I'm unaware of, the struct hostent used by gethostname(). > For more see: > > http://www.gnu.org/manual/glibc-2.0.6/html_chapter/libc_11.html#SEC191 > > RT These are gethostname() and hostent are defined in winsock.h in w32api. Link against libwsock32.a. Alternatively, include winsock2.h and link against libws2_32.a. The winsock2 interface has more functionality Danny _____________________________________________________________________________ http://calendar.yahoo.com.au - Yahoo! Calendar - Access your appointments and meetings online. |
From: Jeff S. <js...@de...> - 2001-03-30 19:59:17
|
On Mon, 26 Mar 2001, Richard Troy wrote: > I'm new to the list, but have searched the archives for information on > this topic. I noted Jeff Sturm had some things to say that interest me > (you still on-list, Jeff?), but I didn't see this addressed. I'm still lurking here. Actually I haven't used mingw a bit lately, but staying abreast of the issues helps keep me honest. There is a growing tendency these days with free software to assume everything looks and runs like Linux does, and if other platforms are different they are not worthy. OK, that's exaggerating a little, but clearly i686-pc-linux-gnu gets more testing than anything else on many projects. If developers were required to test on win32 they'd stand a better chance of portability. So that's why I'm tuned in. Sorry for the little off-topic rant. Now back to your regular programming... > Compilation of one of my programs fails because it includes netdb.h and > neither it nor I can find netdb.h on my windows system. I do find several > on my Linux system, of course. I suspect that there will be other includes > I'll stumble across needing too... The other replies are on target. The netdb.h header isn't omnipresent though it's likely to appear anywhere BSD socket libraries are in use (except Windows, which moved that functionality to winsock). If you use autoconf you can wrap it like so: #ifdef HAVE_NETDB_H #include <netdb.h> #endif > P.S. I also enjoyed reading up on c and java interaction - did I interpret > what I was reading correctly: I can call my Java code from C or C code > from my Java? The GNU Java compiler, gcj, supports calling C with JNI or C++ with CNI. The former is a Java standard, the latter an innovation unique to gcj. The benefit of CNI is a much smoother language integration: 1) C++ code can call Java and vice-versa 2) Java packages are visible as C++ namespaces 3) C++ can catch/throw Java exceptions 4) Less runtime overhead for faster execution See http://gcc.gnu.org/java/papers/cni/t1.html for more info. The GCC 3.0 release will fully integrate this work, though it has received little testing with mingw so far. > Also, if someone can point me at a good source of concise reading on > cross-compiling with Gnu C, I'd appreciate it. There is a cross-gcc FAQ & mailing list, though I don't have a URL handy. This will soon also be part of the main GCC site. -- Jeff Sturm jef...@co... |