Csound Csound-dev Csound-tekno Search About

[CSOUND-DEV:3777] Re: DLLs on Cygwin

Date2003-12-16 14:32
From"gogins@pipeline.com"
Subject[CSOUND-DEV:3777] Re: DLLs on Cygwin
I've always defined with exactly the same signature that I declared.

Original Message:
-----------------
From:  ramsdell@mitre.org (John D. Ramsdell)
Date: 15 Dec 2003 19:38:46 -0500
To: csound-dev@eartha.mills.edu
Subject: [CSOUND-DEV:3774] Re: DLLs on Cygwin


Antoine Lefebvre  writes:

> I did compile csound 4 with ./configure --enable-shared and it seems that
i
> don't get the error you are talking about. When done with compilation, i
have
> cygcsound-0.dll in my .libs directory

This is definitely something I don't achieve.  Something must be
broken in my installation, I guess.

> The only problem that i get is when creating the executable
> 
> make[2]: Entering directory `/home/antoine/csound/csound'
> /bin/bash ../libtool --mode=link gcc  -g -O2 -Wall -falign-loops=4
> -falign-jumps
> =4 -ffast-math -fomit-frame-pointer -finline-functions -funroll-loops   -o
> csoun
> d.exe  ccsound.o libcsound.la -lwinmm
> gcc -g -O2 -Wall -falign-loops=4 -falign-jumps=4 -ffast-math
> -fomit-frame-pointe
> r -finline-functions -funroll-loops -o .libs/csound.exe ccsound.o
> ./.libs/libcs
> ound.dll.a -lwinmm -Wl,--rpath -Wl,/usr/local/lib
> ccsound.o(.text+0x23): In function `main':
> /home/antoine/csound/csound/ccsound.c:9: undefined reference to
> `_csoundCreate'
> ccsound.o(.text+0x3b):/home/antoine/csound/csound/ccsound.c:10: undefined
> refere
> nce to `_csoundPerform'
> ccsound.o(.text+0x45):/home/antoine/csound/csound/ccsound.c:11: undefined
> refere
> nce to `_csoundCleanup'
> ccsound.o(.text+0x4d):/home/antoine/csound/csound/ccsound.c:12: undefined
> refere
> nce to `_csoundReset'
> ccsound.o(.text+0x55):/home/antoine/csound/csound/ccsound.c:13: undefined
> refere
> nce to `_csoundDestroy'
> collect2: ld returned 1 exit status
> make[2]: *** [csound.exe] Error 1
> make[2]: Leaving directory `/home/antoine/csound/csound'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/home/antoine/csound/csound'

Well, this will not do.  The ccsound object file never found the
symbols it was looking for from the DLL.  Perhaps I exported symbols
incorectly.  Please look at csound/csound.c and csound/csound.h.  I
added PUBLIC to both the declaration and definition of exported
symbols.

In the header I wrote:

PUBLIC void* csoundCreate(void *);

Was I supposed to write:

void* csoundCreate(void *) PUBLIC;

In the C source I wrote:
        
PUBLIC void* csoundCreate(void * data)
{
   ...
}

Do definitions require PUBLIC?

John


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .

Date2003-12-16 17:36
Fromramsdell@mitre.org (John D. Ramsdell)
Subject[CSOUND-DEV:3778] Re: DLLs on Cygwin
"gogins@pipeline.com"  writes:

> I've always defined with exactly the same signature that I declared.

As you noted, the signatures are not the problem.  Here is how I know.
Yesterday, I wrote a small, hello world style application that prints
hello world from a routine made available in a DLL.  The printer also
includes a call to the routine in -lwinmm that returns the number of
input MIDI devices and prints the number.  A libtool enabled GNU build
system built around this library code and it's main routine has no
problem with linking, and in particular, the executable has no problem
finding all the information it needs to use
c:/WINNT/system32/winmm.dll when invoked.  There must be something
funny the my configure.ac or csound/Makefile.am that breaks libtool's
paths for Csound.  I have to look at this more tonight.

John