public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Linking to commercial dll's
@ 2001-11-11  8:26 David Westbury
  2001-11-11  8:26 ` Ralf Habacker
  2001-11-11  8:26 ` Charles Wilson
  0 siblings, 2 replies; 7+ messages in thread
From: David Westbury @ 2001-11-11  8:26 UTC (permalink / raw)
  To: cygwin

I'm attempting to link a C program that I've written to a commercial dll
(non-MS) using gcc in cygwin. I've read about everything I can find about
dll's but I can't seem to make my program access functions in the dll
correctly. My program compiles/links without errors using gcc, and even
runs correctly to some extent. Some functions work, others don't. The
functions that don't work seem to corrupt memory as evidenced by changes in
random variable values. This occurs even when the function return status
indicates success. The commercial package provides a ".dll" file, a ".lib"
file, and a ".h" file. These are obviously intended for use in a Windows
programming environment. I would appreciate if someone knowledgable would
tell me what steps would typically be required to link a program to a well
established commercial dll. For example, what might a typical gcc string
look like? Do gcc switches like "-L", and "-l" apply? Should I be linking
to the .dll or the .lib file?

Dll's seem to be an especially difficult subject in cygwin, requiring
detailed knowlege of the MS way of doing things. Are dll's not
standardized? Is a "cookbook" approach to dll linking not possible? The
issue seems to be a steep hill for an average working programmer, like me,
to climb. This limits the usefulness of cygwin as a programming environment
for me.

BTW, is cygwin intended for MS programmers wanting to explore the Unix
world or is it of more interest to Unix programmers who, like me, have an
occasional need to run Unix programs on Windows?  Programmers coming from
Unix typically won't know much about dll's so a little more introductory
documentation or pointers to such material would seem appropriate for the
cygwin site. I've been to the bookstores and haven't found much help there,
even in Windows programming texts. Apparently dll's simply work correctly
in Windows and require little explanation. One text did say something that
seemed to indicate that I should be linking against the .lib file as it
contains pointers into the .dll fine. This doesn't work for me at all
however.

Here's the gcc string I'm using that results in a partially working
executable:

gcc -g myprog.c  -o myprog  /<path to commercial dll>/filename.dll

Any help or pointers to information would be greatly appreciated.

thanks,
david




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

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: Linking to commercial dll's
@ 2001-11-11  8:26 David Westbury
  0 siblings, 0 replies; 7+ messages in thread
From: David Westbury @ 2001-11-11  8:26 UTC (permalink / raw)
  To: cygwin


Jade,

I tried your recommended gcc string but no luck. Compiler reports that it
can't resolve references to functions in the dll. Same as if I specify no
filename.lib at all.

Thanks for reponse. Any other ideas greatly appreciated.

david





                                                                                                                   
                    Jade                                                                                           
                    <jade@titan.um       To:     "David Westbury" <David.Westbury@ipaper.com>                      
                    cc.cu>               cc:                                                                       
                                         Subject:     Re: Linking to commercial dll's                              
                    11/15/2001                                                                                     
                    08:44 AM                                                                                       
                                                                                                                   
                                                                                                                   




El jue, 15 nov 2001, escribiste:
>
> gcc -g myprog.c  -o myprog  /<path to commercial dll>/filename.dll

Sorry for sending tthis twice but i made a mistake
you should type :

>gcc -g myprog.c  -o myprog  /<path to commercial lib files of
commarcial dll>/filename.lib --
Jade




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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-11-17 22:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-11  8:26 Linking to commercial dll's David Westbury
2001-11-11  8:26 ` Ralf Habacker
2001-11-11  8:26   ` Ralf Habacker
2001-11-11  8:26     ` Tim Prince
2001-11-11  8:26   ` Ralf Habacker
2001-11-11  8:26 ` Charles Wilson
  -- strict thread matches above, loose matches on Subject: below --
2001-11-11  8:26 David Westbury

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).