public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* building DLLs
@ 2001-11-02 11:48 nacho
  2001-11-02 11:55 ` Charles Wilson
  2001-11-11  8:26 ` nacho
  0 siblings, 2 replies; 6+ messages in thread
From: nacho @ 2001-11-02 11:48 UTC (permalink / raw)
  To: cygwin

Hi all,

I'm new to this list and I will start with a question that I think
has been asked many times in the past (I've read the archives)
but still can't find a solution.

I'm trying to build a popular XML parsing library, Xerces, on Cygwin
and it requires creating a DLL.

I'm not going into details but there's something specific that
shouldn't happen:

It's supposed that __declspec(dllexport) and __declspec(dllexport) are
no longer needed right? Well, if I omit those then any DLL I try to
build (a very simple example) fails at link time telling me it
cannot export __bss_start, __bss_end, __data_start and __data_end
because they are not defined.

Moreover, I downloaded the latest "dllhelpers" distribution, which
says it works for gcc 2.95.3, the same I have.
I tried all of the examples from it and NONE of them compiles,
all yielding the same errors. Now this is really alarming since
the last update to the dllhelpers was only a month ago.

Well, then I tried, again in my little test DLL, to use the
__declspec directives.

This works, and I knew it worked before because that was the way
I was working before, but only if I put the __declspec in the
definition of the functions (in the .c or .cpp).

When compiling C++ classes, again I can make things work if
I use the __declspec(dllexport) on each method declaration,
and not in the .cpp, but if I put the __declspec(dllexport) on
the class declaration header then again any method in the .cpp
without the __declspec repeated will not appear when linking
an example program against the import library.

Does anyone know what's happening?? This behaavior is not
the expected at all right?

I'd really appreciate the help. I need this package compiled!

-- 
Saludos,
 nacho                          mailto:nacho@iie.edu.uy
--
"Yo no soy paranoico. Eso es lo que *ellos* quieren que piense"
--



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

* Re: building DLLs
  2001-11-02 11:48 building DLLs nacho
@ 2001-11-02 11:55 ` Charles Wilson
  2001-11-11  8:26   ` Charles Wilson
  2001-11-11  8:26 ` nacho
  1 sibling, 1 reply; 6+ messages in thread
From: Charles Wilson @ 2001-11-02 11:55 UTC (permalink / raw)
  To: nacho; +Cc: cygwin

Sounds like you need to update to the latest *binutils* package.

--Chuck


nacho wrote:

> Hi all,
> 
> I'm new to this list and I will start with a question that I think
> has been asked many times in the past (I've read the archives)
> but still can't find a solution.
> 
> I'm trying to build a popular XML parsing library, Xerces, on Cygwin
> and it requires creating a DLL.
> 
> I'm not going into details but there's something specific that
> shouldn't happen:
> 
> It's supposed that __declspec(dllexport) and __declspec(dllexport) are
> no longer needed right? Well, if I omit those then any DLL I try to
> build (a very simple example) fails at link time telling me it
> cannot export __bss_start, __bss_end, __data_start and __data_end
> because they are not defined.
> 
> Moreover, I downloaded the latest "dllhelpers" distribution, which
> says it works for gcc 2.95.3, the same I have.
> I tried all of the examples from it and NONE of them compiles,
> all yielding the same errors. Now this is really alarming since
> the last update to the dllhelpers was only a month ago.
> 
> Well, then I tried, again in my little test DLL, to use the
> __declspec directives.
> 
> This works, and I knew it worked before because that was the way
> I was working before, but only if I put the __declspec in the
> definition of the functions (in the .c or .cpp).
> 
> When compiling C++ classes, again I can make things work if
> I use the __declspec(dllexport) on each method declaration,
> and not in the .cpp, but if I put the __declspec(dllexport) on
> the class declaration header then again any method in the .cpp
> without the __declspec repeated will not appear when linking
> an example program against the import library.
> 
> Does anyone know what's happening?? This behaavior is not
> the expected at all right?
> 
> I'd really appreciate the help. I need this package compiled!
> 
> 



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

* building DLLs
  2001-11-02 11:48 building DLLs nacho
  2001-11-02 11:55 ` Charles Wilson
@ 2001-11-11  8:26 ` nacho
  1 sibling, 0 replies; 6+ messages in thread
From: nacho @ 2001-11-11  8:26 UTC (permalink / raw)
  To: cygwin

Hi all,

I'm new to this list and I will start with a question that I think
has been asked many times in the past (I've read the archives)
but still can't find a solution.

I'm trying to build a popular XML parsing library, Xerces, on Cygwin
and it requires creating a DLL.

I'm not going into details but there's something specific that
shouldn't happen:

It's supposed that __declspec(dllexport) and __declspec(dllexport) are
no longer needed right? Well, if I omit those then any DLL I try to
build (a very simple example) fails at link time telling me it
cannot export __bss_start, __bss_end, __data_start and __data_end
because they are not defined.

Moreover, I downloaded the latest "dllhelpers" distribution, which
says it works for gcc 2.95.3, the same I have.
I tried all of the examples from it and NONE of them compiles,
all yielding the same errors. Now this is really alarming since
the last update to the dllhelpers was only a month ago.

Well, then I tried, again in my little test DLL, to use the
__declspec directives.

This works, and I knew it worked before because that was the way
I was working before, but only if I put the __declspec in the
definition of the functions (in the .c or .cpp).

When compiling C++ classes, again I can make things work if
I use the __declspec(dllexport) on each method declaration,
and not in the .cpp, but if I put the __declspec(dllexport) on
the class declaration header then again any method in the .cpp
without the __declspec repeated will not appear when linking
an example program against the import library.

Does anyone know what's happening?? This behaavior is not
the expected at all right?

I'd really appreciate the help. I need this package compiled!

-- 
Saludos,
 nacho                          mailto:nacho@iie.edu.uy
--
"Yo no soy paranoico. Eso es lo que *ellos* quieren que piense"
--



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

* Re: building DLLs
  2001-11-02 11:55 ` Charles Wilson
@ 2001-11-11  8:26   ` Charles Wilson
  0 siblings, 0 replies; 6+ messages in thread
From: Charles Wilson @ 2001-11-11  8:26 UTC (permalink / raw)
  To: nacho; +Cc: cygwin

Sounds like you need to update to the latest *binutils* package.

--Chuck


nacho wrote:

> Hi all,
> 
> I'm new to this list and I will start with a question that I think
> has been asked many times in the past (I've read the archives)
> but still can't find a solution.
> 
> I'm trying to build a popular XML parsing library, Xerces, on Cygwin
> and it requires creating a DLL.
> 
> I'm not going into details but there's something specific that
> shouldn't happen:
> 
> It's supposed that __declspec(dllexport) and __declspec(dllexport) are
> no longer needed right? Well, if I omit those then any DLL I try to
> build (a very simple example) fails at link time telling me it
> cannot export __bss_start, __bss_end, __data_start and __data_end
> because they are not defined.
> 
> Moreover, I downloaded the latest "dllhelpers" distribution, which
> says it works for gcc 2.95.3, the same I have.
> I tried all of the examples from it and NONE of them compiles,
> all yielding the same errors. Now this is really alarming since
> the last update to the dllhelpers was only a month ago.
> 
> Well, then I tried, again in my little test DLL, to use the
> __declspec directives.
> 
> This works, and I knew it worked before because that was the way
> I was working before, but only if I put the __declspec in the
> definition of the functions (in the .c or .cpp).
> 
> When compiling C++ classes, again I can make things work if
> I use the __declspec(dllexport) on each method declaration,
> and not in the .cpp, but if I put the __declspec(dllexport) on
> the class declaration header then again any method in the .cpp
> without the __declspec repeated will not appear when linking
> an example program against the import library.
> 
> Does anyone know what's happening?? This behaavior is not
> the expected at all right?
> 
> I'd really appreciate the help. I need this package compiled!
> 
> 



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

* Re: Building DLLs
       [not found] <Pine.SUN.3.95.970225182634.10247N-100000@maverick.mcs.anl.gov>
@ 1997-02-26  3:22 ` Fergus Henderson
  0 siblings, 0 replies; 6+ messages in thread
From: Fergus Henderson @ 1997-02-26  3:22 UTC (permalink / raw)
  To: Satish Balay; +Cc: gnu-win32

Satish Balay, you wrote:
> 
> 	I tried using Makefile.DLLs and had a few problems.
> 	(gcc-Beta-17.1)
> 
> 	ld could'nt understand the -L*** -l options.

That's a bit strange.  What error are you getting, exactly?

> 	I had to change linker form ld to gcc
> 
> 	Once i made this change things seem to fall in place.
> 	However I could'nt build my libs as dlls as there were
> 	a bunch of unresolved symbols.
> 
> 	Q: In a case where liba.a -> libb.a -> libc.a ->libd.a
> 	How do I create liba.dll, libb.dll, libc.dll? and not libd.dll
> 	Any Idea if this is possible?

Yes, you just need to set the LDLIBS-foo variable to link in the
appropriate libraries (and of course you need to add the appropriate
dependencies to your makefile, so that make doesn't try to link
with a library before it has been built).

E.g. if libfoo.dll uses libbar.dll, then you need to link it with
`-lbar.stubs'.

	LDLIBS-foo = -lbar.stubs

You might also need `LDFLAGS = -L.' (I forget whether `.' is in
the default search path).

