Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Unsubscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-Id: <199908122052.PAA00850@mercury.xraylith.wisc.edu> To: Gary Powell cc: "'cygwin AT sourceware DOT cygnus DOT com'" Subject: Re: Newbie Link problem. (win 98) In-Reply-To: Your message of "Thu, 12 Aug 1999 12:01:35 PDT." <1551C326F31FD2118E1900805FEA382514AD1D AT SI> Date: Thu, 12 Aug 1999 15:52:58 -0500 From: Mumit Khan Gary Powell writes: > First, I am evaluating the cygnus tools and specifically gcc 2.95 for use > at my company Sierra. > > I have a fairly simple bit of code which I am trying to link. I have read > all the documentation on the Cygnus site that I could find relating to this > and either I am really dumb, lacking in caffeine or its not obvious. > > Sample code: > > #include > int main(int, char **) > { > std::cout << "Hello world" << std::endl; > > return 1; > } > > if I use > > g++ -o hello.exe -mpentium hello.cpp > > I get link errors, about missing ostream stuff. This should definitely work, and it's a bug otherwise. Please send me the "bug.txt" file: $ echo env > bug.txt $ env >> bug.txt $ gcc -v >> bug.txt 2>&1 $ g++ -v -o hello.exe -mpentium hello.cpp -v >> bug.txt 2>&1 Your installation is suspect. > So I've added the specific libraries, -lstdc++ -lc FYI, due to a weird quirk in Cygwin packaging, adding -lc is not a good idea. Hopefully that will be fixed in the future. G++ or C++ drivers will automatically add -lstdc++, so you shouldn't have to. Use the -v option to see what's going on. > > and now I'm missing only sysconf and sbrk. I tried adding > -lmmalloc to the end of the library list > and it only created more missing calls. getpagesize, and _kill mmalloc is unnecessary for sbrk and sysconf. Both of these are in the default Cygwin runtime, libcygwin.a, which is automatically linked in by gcc/g++/c++/g77/etc. > I've also tried adding the mingw code and adding mingw32, then > shell32, then kernel32 (Even though I found documentation telling me > specifically not to include this one, I was getting desperate) and msvcrt Now, I'm confused. Are you using Cygwin runtime or Mingw runtime? If you're using Mingw runtime and just *using* Cygwin tools, then you're going about it the wrong way. See my -mno-cygwin howto at: http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ If you're using Cygwin runtime, then you can't just "add" mingw code, and nor can you add msvcrt. > Can you please either point me to the proper place to ask this question, > or tell me what library I'm missing. Or that its impossible, so I'll quit > banging my head on the keyboard. You've come to the right place. However, to get help, you need to provide more information, such as what I had asked for earlier, and possibly example code. First of all, you need to tell us exactly what you're trying to do with Cygwin. Are you evaluating the whole Cygwin environment -- tools and the runtime, or just the tools using Mingw/MS runtime? Regards, Mumit -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com