Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Csound output from API on windows was Re: Using the C++ api on Windows with mingw

Date2008-09-02 16:11
FromMichael Gogins
SubjectRe: [Cs-dev] Csound output from API on windows was Re: Using the C++ api on Windows with mingw
It's not that simple. csnd.so or .dll supports interfaces. The interfaces to Python and maybe other languages have a 'module name' which is the same for both 32 bit and 64 bit code. Either the interfaces should only be supported for 64 bit samples, or we need separate names for everything -- csnd32.dll/csnd/64.dll, _csnd32.pyd/_csnd64.pyd, csnd32.py/csnd64.py, and so on. And then, the user needs to 'import csnd64' or 'import csnd32' depending. 

The same applies to Java, Lua, Lisp, and so on.

I had no idea anyone would ever want to install 32 bit and 64 bit in the same environment. Probably the easiest solution is to just make it plain to people that they need separate environments for float and for double -- that should prevent these problems. In other words, if PYTHONPATH, ldconfig on Linux, PATH, and the Csound environment variables all are set appropriately, perhaps in a batch file, for the particular version of Csound there should be no problem.

Or, we can go ahead and make all these changes to ensure the two versions can run side by side in the same environment. That's certainly possible, though I don't like it.

Better yet, drop the float version and only maintain the double version.

Hope this helps,
Mike

-----Original Message-----
>From: Andres Cabrera 
>Sent: Sep 2, 2008 8:42 AM
>To: Developer discussions 
>Subject: Re: [Cs-dev] Csound output from API on windows was Re: Using the	C++ api on Windows with mingw
>
>I used the installers, so I think that both the doubles and floats versions
>name the file in the same way. This seems to happen on Mac also. Should
>Sconstruct be modified so that when building doubles or floats, the name of
>that dll changes?
>
>Cheers,
>Andrés
>
>On Tue, Sep 2, 2008 at 6:59 AM,  wrote:
>
>>
>> yes, I reckon that is what you need, a separate csnd.dll. Also make sure
>> when you are doing a doubles build that you define USE_DOUBLE otherwise
>> there will be trouble...
>>
>> Victor
>>
>> ----- Original Message -----
>> From: Andres Cabrera 
>> Date: Tuesday, September 2, 2008 2:36 am
>> Subject: Re: [Cs-dev] Csound output from API on windows was Re: Using the
>> C++ api on Windows with mingw
>> To: Developer discussions 
>>
>> > Hi,
>> >
>> > There's something odd going on... I'm not sure what I'm doing
>> > wrong... When linking to the doubles version, everything works
>> > as expected, and the messages are printed inside my application.
>> > When trying to link to the floats version, The program compiles
>> > fine, but it doesn't use the floats version, and it prints
>> > the output to the original terminal.
>> >
>> >
>> > When building qutecsound, things look like this (Nowhere is it
>> > linking to the doubles version):
>> > g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-
>> > runtime-pseudo-rel
>> > oc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o
>> > "bin\qutecsound.exe" object_sc
>> >
>> > ript.qutecsound.Release  -L"c:\Qt\4.3.2\lib" -
>> > lmingw32 -lqtmain release\qutecsou
>> > nd_res.o "C:\Archivos de
>> > programa\Csound\bin\Csound32.dll.5.1" "C:\Archivos de p
>> > rograma\Csound\bin\csnd.dll" -lQtXml4 -lQtGui4 -lQtCore4
>> >
>> >
>> > But when run, he output (which is only visible if use use the
>> > mingw shell, as the ordinary dos prompt will show nothing), says
>> > that I'm using the doubles version.
>> >
>> > It appears that csnd.dll is linked to the doubles version, so
>> > that's what it uses. Jim Bates,. who has been helping me
>> > with the PPC build has reported the same problem on OS X. Maybe
>> > there needs to be a separate csnd.dll for floats and for doubles?
>> >
>> >
>> > Any ideas?
>> >
>> > Cheers,
>> > Andrés
>> >
>> > On Sun, Aug 31, 2008 at 6:44 PM, victor wrote:
>> >
>> >
>>>
>>>
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > Not sure. Once you set a message callback, messages
>>> > should not appear
>>>
>>> > at the console (because they are implemented with
>>> > csound->Message).
>>>
>>> >
>>>
>>> > Victor
>>>
>>> >
>>>
>>>
>>> > ----- Original Message -----
>>>
>>> >
>>> > *From:*
>>> > Andres
>>> > Cabrera
>>>
>>> > *To:* Developer discussions
>>> >
>>>
>>> >
>>>
>>> > *Sent:* Sunday, August 31, 2008 3:56
>>> > PM
>>>
>>> > *Subject:* [Cs-dev] Csound output from API
>>> > on windows was Re: Using the C++ api on Windows with mingw
>>>
>>> >
>>> >
>>>
>>> > Thanks Victor,
>>> > That worked indeed, and now I have a running
>>> > version of qutecsound on Windows. However, the messages are not being
>>> > redirected correctly, in other words, it seems that
>>> csound.SetMessageCallback
>>> > is not working like in other platforms (the messages are shown on the
>>> console,
>>> > not within my application). What do I need to do to redirect Csound's
>>> output
>>> > from the API on windows?
>>> >
>>> > Cheers,
>>> > Andrés
>>> >
>>> >
>>> > On Thu, Aug 28, 2008 at 10:42 PM, victor 
>>> > wrote:
>>> >
>>> >
>>>>
>>>>
>>>> >
>>>> > I think this is because of your ld.exe. Try to
>>>> > get a different version (I think
>>>>
>>>> > it's binutils). Another solution is to build
>>>> > csound yourself and then use
>>>>
>>>> > libcsound.a as the link library
>>>>
>>>> >
>>>>
>>>> > Victor
>>>>
>>>> >
>>>>
>>>>
>>>> >
>>>> >
>>>>
>>>> >
>>>> > -----
>>>> > Original Message -----
>>>>
>>>> >
>>>> > *From:*
>>>> > Andres Cabrera
>>>>
>>>> > *To:*
>>>> > Developer
>>>> > discussions
>>>>
>>>> > *Sent:*
>>>> > Thursday, August 28, 2008 9:01 PM
>>>>
>>>> > *Subject:*
>>>> > [Cs-dev] Using the C++ api on Windows with mingw
>>>>
>>>> >
>>>> >
>>>>
>>>> > Hi,
>>>> >
>>>> > Trying to build qutecsound on Windows using the
>>>> > C++ API and Mingw, produces:
>>>> >
>>>> c:\Qt\4.3.2\bin\qmake.exe
>>>> > -win32 -o Makefile src.pro
>>>> > mingw32-make -f
>>>> > Makefile.Release
>>>> > mingw32-make[1]: Entering directory
>>>> > `C:/tools/qutecsound/trunk/qutecsound/src'
>>>> > g++ -enable-stdcall-fixup
>>>> > -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
>>>> > oc -Wl,-s
>>>> > -mthreads -Wl -Wl,-subsystem,windows -o "bin\qutecsound.exe"
>>>> > object_sc
>>>> > ript.qutecsound.Release  -L"c:\Qt\4.3.2\lib" -lmingw32
>>>> > -lqtmain "C:\Archivos de
>>>> > programa\Csound\bin\csound64.dll.5.1"
>>>> > "C:\Archivos de programa\Csound\bin\csnd.d
>>>> > ll" -lQtXml4 -lQtGui4
>>>> > -lQtCore4
>>>> > C:\Archivos de
>>>> > programa\Csound\bin\csound64.dll.5.1(.text+0x110):cygming-crtend.
>>>> > c:
>>>> > multiple definition of `atexit'
>>>> > /mingw/lib/crt2.o(.text+0x260):crt1.c:
>>>> > first defined here
>>>> > C:\Archivos de
>>>> > programa\Csound\bin\csound64.dll.5.1(.text+0x140):cygming-crtend.
>>>> > c:
>>>> > multiple definition of `_onexit'
>>>> > /mingw/lib/crt2.o(.text+0x270):crt1.c:
>>>> > first defined here
>>>> > C:\Archivos de
>>>> > programa\Csound\bin\csound64.dll.5.1(.text+0x230):cygming-crtend.
>>>> > c:
>>>> > multiple definition of
>>>> > `__main'
>>>> > /mingw/lib/libmingw32.a(gccmain.o)(.text+0xa0):gccmain.c:
>>>> > first defined here
>>>> > C:\Archivos de
>>>> > programa\Csound\bin\csound64.dll.5.1(.text+0x7a670):cygming-crten
>>>> > d.c:
>>>> > multiple definition of
>>>> > `_pei386_runtime_relocator'
>>>> > /mingw/lib/libmingw32.a(pseudo-reloc.o)(.text+0x0):pseudo-reloc.c:
>>>> > first defined
>>>> >  here
>>>> > C:\Archivos de
>>>> > programa\Csound\bin\csound64.dll.5.1(.rdata+0x197ac):cygming-crte
>>>> > nd.c:
>>>> > multiple definition of
>>>> > `__RUNTIME_PSEUDO_RELOC_LIST__'
>>>> >
>>>> /mingw/lib/libmingw32.a(pseudo-reloc-list.o)(.bss+0x0):pseudo-reloc-list.c:
>>>> > firs
>>>> > t defined here
>>>> > C:\Archivos de
>>>> > programa\Csound\bin\csound64.dll.5.1(.rdata+0x197ac):cygming-crte
>>>> > nd.c:
>>>> > multiple definition of
>>>> > `__RUNTIME_PSEUDO_RELOC_LIST_END__'
>>>> >
>>>> /mingw/lib/libmingw32.a(pseudo-reloc-list.o)(.bss+0x1):pseudo-reloc-list.c:
>>>> > firs
>>>> > t defined
>>>> > here
>>>> > C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe:
>>>> > C:\Archivo
>>>> > s de programa\Csound\bin\csound64.dll.5.1(dghcs00024.o):
>>>> > illegal symbol index 18
>>>> > 64673616 in relocs
>>>> > collect2: ld returned 1
>>>> > exit status
>>>> > mingw32-make[1]: *** [bin\qutecsound.exe] Error
>>>> > 1
>>>> > mingw32-make[1]: Leaving directory
>>>> > `C:/tools/qutecsound/trunk/qutecsound/src'
>>>> > mingw32-make: *** [release]
>>>> > Error 2
>>>> >
>>>> > If I just link to csnd.dll instead of the csound.dll.5.1
>>>> > library, I get:
>>>> > c:\Qt\4.3.2\bin\qmake.exe -win32 -o Makefile src.pro
>>>> > mingw32-make -f
>>>> > Makefile.Release
>>>> > mingw32-make[1]: Entering directory
>>>> > `C:/tools/qutecsound/trunk/qutecsound/src'
>>>> > g++ -enable-stdcall-fixup
>>>> > -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
>>>> > oc -Wl,-s
>>>> > -mthreads -Wl -Wl,-subsystem,windows -o "bin\qutecsound.exe"
>>>> > object_sc
>>>> > ript.qutecsound.Release  -L"c:\Qt\4.3.2\lib" -lmingw32
>>>> > -lqtmain "C:\Archivos de
>>>> > programa\Csound\bin\csnd.dll" -lQtXml4
>>>> > -lQtGui4 -lQtCore4
>>>> > ./release\qutecsound.o(.text+0x40):qutecsound.cpp:
>>>> > undefined reference to
>>>> > `csoun
>>>> > dGetHostData'
>>>> > ./release\qutecsound.o(.text+0x11887):qutecsound.cpp:
>>>> > undefined reference to
>>>> > `cs
>>>> > oundSetMessageCallback'
>>>> > ./release\qutecsound.o(.text+0x118a2):qutecsound.cpp:
>>>> > undefined reference to
>>>> > `cs
>>>> > oundSetHostData'
>>>> > ./release\qutecsound.o(.text+0x1197b):qutecsound.cpp:
>>>> > undefined reference to `cs
>>>> > oundStop'
>>>> > collect2: ld returned 1 exit
>>>> > status
>>>> > mingw32-make[1]: *** [bin\qutecsound.exe] Error
>>>> > 1
>>>> > mingw32-make[1]: Leaving directory
>>>> > `C:/tools/qutecsound/trunk/qutecsound/src'
>>>> > mingw32-make: *** [release]
>>>> > Error 2
>>>> >
>>>> >
>>>> > Any ideas where I'm going wrong? (This happens with
>>>> > both the floats and double versions)
>>>> >
>>>> > Cheers,
>>>> > Andrés
>>>> > --
>>>> >
>>>> >
>>>> >
>>>> > Andrés
>>>> >
>>>>
>>>> >
>>>>
>>>>
>>>> >
>>>> ------------------------------
>>>>
>>>> >
>>>> >
>>>>
>>>> -------------------------------------------------------------------------
>>>> > This
>>>> > SF.Net email is sponsored by the Moblin Your Move Developer's
>>>> > challenge
>>>> > Build the coolest Linux based applications with Moblin SDK
>>>> > & win great prizes
>>>> > Grand prize is a trip for two to an Open Source
>>>> > event anywhere in the world
>>>> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> >
>>>> >
>>>>
>>>>
>>>> >
>>>> ------------------------------
>>>>
>>>> >
>>>> >
>>>>
>>>> _______________________________________________
>>>> > Csound-devel
>>>> > mailing list
>>>> > Csound-devel@lists.sourceforge.net
>>>> > https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>> >
>>>> >
>>>>
>>>>
>>>> >
>>>> -------------------------------------------------------------------------
>>>> > This
>>>> > SF.Net email is sponsored by the Moblin Your Move Developer's
>>>> > challenge
>>>> > Build the coolest Linux based applications with Moblin SDK
>>>> > & win great prizes
>>>> > Grand prize is a trip for two to an Open Source
>>>> > event anywhere in the world
>>>> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> > _______________________________________________
>>>> >
>>>> > Csound-devel
>>>> > mailing list
>>>> > Csound-devel@lists.sourceforge.net
>>>> > https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>> >
>>>> >
>>>> >
>>>
>>>
>>> >
>>>
>>> > --
>>> >
>>> >
>>> > Andrés
>>> >
>>>
>>> >
>>>
>>>
>>> >
>>> ------------------------------
>>>
>>> >
>>> >
>>>
>>> -------------------------------------------------------------------------
>>> > This
>>> > SF.Net email is sponsored by the Moblin Your Move Developer's
>>> > challenge
>>> > Build the coolest Linux based applications with Moblin SDK &
>>> > win great prizes
>>> > Grand prize is a trip for two to an Open Source event
>>> > anywhere in the
>>> > world
>>> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> >
>>>
>>>
>>> >
>>> ------------------------------
>>>
>>> >
>>> >
>>>
>>> _______________________________________________
>>> > Csound-devel mailing
>>> > list
>>> > Csound-devel@lists.sourceforge.net
>>> > https://lists.sourceforge.net/lists/listinfo/csound-devel
>>> >
>>> >
>>>
>>>
>>> >
>>> >
>>> -------------------------------------------------------------------------
>>> >
>>> > This SF.Net email is sponsored by the Moblin Your Move Developer's
>>> challenge
>>> >
>>> > Build the coolest Linux based applications with Moblin SDK & win great
>>> prizes
>>> >
>>> > Grand prize is a trip for two to an Open Source event anywhere in the
>>> world
>>> >
>>> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> > _______________________________________________
>>> >
>>> > Csound-devel mailing list
>>> >
>>> > Csound-devel@lists.sourceforge.net
>>> >
>>> > https://lists.sourceforge.net/lists/listinfo/csound-devel
>>> >
>>> >
>>> >
>>
>>
>> >
>>
>> > --
>> >
>> >
>> > Andrés
>> >
>> >
>>
>> > > -----------------------------------------------------------------
>>
>> > --------
>> > This SF.Net email is sponsored by the Moblin Your Move
>> > Developer's challenge
>> > Build the coolest Linux based applications with Moblin SDK & win
>> > great prizes
>> > Grand prize is a trip for two to an Open Source event anywhere
>> > in the world
>> > http://moblin-contest.org/redirect.php?banner_id=100&url=/>
>> _______________________________________________
>> > Csound-devel mailing list
>> > Csound-devel@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>
>
>-- 
>
>
>Andrés




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourcef

Date2008-09-02 17:35
From"Andres Cabrera"
SubjectRe: [Cs-dev] Csound output from API on windows was Re: Using the C++ api on Windows with mingw
AttachmentsNone  None  None  None  

Date2008-09-02 18:03
FromFelipe Sateler
SubjectRe: [Cs-dev]
AttachmentsNone  None  None