-- 
Fergus Henderson <fjh@cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: < http://www.cs.mu.oz.au/~fjh >   |  of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3         |     -- the last words of T. S. Garp.
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

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

* Building DLLs
@ 1997-02-24 22:51 Fergus Henderson
  0 siblings, 0 replies; 6+ messages in thread
From: Fergus Henderson @ 1997-02-24 22:51 UTC (permalink / raw)
  To: gnu-win32

Hi,

I've put up some explanations on how to create DLLs at
< http://www.cs.mu.oz.au/~fjh/gnu-win32/how-to-build-dlls.html >.

With this method, creating a DLL is relatively simple.
You create a `foo.a' file using `ar' and `ranlib' in the usual manner.
You copy the file `Makefile.DLLs' to your source directory, and add the line

	include Makefile.DLLs

at the very end of your Makefile, and then you type `make foo.dll'.  That's it!
This will also create foo.stubs.a, which is the library that
applications that use the DLL must be linked with.

For details, caveats, and the `Makefile.DLLs' file, see the URL.

I didn't test it very well so there may well be some bugs.  If so,
please let me know.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: < http://www.cs.mu.oz.au/~fjh >   |  of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3         |     -- the last words of T. S. Garp.
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

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

end of thread, other threads:[~2001-11-14  7:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-02 11:48 building DLLs nacho
2001-11-02 11:55 ` Charles Wilson
2001-11-11  8:26   ` Charles Wilson
2001-11-11  8:26 ` nacho
     [not found] <Pine.SUN.3.95.970225182634.10247N-100000@maverick.mcs.anl.gov>
1997-02-26  3:22 ` Building DLLs Fergus Henderson
  -- strict thread matches above, loose matches on Subject: below --
1997-02-24 22:51 Fergus Henderson

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