Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com X-Originating-IP: [199.196.144.11] From: "Chris Marshall" To: cygwin AT cygwin DOT com Subject: Repost: PLEASE HELP! Using -mno-cygwin Date: Mon, 23 Jul 2001 11:59:06 -0400 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 23 Jul 2001 15:59:07.0157 (UTC) FILETIME=[67404C50:01C11390] Cygwin List - I am resending this message as I have not yet had a response from the orignal post. I'm hoping that someone can get me started either with a HOWTO or some simple instructions. Thanks! Chris ----Original Message Follows---- From: "Chris Marshall" To: cygwin AT cygwin DOT com Subject: New User: including a third party DLL and using -mno-cygwin Date: Wed, 18 Jul 2001 14:03:32 -0400 Gang - I'm trying to compile a program which is dependent on a vendor supplied dll. I have a vendor supplied .H file which is #included in my program. After trying various command line options, I got the following to work: ---------cut here------------cut here-----------cut here----------- gcc -I. m:/fs75/bin/client/winx86/psmsg.dll hello_psft.c ---------cut here------------cut here-----------cut here----------- The program runs, except that it never exits. (I'm not too worried about this, I suppose I'll figure out why later. I have to use - in the CYGWIN bash window.) So then I want to run this outside of the CYGWIN bash window. I realize that I need to use the option -mno-cygwin. So I tried various iterations of the following: ---------cut here------------cut here-----------cut here----------- gcc -I. -mno-cygwin m:/fs75/bin/client/winx86/psmsg.dll hello_psft.c ---------cut here------------cut here-----------cut here----------- And I usually end up with something like: ---------cut here------------cut here-----------cut here----------- /cygdrive/c/DOCUME~1/JHEFFE~1/LOCALS~1/Temp/ccQOStJ5.o.text+0xd7):hello_psft.c: undefined reference to `PSMsgConnect AT 16' /cygdrive/c/DOCUME~1/JHEFFE~1/LOCALS~1/Temp/ccQOStJ5.o.text+0xee):hello_psft.c: undefined reference to `PSMsgStartMessage AT 16' /cygdrive/c/DOCUME~1/JHEFFE~1/LOCALS~1/Temp/ccQOStJ5.o.text+0x106):hello_psft.c: undefined reference to `PSMsgSetField AT 12' /cygdrive/c/DOCUME~1/JHEFFE~1/LOCALS~1/Temp/ccQOStJ5.o.text+0x121):hello_psft.c: undefined reference to `PSMsgSetField AT 12' /cygdrive/c/DOCUME~1/JHEFFE~1/LOCALS~1/Temp/ccQOStJ5.o.text+0x13c):hello_psft.c: undefined reference to `PSMsgSetField AT 12' /cygdrive/c/DOCUME~1/JHEFFE~1/LOCALS~1/Temp/ccQOStJ5.o.text+0x151):hello_psft.c: undefined reference to `PSMsgProcessMessage AT 8' /cygdrive/c/DOCUME~1/JHEFFE~1/LOCALS~1/Temp/ccQOStJ5.o.text+0x162):hello_psft.c: undefined reference to `PSMsgDisconnect AT 4' /cygdrive/c/DOCUME~1/JHEFFE~1/LOCALS~1/Temp/ccQOStJ5.o.text+0x1ac):hello_psft.c: undefined reference to `PSMsgDisconnect AT 4' collect2: ld returned 1 exit status ---------cut here------------cut here-----------cut here----------- I've also tried to get GCC to recognize the DLL by using the -L or the -l options without success. I've tried moving the -mno-cygwin option around the command line, without success. Can someone illuminate what I am doing wrong? Basically, I'm trying to get this to run on a Win32 program without any need for the end user to have CYGWIN installed on their machine. I don't have access to the source code inside "psmsg.dll". How do I link my program to this DLL successfully? (And if anyone knows why the program doesn't exit inside the CYGWIN bash shell, that would be a bonus answer that would be appreciated.) Also, if anyone knows of any tutorials or HOW-TOs for cygwin and programming on Win32, that would be greatly appreciated. Thanks! Chris Here is a copy of the source code: ---------cut here------------cut here-----------cut here----------- #include #include #include void PrintError(char *); PSMSGHANDLE hCtx; main() { PSOPERATOR Opr; int Result; int nReplyOption; !/* Setup the Operator ID and Password */ strcpy(Opr.szOprId, "JHEFFERM"); strcpy(Opr.szOprPswd, "JHEFFERM"); !/* Connect to the application server for the database we're going against */ PSMsgConnect(PSMSG_APIVERSION, "10.102.88.159:8003", &Opr, &hCtx); !/* Setup the activity and message definition */ PSMsgStartMessage(hCtx, "Message Agent Example", "CRM_COUNTRY_ADD", 0); !/* Populate each of the fields in the message */ PSMsgSetField(hCtx, "COUNTRY", "CRM"); !/* Attempt to process the message */ PSMsgProcessMessage(hCtx, &nReplyOption); !/* Disconnect from the database */ PSMsgDisconnect(hCtx); printf("Success\n"); return(0); } /* Print an error and die */ void PrintError(char *pStr) { printf("%s\n", pStr); PSMsgDisconnect(hCtx); //exit(1); } ---------cut here------------cut here-----------cut here----------- _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.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/ _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- 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/