public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* windows and cygwin compiled dll ?
@ 2002-05-28  8:16 Stefan Hansen
  2002-05-28  9:33 ` Larry Hall (RFK Partners, Inc)
  0 siblings, 1 reply; 13+ messages in thread
From: Stefan Hansen @ 2002-05-28  8:16 UTC (permalink / raw)
  To: cygwin

Hi there,

I want to add a, dll which I compiled under cygwin, to my MSVC++ project.
If I am correct I need a lib file of this dll. How can I create this lib
file ?
And can I use the __declspec(dllexport) and __declspec(dllimport) command ?


If I am on the wrong way at all could you please give to solve my problem?

Thanks
Stefan Hansen

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


--
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] 13+ messages in thread

* Re: windows and cygwin compiled dll ?
  2002-05-28  8:16 windows and cygwin compiled dll ? Stefan Hansen
@ 2002-05-28  9:33 ` Larry Hall (RFK Partners, Inc)
       [not found]   ` <12056.1022593972@www21.gmx.net>
  0 siblings, 1 reply; 13+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2002-05-28  9:33 UTC (permalink / raw)
  To: Stefan Hansen, cygwin

At 07:32 AM 5/28/2002, Stefan Hansen wrote:
>Hi there,
>
>I want to add a, dll which I compiled under cygwin, to my MSVC++ project.
>If I am correct I need a lib file of this dll. How can I create this lib
>file ?


Why not just use the Cygwin .a import library?


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


--
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] 13+ messages in thread

* Re: windows and cygwin compiled dll ?
       [not found]   ` <12056.1022593972@www21.gmx.net>
@ 2002-05-28 11:10     ` Larry Hall (RFK Partners, Inc)
  2002-05-28 11:51       ` Jason Travis
  2002-05-29  6:10       ` Stefan Hansen
  0 siblings, 2 replies; 13+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2002-05-28 11:10 UTC (permalink / raw)
  To: Stefan Hansen; +Cc: cygwin

At 09:52 AM 5/28/2002, Stefan Hansen wrote:
> > At 07:32 AM 5/28/2002, Stefan Hansen wrote:
> > >Hi there,
> > >
> > >I want to add a, dll which I compiled under cygwin, to my MSVC++ project.
> > >If I am correct I need a lib file of this dll. How can I create this lib
> > >file ?
> > 
> > 
> > Why not just use the Cygwin .a import library?
>
>Linking whith .a (which i copy to .lib) is no problem. But during the
>execution i got an Access Violation.


Then it's unlikely that creating a .lib instead will help you.  The .lib
will be the same import library as the .a.  As a result, you'll see the 
same access violation.  If you really want to understand what's causing 
this problem, you'll want to debug it.  I'll point out as well that there
are messages in the email archives that discuss some of the issues and 
pitfalls of adding gcc-generated DLLs to MSVC EXEs.  There can be subtle
problems with this.  You may want to review the email archives to see if 
any of these previous discussions are pertinent to your case.

BTW, I redirected the discussion back to the list, since this is worthwhile
information for the email archives.


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


--
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] 13+ messages in thread

* Re: windows and cygwin compiled dll ?
  2002-05-28 11:10     ` Larry Hall (RFK Partners, Inc)
