![]()
C:\Windows\Start Menu\Programs\Cygnus Solutionsbefore you can fire up the shell.
Using Windows Explorer, go to that folder and right mouse on Cygwin B20. Select "Properties". You'll probably want to make the following changes:
mkdir /tmp /bin /usr /etcThis is in the instructions you should have read.
ln -s /cygnus/cygwin~1/h-i586~1/bin/sh.exe /bin/sh.exe(If you've installed cygwin somewhere other than the default location, you'll have to make the left-hand side of the link expression something else).
This creates a soft link that's recognizeable by bash. If you use Explorer to make a shortcut, what you'll get in /bin is a file called "she.exe.lnk" which unfortunately bash doesn't recognize as executable.
You need to make the link (or a copy of sh.exe) into the directory that bash recognizes as /bin because many scripts (e.g., configure, many makefiles) will call /bin/sh.
This is also in the instructions you should have read.
exitYou should *not* just click the "X" box in the top right-hand corner of the window. bash can leave your system in a blue-screen-of-death state if you don't exit properly. bash is a lot better than it used to be about this, but it's still dangerous to just kill off bash.
#include <stdio.h>
main()
{
printf("Hello, world!\n");
}
gcc hello.c
./a.exeand you should get the familiar "Hello, world!".
#include <iostream>Incidentally, you may #include <iostream> or <iostream.h>
int main()
{
cout << "Hello, world!" << endl;
return 0;
}
g++ -o hello hello.cpp
./hello
gcc -mno-cygwin hello.c
g++ -mno-cygwin -o hello hello.cppDisaster! A huge number of error messages.
To solve it, go out and get
ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/cygwin/egcs-1.1.2/egcs-1.1.2-mingw-extra.tar.gzand extract it to:
C:\usr\mingw32In this tarball, libm.a seems to be a soft link which got copied by mistake into the distribution. Either extract everything but libm.a or extract everything and delete libm.a from C:\usr\mingw32\lib
Now try again, using the following command line arguments:
g++ -mno-cygwin -I/usr/mingw32/include -L/usr/mingw32/lib hello.cpp
This time it should link and run correctly.
The whole issue is explained in:
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/
-- click on the article "-mno-cygwin"
gcc -mwindows simple.c or
gcc -mno-cygwin -mwindows simple.c
./a.exe
tar zxvf hypermail-2b30.tar.gz
In our example, we'll assume you extracted the hypermail source into C:\aawork\hypermail-2b30 (in DOS shell notation) or //c/aawork/hypermail-2b30 (in bash shell notation).
cd //c/aawork/hypermail-2b30
sh ./configureThis should give you a lot of messages and complete successfully. If you've used configure on a Unix system, the only surprise is how familiar the outputs look.
makeThis should also complete successfully, with one warning message:
mail.c: In function `lookupnumaddr':
mail.c:40: warning: return discards `const' from pointer target type
mkdir /usr/local /usr/local/bin /usr/local/manThis creates the directories your programs and documents will reside in. Yes, I know install is supposed to do a mkdir if it can't find those files, but that seems to be broken.
mkdir /usr/local/man/man1 /usr/local/man/man4
make installIf you've changed all the makefiles correctly, you should see the following directory contents:
BASH.EXE-2.02$ ls -F /usr/local/bin
hmail.exe* na-mail.exe* nu-rdmsg.exe*
hrdmsg.exe* na-rdmsg.exe* wu-rdmsg.exe*
hypermail.exe* nu-mail.exe* wuftpdmail.exe*
BASH.EXE-2.02$ ls -F /htdocs
customizing.html hr.yellow.gif hypermail.html
hmrc.html hypermail.gif
BASH.EXE-2.02$ ls -RF /usr/local/man
man1/ man4/
/usr/local/man/man1:
hypermail.1
/usr/local/man/man4:
hmrc.4
yourlogin:x:500:10:Your Name://c/Bob:/usr/bin/bash
Note that I define HOME in C:\autoexec.bat:
SET HOME=C:\Bobso vim doesn't end up writing its scratch files everywhere. It *appears* that the routine in file.c uses this entry to find $HOME and that no other routine finds $HOME any other way. Still, it probably isn't a bad idea to go ahead and define HOME in C:\autoexec.bat and reboot.
In the line above, the user number "500" is important. The group number "10" probably isn't (I don't have an /etc/group), and (obviously) //c/Bob isn't important unless your name is Bob. Just make sure the directory exists.
cp hmrc.example ~/.hmrc
cd test
mkdir foo
/usr/local/bin/hypermail -m Sent -d foo
(I noticed that a JPEG file that was attached to one of the messages didn't seem to translate properly, though the JPEG header looked good.) If nobody else runs into this, forget it and chalk it up to a bad file. Otherwise, you might want to look at Jorgen Hagg's base64 routine, which I got permission to use in foxynews: http://home.hiwaay.net/~crispen/src/#foxynews I'm sure he'd give us permission to use it in hypermail.
![]()