Csound Csound-dev Csound-tekno Search About

[Csnd] csoundApi error

Date2020-02-24 20:31
Fromfauveboy
Subject[Csnd] csoundApi error
Attemptinf the very first example here:
http://write.flossmanuals.net/csound/a-the-csound-api/

This is the output: http://ix.io/2cB1

How can I correct the code here? the compiler complains about an
incompatible pointer type but the floss manual says how a null can be
accepted to an opaque pointer, is this perhaps not where the error is?



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-02-24 21:52
FromPete Goodeve
SubjectRe: [Csnd] csoundApi error
AttachmentsNone  

Date2020-02-24 22:11
Fromjoachim heintz
SubjectRe: [Csnd] csoundApi error
not sure it is related, but we have a new version of this chapter here:
https://csound-floss.firebaseapp.com/csound-and-other-programming-languages/the-csound-api

the whole new csound floss manual will soon be ready, but this chapter 
is already done (thanks for françois pinot).

	joachim


On 24/02/2020 21:31, fauveboy wrote:
> Attemptinf the very first example here:
> http://write.flossmanuals.net/csound/a-the-csound-api/
> 
> This is the output: http://ix.io/2cB1
> 
> How can I correct the code here? the compiler complains about an
> incompatible pointer type but the floss manual says how a null can be
> accepted to an opaque pointer, is this perhaps not where the error is?
> 
> 
> 
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-02-24 22:51
FromPete Goodeve
SubjectRe: [Csnd] csoundApi error
AttachmentsNone  

Date2020-02-25 18:01
Fromfauveboy
SubjectRe: [Csnd] csoundApi error
great the casting has got rid of one problem :). 

However this is the current error still with the same code (with the
casting) : http://ix.io/2cEV
Do do these csound functions appear undefined?



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-02-25 18:05
FromRory Walsh
SubjectRe: [Csnd] csoundApi error
Looks like your not linking correctly to the Csound library?

On Tue 25 Feb 2020, 18:01 fauveboy, <joel.ramsbottom@hotmail.co.uk> wrote:
great the casting has got rid of one problem :).

However this is the current error still with the same code (with the
casting) : http://ix.io/2cEV
Do do these csound functions appear undefined?



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-02-25 19:44
FromPete Goodeve
SubjectRe: [Csnd] csoundApi error
AttachmentsNone  

Date2020-02-26 00:54
FromSyl Morrison
SubjectRe: [Csnd] csoundApi error
if you're on OSX using xcode you can also add CsoundLib64.framework in the frameworks menu for your project, I'm actually not 100% clear on if you still need to link if you do this but I do anyway, in linker flags -lcsnd6 should work

On Tue, Feb 25, 2020 at 7:44 PM Pete Goodeve <pete.goodeve@computer.org> wrote:
On Tue, Feb 25, 2020 at 06:05:59PM +0000, Rory Walsh wrote:
> Looks like your not linking correctly to the Csound library?

What he said...  What's your OS & compiler?

On my system, the command would be something like:

  gcc -I<path to Csound includes> -L<path to library folder> -lcsound64 mycode.c

where you replace the things in brackets with the actual locations.
Depending on how you're set up, the path parameters might differ
or not be needed...

        -- Pete --


>
> On Tue 25 Feb 2020, 18:01 fauveboy, <joel.ramsbottom@hotmail.co.uk> wrote:
>
> > great the casting has got rid of one problem :).
> >
> > However this is the current error still with the same code (with the
> > casting) : http://ix.io/2cEV
> > Do do these csound functions appear undefined?
> >

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-02-26 08:00
FromRory Walsh
SubjectRe: [Csnd] csoundApi error
If you're in osx there is an xcode project that you can use that has all the linking already in place. Likewise for visual studio on Windows. 

On Wed 26 Feb 2020, 00:54 Syl Morrison, <honoonu@gmail.com> wrote:
if you're on OSX using xcode you can also add CsoundLib64.framework in the frameworks menu for your project, I'm actually not 100% clear on if you still need to link if you do this but I do anyway, in linker flags -lcsnd6 should work

On Tue, Feb 25, 2020 at 7:44 PM Pete Goodeve <pete.goodeve@computer.org> wrote:
On Tue, Feb 25, 2020 at 06:05:59PM +0000, Rory Walsh wrote:
> Looks like your not linking correctly to the Csound library?

What he said...  What's your OS & compiler?

On my system, the command would be something like:

  gcc -I<path to Csound includes> -L<path to library folder> -lcsound64 mycode.c

where you replace the things in brackets with the actual locations.
Depending on how you're set up, the path parameters might differ
or not be needed...

        -- Pete --


>
> On Tue 25 Feb 2020, 18:01 fauveboy, <joel.ramsbottom@hotmail.co.uk> wrote:
>
> > great the casting has got rid of one problem :).
> >
> > However this is the current error still with the same code (with the
> > casting) : http://ix.io/2cEV
> > Do do these csound functions appear undefined?
> >

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-03-05 13:33
Fromfauveboy
SubjectRe: [Csnd] csoundApi error
my OS is arch linux... oo any thoughts as to where the csound library is
typically placed? I feel like I have an overwhelming amount of directories
it could potencially be in :S



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-03-05 13:38
FromRory Walsh
SubjectRe: [Csnd] csoundApi error
On Linux the Csound headers are normally found at:

"/usr/local/include/csound"
"/usr/include/csound"

And the lib is typically located in 

"/usr/local/lib"



On Thu, 5 Mar 2020 at 13:33, fauveboy <joel.ramsbottom@hotmail.co.uk> wrote:
my OS is arch linux... oo any thoughts as to where the csound library is
typically placed? I feel like I have an overwhelming amount of directories
it could potencially be in :S



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-03-05 14:01
Fromfauveboy
SubjectRe: [Csnd] csoundApi error
okay so the command I need should be something like:

gcc -I -L -lcsound64 mycode.c ?

not sure how I also include usr/include/csound. Would someone be happy to
write out what the command should be specifically given the info with this
thread :)



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-03-05 14:14
FromJohn ff
SubjectRe: [Csnd] csoundApi error
Without the <> characters.

If you cannot find the library then use command locate if you have it installed or if not find



⁣Sent from TypeApp ​

On Mar 5, 2020, 14:01, at 14:01, fauveboy  wrote:
>okay so the command I need should be something like:
>
>gcc -I -L -lcsound64 mycode.c
>?
>
>not sure how I also include usr/include/csound. Would someone be happy
>to
>write out what the command should be specifically given the info with
>this
>thread :)
>
>
>
>--
>Sent from:
>http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>
>Csound mailing list
>Csound@listserv.heanet.ie
>https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>Send bugs reports to
>        https://github.com/csound/csound/issues
>Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-03-05 15:18
FromRory Walsh
SubjectRe: [Csnd] csoundApi error
Try:

g++ mycode.c  -o test -I /usr/local/include/csound -L /usr/local/lib -lcsound64 -lsndfile

But it's like John said, that will only work if that's there everything is on your PC. Note that you might need to include the link to libsndfile too.  




On Thu, 5 Mar 2020 at 14:14, John ff <jpff@codemist.co.uk> wrote:
Without the <> characters.

If you cannot find the library then use command locate if you have it installed or if not find



⁣Sent from TypeApp

On Mar 5, 2020, 14:01, at 14:01, fauveboy <joel.ramsbottom@hotmail.co.uk> wrote:
>okay so the command I need should be something like:
>
>gcc -I<usr/local/include/csound> -L</usr/local/lib> -lcsound64 mycode.c
>?
>
>not sure how I also include usr/include/csound. Would someone be happy
>to
>write out what the command should be specifically given the info with
>this
>thread :)
>
>
>
>--
>Sent from:
>http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>
>Csound mailing list
>Csound@listserv.heanet.ie
>https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>Send bugs reports to
>        https://github.com/csound/csound/issues
>Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-03-06 10:38
Fromfauveboy
SubjectRe: [Csnd] csoundApi error
Okay great I've managed to find the correct paths so the command runs with
out those errors. Is there a way to avoid having to write these paths out
each time. Can they perhaps included in the .c file instead? What would this
look like if thats the case?



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-03-06 10:53
FromRory Walsh
SubjectRe: [Csnd] csoundApi error
You have a few options, varying in complexity:

1. Write a simple bash script and then execute that each time. You can set it to accept a string so you can use it for multiple files. 
2. Write a makefile 
3 Use a build system such as Cmake



On Fri, 6 Mar 2020 at 10:38, fauveboy <joel.ramsbottom@hotmail.co.uk> wrote:
Okay great I've managed to find the correct paths so the command runs with
out those errors. Is there a way to avoid having to write these paths out
each time. Can they perhaps included in the .c file instead? What would this
look like if thats the case?



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here