How to create a .dll which contains a function defined in another program?

2005-07-13 Thread Yu-Cheng Chou
Hi, bar() is in the main.c which is compiled using VC++. bar() is called inside module.c which is compiled as module.dll using cygwin's gcc. module.dll is loaded by LoadLibrary() in main.exe. /* main.c */ #include #include extern "C" int mainCRTStartup(); extern "C" int __stdcall cygloadC

Re: How to add 4K of scratch space at the bottom of the stack using C instead of C++?

2005-07-12 Thread Yu-Cheng Chou
> > My program works in this way. However, after the cygwin1.dll was > > initialized, the I/O seemed to be redirected. How can I get my I/O > > back? > > I listed my codes below for reference. > Does your CYGWIN environment variable include the string "tty"? I set tty as CYGWIN's environment va

Re: How to add 4K of scratch space at the bottom of the stack using C instead of C++?

2005-07-12 Thread Yu-Cheng Chou
> As has been already pointed out, you have to load cygwin1.dll first, > initialize it, and then load your DLL. The whole cygload thing is for > cygwin1.dll only, it will not work for anything else. After the Cygwin > DLL has been loaded and initialized you should be able to load your DLL > that

Re: How to add 4K of scratch space at the bottom of the stack using C instead of C++?

2005-07-11 Thread Yu-Cheng Chou
> > I have module.dll that was created by using command line "gcc -shared > > -o module.dll module.c" in cygwin. > > When I run "msvc-cygload -v -cygwin module.dll" in cygwin, error > > messages listed below occurred. > Why are you using cygload to load something that isn't cygwin1.dll? Hi, Max

Re: How to add 4K of scratch space at the bottom of the stack using C instead of C++?

2005-07-11 Thread Yu-Cheng Chou
> > > I downloaded the cygload package, set up the MSVCDir for my system, > > > and > > > used c:\cygwin\bin\make to run the Makefile. The msvc-cygload.exe was > > > successfully created. However, when I run msvc-cygload.exe, error > > > messages listed below occurred. > > 1. You're running cy

Re: How to add 4K of scratch space at the bottom of the stack using C instead of C++?

2005-07-11 Thread Yu-Cheng Chou
> > I downloaded the cygload package, set up the MSVCDir for my system, and > > used c:\cygwin\bin\make to run the Makefile. The msvc-cygload.exe was > > successfully created. However, when I run msvc-cygload.exe, error > > messages listed below occurred. > 1. You're running cygwin 1.5.18? > 2

Re: How to add 4K of scratch space at the bottom of the stack using C instead of C++?

2005-07-11 Thread Yu-Cheng Chou
> > > By the way, the Makefile shows that the MSVC compiler is in > > > C:/cygwin/usr/local/tools/i686_win32/vc7/Vc7. > > > Is it a package that is provided by cygwin? Or is it the MSVC > > > software > > > that is installed in that directory? > > Umm, no, Cygwin doesn't install MSVC (hopefully).

Re: How to add 4K of scratch space at the bottom of the stack using C instead of C++?

2005-07-11 Thread Yu-Cheng Chou
> > Hi, > > In order to dynamically load cygwin1.dll with VC, I need to add 4K of > > scratch space at the bottom of my stack. > > > > The winsup/testsuite/cygload/cygload.cpp shows how to do it using C++. > > I believe it's cygload.cc... > > > How can I add the scratch space using C rather than

How to add 4K of scratch space at the bottom of the stack using C instead of C++?

2005-07-10 Thread Yu-Cheng Chou
Hi, In order to dynamically load cygwin1.dll with VC, I need to add 4K of scratch space at the bottom of my stack. The winsup/testsuite/cygload/cygload.cpp shows how to do it using C++. How can I add the scratch space using C rather than C++ in a simplest way? Thanks -- Unsubscribe info:

Load a shared library using gcc/Cygwin

2005-07-05 Thread Yu-Cheng Chou
Hi, main.c below is for loading the shared library module.dll /* command to create main.exe cl -c main.c link main.obj */ #include #include int main(){ void *handle; int (*fp)(); char *modname = "./module.dll"; HMODULE h; void (*init)(); printf("hello1\

Re: Dynamically load a shared lib created using gcc/Cygwin

2005-06-30 Thread Yu-Cheng Chou
mylib.dll was created using gcc/cygwin based on some libraries that were also built using gcc/cygwin and CANNOT be re-built by other compilers. I have to, and need only to load mylib.dll at run-time by function LoadLibrary("mylib.dll") in an applicaiton that was built by Visual C++ or .NET. Whe

Dynamically load a shared lib created using gcc/Cygwin

2005-06-30 Thread Yu-Cheng Chou
Hi, I made a mistake in the previous reply. Here I state my question again. mylib.dll was built using gcc/cygwin based on some library that might depends on cygwin1.dll. I don't want to load cygwin1.dll explicitly, but I do need to load mylib.dll dynamically at run-time in an application which