@ 2002-05-28 11:51       ` Jason Travis
  2002-05-28 12:04         ` Larry Hall (RFK Partners, Inc)
  2002-05-29  6:10       ` Stefan Hansen
  1 sibling, 1 reply; 13+ messages in thread
From: Jason Travis @ 2002-05-28 11:51 UTC (permalink / raw)
  To: Stefan Hansen, Larry Hall (RFK Partners, Inc); +Cc: cygwin

Can anyone tell me how to get off this mailing list?


----- Original Message -----
From: "Larry Hall (RFK Partners, Inc)" <lhall@rfk.com>
To: "Stefan Hansen" <Stefan.Hansen@gmx.net>
Cc: <cygwin@cygwin.com>
Sent: Tuesday, May 28, 2002 9:11 AM
Subject: Re: windows and cygwin compiled dll ?


> At 09:52 AM 5/28/2002, Stefan Hansen wrote:
> > > At 07:32 AM 5/28/2002, Stefan Hansen wrote:
> > > >Hi there,
> > > >
> > > >I want to add a, dll which I compiled under cygwin, to my MSVC++
project.
> > > >If I am correct I need a lib file of this dll. How can I create this
lib
> > > >file ?
> > >
> > >
> > > Why not just use the Cygwin .a import library?
> >
> >Linking whith .a (which i copy to .lib) is no problem. But during the
> >execution i got an Access Violation.
>
>
> Then it's unlikely that creating a .lib instead will help you.  The .lib
> will be the same import library as the .a.  As a result, you'll see the
> same access violation.  If you really want to understand what's causing
> this problem, you'll want to debug it.  I'll point out as well that there
> are messages in the email archives that discuss some of the issues and
> pitfalls of adding gcc-generated DLLs to MSVC EXEs.  There can be subtle
> problems with this.  You may want to review the email archives to see if
> any of these previous discussions are pertinent to your case.
>
> BTW, I redirected the discussion back to the list, since this is
worthwhile
> information for the email archives.
>
>
> Larry Hall                              lhall@rfk.com
> RFK Partners, Inc.                      http://www.rfk.com
> 838 Washington Street                   (508) 893-9779 - RFK Office
> Holliston, MA 01746                     (508) 893-9889 - FAX
>
>
> --
> 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/

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

* Re: windows and cygwin compiled dll ?
  2002-05-28 11:51       ` Jason Travis
@ 2002-05-28 12:04         ` Larry Hall (RFK Partners, Inc)
  2002-05-28 13:18           ` Larry Hall (RFK Partners, Inc)
  0 siblings, 1 reply; 13+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2002-05-28 12:04 UTC (permalink / raw)
  To: Jason Travis, Stefan Hansen; +Cc: cygwin

Have you tried?  Please tell us why the information provided at the bottom
of every message on this list and/or at http://cygwin.com/lists.html doesn't
already answer your question.

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



At 11:14 AM 5/28/2002, Jason Travis wrote:
>Can anyone tell me how to get off this mailing list?
>
>
>----- Original Message -----
>From: "Larry Hall (RFK Partners, Inc)" <lhall@rfk.com>
>To: "Stefan Hansen" <Stefan.Hansen@gmx.net>
>Cc: <cygwin@cygwin.com>
>Sent: Tuesday, May 28, 2002 9:11 AM
>Subject: Re: windows and cygwin compiled dll ?
>
>
> > At 09:52 AM 5/28/2002, Stefan Hansen wrote:
> > > > At 07:32 AM 5/28/2002, Stefan Hansen wrote:
> > > > >Hi there,
> > > > >
> > > > >I want to add a, dll which I compiled under cygwin, to my MSVC++
>project.
> > > > >If I am correct I need a lib file of this dll. How can I create this
>lib
> > > > >file ?
> > > >
> > > >
> > > > Why not just use the Cygwin .a import library?
> > >
> > >Linking whith .a (which i copy to .lib) is no problem. But during the
> > >execution i got an Access Violation.
> >
> >
> > Then it's unlikely that creating a .lib instead will help you.  The .lib
> > will be the same import library as the .a.  As a result, you'll see the
> > same access violation.  If you really want to understand what's causing
> > this problem, you'll want to debug it.  I'll point out as well that there
> > are messages in the email archives that discuss some of the issues and
> > pitfalls of adding gcc-generated DLLs to MSVC EXEs.  There can be subtle
> > problems with this.  You may want to review the email archives to see if
> > any of these previous discussions are pertinent to your case.
> >
> > BTW, I redirected the discussion back to the list, since this is
>worthwhile
> > information for the email archives.
> >
> >
> > Larry Hall                              lhall@rfk.com
> > RFK Partners, Inc.                      http://www.rfk.com
> > 838 Washington Street                   (508) 893-9779 - RFK Office
> > Holliston, MA 01746                     (508) 893-9889 - FAX
> >
> >
> > --
> > 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/

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

* Re: windows and cygwin compiled dll ?
  2002-05-28 12:04         ` Larry Hall (RFK Partners, Inc)
@ 2002-05-28 13:18           ` Larry Hall (RFK Partners, Inc)
  0 siblings, 0 replies; 13+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2002-05-28 13:18 UTC (permalink / raw)
  To: Jason Travis; +Cc: cygwin

Have you tried?  Please tell us why the information provided at the bottom
of every message on this list and/or at http://cygwin.com/lists.html doesn't
already answer your question.

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



