Using a DLL built with cygwin in VC++

2007-02-08 Thread Papasha

Hello, I'm trying to use a DLL created with cygwin in my VC++ project. I
have a DLL file and I need to create .lib in order to use the DLL in VC++, I
use the following command sequence:

dlltool --export-all-symbols --output-def mylib.def mylib.dll #cygwin's 
dlltool

lib /DEF:mylib.def /OUT:mylib.lib #VC++'s lib

Then, I link my VC++ application using the mylib.lib, but the linker says:
mylib.lib : fatal error LNK1127: library is corrupt

What should I do ?


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Using a DLL built with cygwin in VC++

2007-02-07 Thread Papasha

Hello, I'm trying to use a DLL created with cygwin in my VC++ project. I
have a DLL file and I need to create .lib in order to use the DLL in VC++, I
use the following command sequence:

dlltool --export-all-symbols --output-def mylib.def mylib.dll #cygwin's 
dlltool

lib /DEF:mylib.def /OUT:mylib.lib #VC++'s lib

Then, I link my VC++ application using the mylib.lib, but the linker says:
mylib.lib : fatal error LNK1127: library is corrupt

What should I do ?


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Strange fork/exec bug, two processes instead of one are created

2006-10-23 Thread Papasha

Hello, everyone, I have a problem using fork/exec, I have a program that
launches other program:
//spawner.exe
#include 
#include 

int main(int argc, char* argv[])
{
pid_t pid = 0;

if (argc < 2)
{
 fprintf(stderr, "Usage: spawner executable [arguments]\n");
 return -1;
}

pid = fork();
if (pid == 0)
{
 execv(*(argv + 1), argv + 1);
}

sleep(10);

return 0;
}

I use it to launch a program compiled using MSVC++ 2005:
//testproj.exe
#include 

int main(int argc, char *argv[])
{
Sleep(1);
return 0;
}

So, I'm using first program like this:
./spawner.exe testproj.exe

It starts, everything is ok, but in windows TaskMan I see something like
this:
spawner.exe
spawner.exe
testproj.exe

I have 2 copies of spawner.exe running, It seemed to me so, but after I ran
"ps -W" under cygwin I got:

PID PPIDPGID WINPID  TTY  UIDSTIME COMMAND
257629282576   3260  con 1003 12:06:07 .../spawner
242425762576   3472  con 1003 12:06:07 .../testproj

3472   0   0   3472?0 12:06:07 
C:\cygwin\...\testproj.exe (where did it come from ???)


It looks like second spawner.exe is not actually a spawner.exe, but another
testproj.exe. Note that first testproj and second testproj have the same
WINPID, but different PIDs and the PID of second testproj = WINPID of first
testproj.

After that I've created another program testproj_cyg.exe similar to
testproj.exe but compiled it with cygwin:
//testproj_cyg.exe
#include 

int main(int argc, char* argv[])
{
sleep(10);
return 0;
}

And ran:
./spawner.exe testproj_cyg.exe

And everything was ok, I had one copy of spawner.exe and one copy of
testproj_cyg.exe

So, why does this happen, why there's a second testproj.exe in memory ?
It's compiled with MSVC++ 2005, is that a problem for cygwin's fork/exec ?
why ? 



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/