* Re: windows and cygwin compiled dll ?
@ 2002-05-29 5:32 Demmer, Thomas
0 siblings, 0 replies; 11+ 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] 11+ 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; 11+ 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] 11+ 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, 0 replies; 11+ 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] 11+ messages in thread
* 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; 11+ 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] 11+ messages in thread
* Re: windows and cygwin compiled dll ? 2002-05-28 8:16 Stefan Hansen @ 2002-05-28 9:33 ` Larry Hall (RFK Partners, Inc) [not found] ` <12056.1022593972@www21.gmx.net> 0 siblings, 1 reply; 11+ 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] 11+ messages in thread
[parent not found: <12056.1022593972@www21.gmx.net>]
* 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; 11+ 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] 11+ 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; 11+ 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] 11+ 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; 11+ 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] 11+ 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; 11+ 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] 11+ 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; 11+ 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] 11+ 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) 0 siblings, 0 replies; 11+ 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] 11+ messages in thread
end of thread, other threads:[~2002-05-29 14:05 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2002-05-29 5:32 windows and cygwin compiled dll ? Demmer, Thomas -- strict thread matches above, loose matches on Subject: below -- 2002-05-28 8:25 John Vincent 2002-05-28 9:21 ` Stefan Hansen 2002-05-28 8:16 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)
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).