At 11:14 AM 5/28/2002, Jason Travis wrote:
>Can anyone tell me how to get off this mailing list?
>
>
>----- Original Message -----
>From: "Larry Hall (RFK Partners, Inc)" <lhall@rfk.com>
>To: "Stefan Hansen" <Stefan.Hansen@gmx.net>
>Cc: <cygwin@cygwin.com>
>Sent: Tuesday, May 28, 2002 9:11 AM
>Subject: Re: windows and cygwin compiled dll ?
>
>
> > At 09:52 AM 5/28/2002, Stefan Hansen wrote:
> > > > At 07:32 AM 5/28/2002, Stefan Hansen wrote:
> > > > >Hi there,
> > > > >
> > > > >I want to add a, dll which I compiled under cygwin, to my MSVC++
>project.
> > > > >If I am correct I need a lib file of this dll. How can I create this
>lib
> > > > >file ?
> > > >
> > > >
> > > > Why not just use the Cygwin .a import library?
> > >
> > >Linking whith .a (which i copy to .lib) is no problem. But during the
> > >execution i got an Access Violation.
> >
> >
> > Then it's unlikely that creating a .lib instead will help you.  The .lib
> > will be the same import library as the .a.  As a result, you'll see the
> > same access violation.  If you really want to understand what's causing
> > this problem, you'll want to debug it.  I'll point out as well that there
> > are messages in the email archives that discuss some of the issues and
> > pitfalls of adding gcc-generated DLLs to MSVC EXEs.  There can be subtle
> > problems with this.  You may want to review the email archives to see if
> > any of these previous discussions are pertinent to your case.
> >
> > BTW, I redirected the discussion back to the list, since this is
>worthwhile
> > information for the email archives.
> >
> >
> > Larry Hall                              lhall@rfk.com
> > RFK Partners, Inc.                      http://www.rfk.com
> > 838 Washington Street                   (508) 893-9779 - RFK Office
> > Holliston, MA 01746                     (508) 893-9889 - FAX
> >
> >
> > --
> > 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/

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

* Re: windows and cygwin compiled dll ?
  2002-05-28 11:10     ` Larry Hall (RFK Partners, Inc)
  2002-05-28 11:51       ` Jason Travis
@ 2002-05-29  6:10       ` Stefan Hansen
  2002-05-29  9:56         ` Larry Hall (RFK Partners, Inc)
  1 sibling, 1 reply; 13+ messages in thread
From: Stefan Hansen @ 2002-05-29  6:10 UTC (permalink / raw)
  To: cygwin

> At 09:52 AM 5/28/2002, Stefan Hansen wrote:
> > > At 07:32 AM 5/28/2002, Stefan Hansen wrote:
> > > >Hi there,
> > > >
> > > >I want to add a, dll which I compiled under cygwin, to my MSVC++
> project.
> > > >If I am correct I need a lib file of this dll. How can I create this
> lib
> > > >file ?
> > > 
> > > 
> > > Why not just use the Cygwin .a import library?
> >
> >Linking whith .a (which i copy to .lib) is no problem. But during the
> >execution i got an Access Violation.
> 
> 
> Then it's unlikely that creating a .lib instead will help you.  The .lib
> will be the same import library as the .a.

If this librarys are the same, why dlltool ? or are im stupid at all ?
I think changing the extension is the wrong way. I think using dlltool is
the proper way.

OK i can ask my question in an other way. I have created a .dll and an .a
file whith cygwin. How can i use this in a MSVC++ source ? (I tried some
different way whith some simpl soucrecodes.) Where are the problems during the
linking and compiling an how can i solve them. 
The informations on the cygwin page i found are rare.

>  As a result, you'll see the 
> same access violation. 

The access violation i got in the case of the .a only !


thanks,
Stefan Hansen

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


--
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] 13+ messages in thread

* Re: windows and cygwin compiled dll ?
  2002-05-29  6:10       ` Stefan Hansen
@ 2002-05-29  9:56         ` Larry Hall (RFK Partners, Inc)
  2002-05-29 11:10           ` crontab -e: error renaming tabs/tmp.000560 Permission denied Christopher Cobb
  0 siblings, 1 reply; 13+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2002-05-29  9:56 UTC (permalink / raw)
  To: Stefan Hansen, cygwin

At 02:38 AM 5/29/2002, Stefan Hansen wrote:
> > At 09:52 AM 5/28/2002, Stefan Hansen wrote:
> > > > At 07:32 AM 5/28/2002, Stefan Hansen wrote:
> > > > >Hi there,
> > > > >
> > > > >I want to add a, dll which I compiled under cygwin, to my MSVC++
> > project.
> > > > >If I am correct I need a lib file of this dll. How can I create this
> > lib
> > > > >file ?
> > > > 
> > > > 
> > > > Why not just use the Cygwin .a import library?
> > >
> > >Linking whith .a (which i copy to .lib) is no problem. But during the
> > >execution i got an Access Violation.
> > 
> > 
> > Then it's unlikely that creating a .lib instead will help you.  The .lib
> > will be the same import library as the .a.
>
>If this librarys are the same, why dlltool ? or are im stupid at all ?


dlltool is necessary to create an import library from a DLL.  Once the import
library is created though, you don't need dlltool. ;-)


>I think changing the extension is the wrong way. I think using dlltool is
>the proper way.


OK, you should work as you feel comfortable.  I'll only make two comments 
about this statement:

   1. I didn't suggest changing the extension.
   2. dlltool *is* the "proper way" to make an import library from a 
      pre-existing DLL.  Unless I misunderstand what you're doing, this
      isn't your situation.


>OK i can ask my question in an other way. I have created a .dll and an .a
>file whith cygwin. How can i use this in a MSVC++ source ? (I tried some
>different way whith some simpl soucrecodes.) Where are the problems during the
>linking and compiling an how can i solve them. 
>The informations on the cygwin page i found are rare.


It's not recommended because of various complications.  These include (as
Rob Collins pointed out yesterday):

Structure alignment
C runtime
Exception handling
No C++. 

You'll find more discussion of this subject in the email list archives.
However, if you handle these areas properly, you can do what you're 
suggesting.  

You're probably better off looking at Chuck Wilson's site for DLL building
examples.  

http://www.neuro.gatech.edu/users/cwilson/cygutils/


> >  As a result, you'll see the 
> > same access violation. 
>
>The access violation i got in the case of the .a only !


OK.  I guess you're doing something different with the .lib you're 
creating.  I can't say whether that's good or bad.   My guess is that it's
bad but you'll need to debug it to find out for sure.



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


--
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] 13+ messages in thread

* crontab -e: error renaming tabs/tmp.000560 Permission denied
  2002-05-29  9:56         ` Larry Hall (RFK Partners, Inc)
@ 2002-05-29 11:10           ` Christopher Cobb
       [not found]             ` <20020529174712.GA12913@butch.jgcomp.com>
  0 siblings, 1 reply; 13+ messages in thread
From: Christopher Cobb @ 2002-05-29 11:10 UTC (permalink / raw)
  Cc: cygwin

I have successfully gotten cron working on my W2K system.

However, because of permissions problems on the /var/cron/tabs directories, crontab
-e fails.

I can repeat the following steps to reproduce the problem:

cygrunsrv -E cron
cygrunsrv -R cron
cd /var
# (I have a whole collection of cron-* directories that I cannot delete
# if anyone can tell me how to delete them, please let me know!)
test -d cron && mv cron cron-`date +%Y%m%d%H%M%S`
# Here I make new cron/tabs directories and set permissions to 1777 as was
# suggested by this mailing list
mkdir cron
chmod 1777 cron
mkdir cron/tabs
chmod 1777 cron/tabs
# Here I create a new crontab file using crontab -e
# It works the first time
echo '* * * * * date > /tmp/date.cron' > /tmp/redo-cron.$$.1
echo ":0r/tmp/redo-cron.$$.1
ZZ" | crontab -e
# I can do crontab -l here an a single entry is displayed
# Now I install and start cron with
cygrunsrv -I cron -p /usr/sbin/cron -a'-D' -e "PATH=C:/cygwin/bin" -e "CYGWIN=tty
ntsec"
cygrunsrv -S cron

# At this point the permissions on /var/cron/tabs has been changed and crontab -e
does not work:
echo '* * * * * /home/ccobb/mycvs/ccobb/scripts/crontrace' > /tmp/redo-cron.$$.2
echo ":0r/tmp/redo-cron.$$.2
ZZ" | crontab -e

# the error output from crontab -e is:
crontab: error renaming tabs/tmp.000560 to tabs/ccobb
rename: Permission denied

At this point, if I use Windows Explorer to look at the properties on the cron
directory (Security tab), I get a dialog with:

    You only have permission to view the security information on cron.