Re: load a shared lib created using gcc/Cygwin

2005-06-30 Thread Yu-Cheng Chou
Hi, I made a mistake in the previous reply. Here I state my question again. mylib.dll was built using gcc/cygwin based on some library that might depends on cygwin1.dll. I don't want to load cygwin1.dll explicitly, but I do need to load mylib.dll dynamically at run-time in an application which

can't connect to ssh server on windows xp

2005-06-30 Thread Yu-Cheng Chou
Hi, I installed sshd as a system service on windows xp, but I can't connect to this ssh server through ssh. The firewall has been turned off. The sshd is listening to port 22. But when I tried to connect to this server, the error message below occurred. ssh: connect to host mouse1 port 22: Conn

Re: load a shared lib created using gcc/Cygwin

2005-06-30 Thread Yu-Cheng Chou
Hi, I want to load the cygwin1.dll with Visual Studio following the instruction from http://cygwin.com/faq/faq.html#SEC102. But I can't find winsup/cygwin/how-cygtls-works.txt and the sample code in winsup/testsuite/cygload. So where can I find these files? Thanks > Yu-Cheng Ch

Re: load a shared lib created using gcc/Cygwin

2005-06-30 Thread Yu-Cheng Chou
Hi, I want to load the cygwin1.dll with Visual Studio following the instruction from http://cygwin.com/faq/faq.html#SEC102. But I can't find winsup/cygwin/how-cygtls-works.txt and the sample code in winsup/testsuite/cygload. So where can I find these files? Thanks > Yu-Cheng Ch

load a shared lib created using gcc/Cygwin

2005-06-30 Thread Yu-Cheng Chou
Can a shared library mylib.dll built using gcc -shared -o mylib.dll file.c be loaded dynamically at run time by function LoadLibrary("mylib.dll") in an application built using Visual C++ or .NET? I tried it in Windows XP with the latest version of gcc/Cygwin, the application will hang at LoadLibra

build an executable with .lib created by vc

2005-03-11 Thread Yu-Cheng Chou
Hi, I have a test1.lib created by the microsoft visual c++ compiler. test1.lib contains only one function test1(), which prints out "Hello from test1". The other file I have is main.c, which prints out "Call Test1", call test1 () and prints out "Return Test1". -

stack overflow in cygwin_nt-5.0

2004-11-10 Thread Yu-Cheng Chou
I have to use large matrices (even larger) in my application. So, how to do it? >Don't declare huge data structures on the stack. >Max. >>Hi, >>I declared three double matrices in main function and it caused stack >>overflow. >>double a[300][300], >> b[300][300], >> c[300][300];

stack overflow in cygwin_nt-5.0

2004-11-10 Thread Yu-Cheng Chou
Hi, I declared three double matrices in main function and it caused stack overflow. double a[300][300], b[300][300], c[300][300]; below is the message of stack overflow: Exception: STATUS_STACK_OVERFLOW at eip=00444683 eax=00013624 ebx=0004 ecx=00032064 edx=00401060 esi=610E

can not find cygcrypt-0.dll

2004-09-22 Thread Yu-Cheng Chou
Hi, I installed the latest cygwin (1.5.11.1) on a windows 2000 machine, and tried to start the sshd service, but an error message occurred saying that cygcrypt-0.dll can not be found in PATH. The thing is that cygcrypt- 0.dll does not exist in the system. Any idea to fix it? -- Unsubscribe in

problem about building shared library

2004-08-26 Thread Yu-Cheng Chou
Hi, Larry: I have two c-callable static libs which are created by vc, but the source codes are not available. I need these libs to create a shared library using gcc under cygwin. Command line: gcc -shared -o libmpi.dl mpi_chdl.o ../../src/lib/libmpi.a ../../src/lib/liblam.a ../../src/lib/chsd

Re: convert .lib to .a

2004-08-26 Thread Yu-Cheng Chou
Hi, Larry: I have two c-callable static libs which are created by vc, but the source codes are not available. I need these libs to create a shared library using gcc under cygwin. Command line: gcc -shared -o libmpi.dl mpi_chdl.o ../../src/lib/libmpi.a ../../src/lib/liblam.a ../../src/lib/chsd

convert .lib to .a

2004-08-26 Thread Yu-Cheng Chou
Hi, How to convert .lib to .a? Thanx -- 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/

use VC lib to build a .exe

2004-08-26 Thread Yu-Cheng Chou
Hi, there: How to build a '.exe' using 'VC staic lib' in cygwin? Thanx -- 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/

use vc lib in cygwin

2004-08-25 Thread Yu-Cheng Chou
Hi, there: I got some xxx.lib files created by VC. Now I wanna create a xxx.dl file based on those xxx.lib files using gcc in cygwin, but some errore occurred. The xxx.lib files might need to be transferred to something that gcc can recognize, and the problem could then be fixed. So, how to do