This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Repost: PLEASE HELP! Using -mno-cygwin


Your file order is wrong.  List the DLL second and the undefines should
go away.  A little reading on gcc might help you if you run into other 
problems like this.

Good luck,


Larry Hall                              lhall@rfk.com
RFK Partners, Inc.                      http://www.rfk.com
118 Washington Street                   (508) 893-9779 - RFK Office
Holliston, MA 01746                     (508) 893-9889 - FAX



At 11:59 AM 7/23/2001, Chris Marshall wrote:
>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" <ninethirtysix@hotmail.com>
>To: cygwin@cygwin.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 <ctrl>-<c> 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@16'
>/cygdrive/c/DOCUME~1/JHEFFE~1/LOCALS~1/Temp/ccQOStJ5.o.text+0xee):hello_psft.c:
>undefined reference to `PSMsgStartMessage@16'
>/cygdrive/c/DOCUME~1/JHEFFE~1/LOCALS~1/Temp/ccQOStJ5.o.text+0x106):hello_psft.c:
>undefined reference to `PSMsgSetField@12'
>/cygdrive/c/DOCUME~1/JHEFFE~1/LOCALS~1/Temp/ccQOStJ5.o.text+0x121):hello_psft.c:
>undefined reference to `PSMsgSetField@12'
>/cygdrive/c/DOCUME~1/JHEFFE~1/LOCALS~1/Temp/ccQOStJ5.o.text+0x13c):hello_psft.c:
>undefined reference to `PSMsgSetField@12'
>/cygdrive/c/DOCUME~1/JHEFFE~1/LOCALS~1/Temp/ccQOStJ5.o.text+0x151):hello_psft.c:
>undefined reference to `PSMsgProcessMessage@8'
>/cygdrive/c/DOCUME~1/JHEFFE~1/LOCALS~1/Temp/ccQOStJ5.o.text+0x162):hello_psft.c:
>undefined reference to `PSMsgDisconnect@4'
>/cygdrive/c/DOCUME~1/JHEFFE~1/LOCALS~1/Temp/ccQOStJ5.o.text+0x1ac):hello_psft.c:
>undefined reference to `PSMsgDisconnect@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 <string.h>
>#include <stdio.h>
>#include <psmsgapi.h>
>
>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/


--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]