For Everyone, the Allow and Deny columns are grayed out, and only the last four
entries are checked.  Full Control and Modify are unchecked and there is now way to
change them.

For SYSTEM, they are all still grayed out but all are checked.

I'm happy to have cron working, but how do I get crontab -e working?

cc




--
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] 13+ messages in thread

* Re: crontab -e: error renaming tabs/tmp.000560 Permission denied
       [not found]             ` <20020529174712.GA12913@butch.jgcomp.com>
@ 2002-05-29 19:59               ` Christopher Cobb
  0 siblings, 0 replies; 13+ messages in thread
From: Christopher Cobb @ 2002-05-29 19:59 UTC (permalink / raw)
  To: cygwin

Jon LaBadie wrote:

> On Wed, May 29, 2002 at 11:51:34AM -0400, Christopher Cobb wrote:
> > I have successfully gotten cron working on my W2K system.
> >
> > However, because of permissions problems on the /var/cron/tabs directories, crontab
> > -e fails.
> >
>    snip
> >
> > At this point, if I use Windows Explorer to look at the properties on the cron
> > directory (Security tab), I get a dialog with:
> >
> >     You only have permission to view the security information on cron.
> >
> > For Everyone, the Allow and Deny columns are grayed out, and only the last four
> > entries are checked.  Full Control and Modify are unchecked and there is now way to
> > change them.
> >
> > For SYSTEM, they are all still grayed out but all are checked.
>
> Not a specific answer, but something I find impossible to believe about w2k.
> Remember I'm a unix person and this apalls me.
>
> While looking at the security panel, there is a button labeled "advanced".
> That leads to a 3 tab panel with "owners" being one tab.  In there you
> can change the ownership (at least to administrator), then go back and
> change the permissions to what you want.  Perhaps then you can reset the
> original ownership.
>
> --
> Jon H. LaBadie                  jcyg@jgcomp.com
>  JG Computing
>  4455 Province Line Road        (609) 252-0159
>  Princeton, NJ  08540-4322      (609) 683-7220 (fax)

Thanks Jon.  Your suggestion panned out.  But it required two visits to cron-->properties
from Windows Explorer.  The first was to change the owner (to Administrators or myself,
either worked).  I then had to OK all the way out.  I then did a properties a second
time, and this time the security properties were editable.

This made cron/tabs/* editable and crontab -e worked.

However, the next time I re-installed cron, the problem came back.

I think this is definitely a bug.

cc



--
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] 13+ messages in thread

* Re: windows and cygwin compiled dll ?
@ 2002-05-29  5:32 Demmer, Thomas
  0 siblings, 0 replies; 13+ messages in thread
From: Demmer, Thomas @ 2002-05-29  5:32 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

> At 09:52 AM 5/28/2002, Stefan Hansen wrote:
> > > At 07:32 AM 5/28/2002, Stefan Hansen wrote:
> > > >Hi there,
> > > >
> > > >I want to add a, dll which I compiled under cygwin, to my MSVC++
> project.
> > > >If I am correct I need a lib file of this dll. How can I create this
> lib
> > > >file ?
> > > 
> > > 
> > > Why not just use the Cygwin .a import library?
> >
> >Linking whith .a (which i copy to .lib) is no problem. But during the
> >execution i got an Access Violation.
> 
> At which exact do you get the Access violation? I have noticed the
> following
> difference in linking cygwin code into Borland's Delphi:
> Something like
> 
> function malloc(size:Integer):pointer;cdecl;external 'cygwin1.dll' name
> 'malloc';
> 
> bombs with a SIGSEGV at runtime. Also with functions in an own DLL that
> call run-time functions that need proper initialization.
> However, if I declare a pointer to a function, do a LoadLibrary('my.dll')
> and get the
> address of the function with GetProcAddress(handle,'myfunc'), everything
> runs
> fine. My dll initializes the cygwin1.dll properly. I have no idea why this
> works, 
> as the Delphi startup code should be doing exactly the same thing, but I
> guess
> it has something to do with the correct entry points into cygwin1.dll. 
> I can send you a working example off-list, if you are interested.
> 
> Ciao
> Tom
> 
> Thomas Demmer
> Kraft Foods R&D Munich
> Phone: +49 89 62738-6302
> Fax:      +49 89 62738-86302
> 
> Thought of the Day:
> Anyone who uses the phrase "easy as taking candy from a baby" has never
> tried taking candy from a baby.
>                 -- Robin Hood
> 
> 

--
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] 13+ messages in thread

* Re: windows and cygwin compiled dll ?
  2002-05-28  8:25 windows and cygwin compiled dll ? John Vincent
@ 2002-05-28  9:21 ` Stefan Hansen
  0 siblings, 0 replies; 13+ messages in thread
From: Stefan Hansen @ 2002-05-28  9:21 UTC (permalink / raw)
  To: cygwin

Hi,

i use the files from the example:
http://cygwin.com/building-reloc-dlls.txt

I created whith the make script (the same example) the DLL. 
Then I use (thank to John Vincent)
 
dlltool -D fooB.dll -l fooB.lib

I got the lib.

Then I copy the main.c, fooB.dll, fooB.lib and the cygwin1.dll in the MSVC
Projectdir.

compiling whith MSVC returns:

--------------------Konfiguration: relocDLLTest - Win32
Debug--------------------
Kompilierung läuft...
main.c
C:\user\Hansen\DLL\relocDLLTest\main.c(8) : warning C4013: 'doit'
undefiniert; Annahme: extern mit Rueckgabetyp int
C:\user\Hansen\DLL\relocDLLTest\main.c(9) : warning C4013: 'doittoo'
undefiniert; Annahme: extern mit Rueckgabetyp int
Linker-Vorgang läuft...
main.obj : error LNK2001: Nichtaufgeloestes externes Symbol _doittoo
main.obj : error LNK2001: Nichtaufgeloestes externes Symbol _doit
Debug/relocDLLTest.exe : fatal error LNK1120: 2 unaufgeloeste externe
Verweise
Fehler beim Ausführen von link.exe.

relocDLLTest.exe - 3 Fehler, 2 Warnung(en)


------------------

so i added to the main file the lines

int doit(int i);
int doittoo(int i);

and compiled again

--------------------Konfiguration: relocDLLTest - Win32
Debug--------------------
Kompilierung läuft...
main.c
Linker-Vorgang läuft...
main.obj : error LNK2001: Nichtaufgeloestes externes Symbol _doittoo
main.obj : error LNK2001: Nichtaufgeloestes externes Symbol _doit
Debug/relocDLLTest.exe : fatal error LNK1120: 2 unaufgeloeste externe
Verweise
Fehler beim Ausführen von link.exe.

relocDLLTest.exe - 3 Fehler, 0 Warnung(en)

----------

I got again the LNK2001 Error. (the same error I got whithout the lib file.)
have i to use this stupid __decspec(dlleport) ? 

hope you could still help

Stefan Hansen

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


--
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] 13+ messages in thread

* Re: windows and cygwin compiled dll ?
@ 2002-05-28  8:25 John Vincent
  2002-05-28  9:21 ` Stefan Hansen
  0 siblings, 1 reply; 13+ messages in thread
From: John Vincent @ 2002-05-28  8:25 UTC (permalink / raw)
  To: Stefan.Hansen; +Cc: cygwin

Hi,

The cygwin binutils package contains a utility
called dlltool which I think does what you require.

/John Vincent.


_________________________________________________________________
Join the worldÂ’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.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/

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

end of thread, other threads:[~2002-05-29 21:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-28  8:16 windows and cygwin compiled dll ? Stefan Hansen
2002-05-28  9:33 ` Larry Hall (RFK Partners, Inc)
     [not found]   ` <12056.1022593972@www21.gmx.net>
2002-05-28 11:10     ` Larry Hall (RFK Partners, Inc)
2002-05-28 11:51       ` Jason Travis
2002-05-28 12:04         ` Larry Hall (RFK Partners, Inc)
2002-05-28 13:18           ` Larry Hall (RFK Partners, Inc)
2002-05-29  6:10       ` Stefan Hansen
2002-05-29  9:56         ` Larry Hall (RFK Partners, Inc)
2002-05-29 11:10           ` crontab -e: error renaming tabs/tmp.000560 Permission denied Christopher Cobb
     [not found]             ` <20020529174712.GA12913@butch.jgcomp.com>
2002-05-29 19:59               ` Christopher Cobb
2002-05-28  8:25 windows and cygwin compiled dll ? John Vincent
2002-05-28  9:21 ` Stefan Hansen
2002-05-29  5:32 Demmer, Thomas

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).