Mail Archives: cygwin/2001/12/01/18:07:48
Hi,
I am using cygwin version 1.3.4. gcc version 2.95.3-5 (cygwin special) on
Windows 2000, build 2195 SP 2. I was trying to see how cross compilation
works on windows so I wrote this small code for creating directory
/var/testinstall/testcygwin. To compile it I used following syntax
$ gcc -o testinstall.exe testinstall.cpp
I did not use any other make or link commands.
The testinstall.exe along with cygwin1.dll is working fine on the machine
where I compiled it. It creates all the proper directories But when I copy
same two files (my exe and cygwin1.dll) on another Windows 2000 machine,
this program is always giving same message "error occurred creating
/var/testinstall". It appears that Unix to Windows directory name conversion
is not taking place even though cygwin1.dll is present. I have no idea why
it is not running on other machine, while same program is running on this
machine where I am compiling it. Am I missing something ? Do I need to do
something different while compiling ? Do I need to set PATH variable on
another machine ? I have tried looking at cygwin FAQ, User Manual and then
turned to this group.
*** MY program ****
#include <stdio.h>
#include <sys/stat.h>
char tempdirname[216];
main()
{
int status;
try
{
(void) printf("\n* Directory creation started\n*");
(void) sprintf(tempdirname,"C:/cygwin");
(void) printf("now creating %s directory\n", tempdirname);
if((status=mkdir(tempdirname,0777)) != 0)
printf("%s directory allready exists\n", tempdirname);
(void) sprintf(tempdirname,"C:/cygwin/var");
(void) printf("now creating %s directory\n", tempdirname);
if((mkdir(tempdirname,0777)) != 0)
printf("%s directory allready exists\n", tempdirname);
(void) sprintf(tempdirname,"/var/testinstall");
(void) printf("now creating %s directory\n", tempdirname);
if((mkdir(tempdirname,0777)) != 0) throw -1;
(void) sprintf(tempdirname,"/var/testinstall/testcygwin");
(void) printf("now creating %s directory\n", tempdirname);
if((mkdir(tempdirname,0777)) != 0) throw -1;
exit(0);
}
catch(int error)
{
if(error == -1)
printf("error occured creating %s directory, fix it and run install
again\n", tempdirname);
exit(0);
}
}
I appreciate your guidence and thanks in advance.
Rahul
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -