Csound Csound-dev Csound-tekno Search About

[Csnd-dev] Building example CPOF plugin opcodes

Date2024-06-23 11:25
FromPierre Clisson
Subject[Csnd-dev] Building example CPOF plugin opcodes
Attachmentssmime.p7s  
Hi!

I'm trying to build the example CPOF plugin opcodes (develop branch) on 
MacOS using:

gcc -O2 -dynamiclib -o opcodes.dylib opcodes.cpp 
-I/Users/mesca/Library/Frameworks/CsoundLib64.framework/Headers 
-std=c++11 -DUSE_DOUBLE

Unfortunately, I have a bunch of unresolved symbols, including:

opcodes.cpp:73:13: error: no member named 'plugin_deinit' in 'csnd::Csound'
     csound->plugin_deinit(this);
     ~~~~~~  ^
opcodes.cpp:138:36: error: no member named 'sr' in 'csnd::Csound'
     delay.allocate(csound, csound->sr() * inargs[1]);

Also, using csound->init_error()/message()/... result in:

ld: symbol(s) not found for architecture arm64

What am I missing?



Date2024-06-23 11:35
Fromvlz
SubjectRe: [Csnd-dev] Building example CPOF plugin opcodes
yes, that example is for Csound 6. In Csound 7, that function disappears and instead if you want to use a deinit(), then it’s
just a matter of implementing it (like init() in the class). I have yet to adjust these examples.

> On 23 Jun 2024, at 11:25, Pierre Clisson  wrote:
> 
> Hi!
> 
> I'm trying to build the example CPOF plugin opcodes (develop branch) on MacOS using:
> 
> gcc -O2 -dynamiclib -o opcodes.dylib opcodes.cpp -I/Users/mesca/Library/Frameworks/CsoundLib64.framework/Headers -std=c++11 -DUSE_DOUBLE
> 
> Unfortunately, I have a bunch of unresolved symbols, including:
> 
> opcodes.cpp:73:13: error: no member named 'plugin_deinit' in 'csnd::Csound'
>     csound->plugin_deinit(this);
>     ~~~~~~  ^
> opcodes.cpp:138:36: error: no member named 'sr' in 'csnd::Csound'
>     delay.allocate(csound, csound->sr() * inargs[1]);
> 
> Also, using csound->init_error()/message()/... result in:
> 
> ld: symbol(s) not found for architecture arm64
> 
> What am I missing?
> 
> 

Date2024-06-23 12:16
FromPierre Clisson
SubjectRe: [Csnd-dev] Building example CPOF plugin opcodes
Attachmentssmime.p7s  
Thanks.

I also see that sr() and kr() must now be called directly.

What is the recommended way to log messages? I have the following error 
while using csound->init_error()/perf_error()/warning()/message():

symbol(s) not found for architecture arm64


vlz wrote on 23/06/2024 16:05:
> yes, that example is for Csound 6. In Csound 7, that function disappears and instead if you want to use a deinit(), then it’s
> just a matter of implementing it (like init() in the class). I have yet to adjust these examples.
>
>> On 23 Jun 2024, at 11:25, Pierre Clisson  wrote:
>>
>> Hi!
>>
>> I'm trying to build the example CPOF plugin opcodes (develop branch) on MacOS using:
>>
>> gcc -O2 -dynamiclib -o opcodes.dylib opcodes.cpp -I/Users/mesca/Library/Frameworks/CsoundLib64.framework/Headers -std=c++11 -DUSE_DOUBLE
>>
>> Unfortunately, I have a bunch of unresolved symbols, including:
>>
>> opcodes.cpp:73:13: error: no member named 'plugin_deinit' in 'csnd::Csound'
>>      csound->plugin_deinit(this);
>>      ~~~~~~  ^
>> opcodes.cpp:138:36: error: no member named 'sr' in 'csnd::Csound'
>>      delay.allocate(csound, csound->sr() * inargs[1]);
>>
>> Also, using csound->init_error()/message()/... result in:
>>
>> ld: symbol(s) not found for architecture arm64
>>
>> What am I missing?
>>
>>



Date2024-06-23 13:38
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] Building example CPOF plugin opcodes
yes, sr and kr are instrument-based, not csound-based.

The issue with message() etc is to do with LocalizeString() which was moved out of the Csound struct. I need to fix it, thanks for reporting. I'll put a PR to fix it.

best 
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 23 Jun 2024, at 12:16, Pierre Clisson  wrote:
> 
> Thanks.
> 
> I also see that sr() and kr() must now be called directly.
> 
> What is the recommended way to log messages? I have the following error while using csound->init_error()/perf_error()/warning()/message():
> 
> symbol(s) not found for architecture arm64
> 
> 
> vlz wrote on 23/06/2024 16:05:
>> yes, that example is for Csound 6. In Csound 7, that function disappears and instead if you want to use a deinit(), then it’s
>> just a matter of implementing it (like init() in the class). I have yet to adjust these examples.
>> 
>>>> On 23 Jun 2024, at 11:25, Pierre Clisson  wrote:
>>> 
>>> Hi!
>>> 
>>> I'm trying to build the example CPOF plugin opcodes (develop branch) on MacOS using:
>>> 
>>> gcc -O2 -dynamiclib -o opcodes.dylib opcodes.cpp -I/Users/mesca/Library/Frameworks/CsoundLib64.framework/Headers -std=c++11 -DUSE_DOUBLE
>>> 
>>> Unfortunately, I have a bunch of unresolved symbols, including:
>>> 
>>> opcodes.cpp:73:13: error: no member named 'plugin_deinit' in 'csnd::Csound'
>>>     csound->plugin_deinit(this);
>>>     ~~~~~~  ^
>>> opcodes.cpp:138:36: error: no member named 'sr' in 'csnd::Csound'
>>>     delay.allocate(csound, csound->sr() * inargs[1]);
>>> 
>>> Also, using csound->init_error()/message()/... result in:
>>> 
>>> ld: symbol(s) not found for architecture arm64
>>> 
>>> What am I missing?
>>> 
>>> 
> 
> 

Date2024-06-23 14:01
FromPierre Clisson
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] Building example CPOF plugin opcodes
Attachmentssmime.p7s  
Thanks!

Victor Lazzarini wrote on 23/06/2024 18:08:
> yes, sr and kr are instrument-based, not csound-based.
>
> The issue with message() etc is to do with LocalizeString() which was moved out of the Csound struct. I need to fix it, thanks for reporting. I'll put a PR to fix it.
>
> best
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 23 Jun 2024, at 12:16, Pierre Clisson  wrote:
>>
>> Thanks.
>>
>> I also see that sr() and kr() must now be called directly.
>>
>> What is the recommended way to log messages? I have the following error while using csound->init_error()/perf_error()/warning()/message():
>>
>> symbol(s) not found for architecture arm64
>>
>>
>> vlz wrote on 23/06/2024 16:05:
>>> yes, that example is for Csound 6. In Csound 7, that function disappears and instead if you want to use a deinit(), then it’s
>>> just a matter of implementing it (like init() in the class). I have yet to adjust these examples.
>>>
>>>>> On 23 Jun 2024, at 11:25, Pierre Clisson  wrote:
>>>> Hi!
>>>>
>>>> I'm trying to build the example CPOF plugin opcodes (develop branch) on MacOS using:
>>>>
>>>> gcc -O2 -dynamiclib -o opcodes.dylib opcodes.cpp -I/Users/mesca/Library/Frameworks/CsoundLib64.framework/Headers -std=c++11 -DUSE_DOUBLE
>>>>
>>>> Unfortunately, I have a bunch of unresolved symbols, including:
>>>>
>>>> opcodes.cpp:73:13: error: no member named 'plugin_deinit' in 'csnd::Csound'
>>>>      csound->plugin_deinit(this);
>>>>      ~~~~~~  ^
>>>> opcodes.cpp:138:36: error: no member named 'sr' in 'csnd::Csound'
>>>>      delay.allocate(csound, csound->sr() * inargs[1]);
>>>>
>>>> Also, using csound->init_error()/message()/... result in:
>>>>
>>>> ld: symbol(s) not found for architecture arm64
>>>>
>>>> What am I missing?
>>>>
>>>>
>>



Date2024-06-23 17:29
Fromvlz
SubjectRe: [Csnd-dev] Building example CPOF plugin opcodes
Actually, I am looking at this now and I can’t see there is any problem with these functions, no
build errors. LocalizeString() is ok, so I don’t know why you are getting linking errors.

> On 23 Jun 2024, at 12:16, Pierre Clisson  wrote:
> 
> Thanks.
> 
> I also see that sr() and kr() must now be called directly.
> 
> What is the recommended way to log messages? I have the following error while using csound->init_error()/perf_error()/warning()/message():
> 
> symbol(s) not found for architecture arm64
> 
> 
> vlz wrote on 23/06/2024 16:05:
>> yes, that example is for Csound 6. In Csound 7, that function disappears and instead if you want to use a deinit(), then it’s
>> just a matter of implementing it (like init() in the class). I have yet to adjust these examples.
>> 
>>> On 23 Jun 2024, at 11:25, Pierre Clisson  wrote:
>>> 
>>> Hi!
>>> 
>>> I'm trying to build the example CPOF plugin opcodes (develop branch) on MacOS using:
>>> 
>>> gcc -O2 -dynamiclib -o opcodes.dylib opcodes.cpp -I/Users/mesca/Library/Frameworks/CsoundLib64.framework/Headers -std=c++11 -DUSE_DOUBLE
>>> 
>>> Unfortunately, I have a bunch of unresolved symbols, including:
>>> 
>>> opcodes.cpp:73:13: error: no member named 'plugin_deinit' in 'csnd::Csound'
>>>     csound->plugin_deinit(this);
>>>     ~~~~~~  ^
>>> opcodes.cpp:138:36: error: no member named 'sr' in 'csnd::Csound'
>>>     delay.allocate(csound, csound->sr() * inargs[1]);
>>> 
>>> Also, using csound->init_error()/message()/... result in:
>>> 
>>> ld: symbol(s) not found for architecture arm64
>>> 
>>> What am I missing?
>>> 
>>> 
> 
> 

Date2024-06-23 20:04
FromPierre Clisson
SubjectRe: [Csnd-dev] Building example CPOF plugin opcodes
Attachmentssmime.p7s  
I'm using an Apple M2 chip, if that can help.
I have the same issue on both branches master and develop.
The code compiles when I comment `return csound->init_error("...");`

vlz wrote on 23/06/2024 21:59:
> Actually, I am looking at this now and I can’t see there is any problem with these functions, no
> build errors. LocalizeString() is ok, so I don’t know why you are getting linking errors.
>
>> On 23 Jun 2024, at 12:16, Pierre Clisson  wrote:
>>
>> Thanks.
>>
>> I also see that sr() and kr() must now be called directly.
>>
>> What is the recommended way to log messages? I have the following error while using csound->init_error()/perf_error()/warning()/message():
>>
>> symbol(s) not found for architecture arm64
>>
>>
>> vlz wrote on 23/06/2024 16:05:
>>> yes, that example is for Csound 6. In Csound 7, that function disappears and instead if you want to use a deinit(), then it’s
>>> just a matter of implementing it (like init() in the class). I have yet to adjust these examples.
>>>
>>>> On 23 Jun 2024, at 11:25, Pierre Clisson  wrote:
>>>>
>>>> Hi!
>>>>
>>>> I'm trying to build the example CPOF plugin opcodes (develop branch) on MacOS using:
>>>>
>>>> gcc -O2 -dynamiclib -o opcodes.dylib opcodes.cpp -I/Users/mesca/Library/Frameworks/CsoundLib64.framework/Headers -std=c++11 -DUSE_DOUBLE
>>>>
>>>> Unfortunately, I have a bunch of unresolved symbols, including:
>>>>
>>>> opcodes.cpp:73:13: error: no member named 'plugin_deinit' in 'csnd::Csound'
>>>>      csound->plugin_deinit(this);
>>>>      ~~~~~~  ^
>>>> opcodes.cpp:138:36: error: no member named 'sr' in 'csnd::Csound'
>>>>      delay.allocate(csound, csound->sr() * inargs[1]);
>>>>
>>>> Also, using csound->init_error()/message()/... result in:
>>>>
>>>> ld: symbol(s) not found for architecture arm64
>>>>
>>>> What am I missing?
>>>>
>>>>
>>



Date2024-06-23 20:29
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] Building example CPOF plugin opcodes
I have an M1 and the code compiles and runs.

 In fact, you probably would have trouble building Csound because the same code is used in several opcodes in the system.

I am wondering what the problem might be, check that the command line is right.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 23 Jun 2024, at 20:05, Pierre Clisson  wrote:
> 
> I'm using an Apple M2 chip, if that can help.
> I have the same issue on both branches master and develop.
> The code compiles when I comment `return csound->init_error("...");`
> 
> vlz wrote on 23/06/2024 21:59:
>> Actually, I am looking at this now and I can’t see there is any problem with these functions, no
>> build errors. LocalizeString() is ok, so I don’t know why you are getting linking errors.
>> 
>>>> On 23 Jun 2024, at 12:16, Pierre Clisson  wrote:
>>> 
>>> Thanks.
>>> 
>>> I also see that sr() and kr() must now be called directly.
>>> 
>>> What is the recommended way to log messages? I have the following error while using csound->init_error()/perf_error()/warning()/message():
>>> 
>>> symbol(s) not found for architecture arm64
>>> 
>>> 
>>> vlz wrote on 23/06/2024 16:05:
>>>> yes, that example is for Csound 6. In Csound 7, that function disappears and instead if you want to use a deinit(), then it’s
>>>> just a matter of implementing it (like init() in the class). I have yet to adjust these examples.
>>>> 
>>>>> On 23 Jun 2024, at 11:25, Pierre Clisson  wrote:
>>>>> 
>>>>> Hi!
>>>>> 
>>>>> I'm trying to build the example CPOF plugin opcodes (develop branch) on MacOS using:
>>>>> 
>>>>> gcc -O2 -dynamiclib -o opcodes.dylib opcodes.cpp -I/Users/mesca/Library/Frameworks/CsoundLib64.framework/Headers -std=c++11 -DUSE_DOUBLE
>>>>> 
>>>>> Unfortunately, I have a bunch of unresolved symbols, including:
>>>>> 
>>>>> opcodes.cpp:73:13: error: no member named 'plugin_deinit' in 'csnd::Csound'
>>>>>     csound->plugin_deinit(this);
>>>>>     ~~~~~~  ^
>>>>> opcodes.cpp:138:36: error: no member named 'sr' in 'csnd::Csound'
>>>>>     delay.allocate(csound, csound->sr() * inargs[1]);
>>>>> 
>>>>> Also, using csound->init_error()/message()/... result in:
>>>>> 
>>>>> ld: symbol(s) not found for architecture arm64
>>>>> 
>>>>> What am I missing?
>>>>> 
>>>>> 
>>> 
> 
> 

Date2024-06-24 10:30
FromPierre Clisson
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] Building example CPOF plugin opcodes
Attachmentssmime.p7s  
Got it working. I was uing gcc instead of g++...
Thanks again!

Victor Lazzarini wrote on 24/06/2024 00:59:
> I have an M1 and the code compiles and runs.
>
>   In fact, you probably would have trouble building Csound because the same code is used in several opcodes in the system.
>
> I am wondering what the problem might be, check that the command line is right.
>
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 23 Jun 2024, at 20:05, Pierre Clisson  wrote:
>>
>> I'm using an Apple M2 chip, if that can help.
>> I have the same issue on both branches master and develop.
>> The code compiles when I comment `return csound->init_error("...");`
>>
>> vlz wrote on 23/06/2024 21:59:
>>> Actually, I am looking at this now and I can’t see there is any problem with these functions, no
>>> build errors. LocalizeString() is ok, so I don’t know why you are getting linking errors.
>>>
>>>>> On 23 Jun 2024, at 12:16, Pierre Clisson  wrote:
>>>> Thanks.
>>>>
>>>> I also see that sr() and kr() must now be called directly.
>>>>
>>>> What is the recommended way to log messages? I have the following error while using csound->init_error()/perf_error()/warning()/message():
>>>>
>>>> symbol(s) not found for architecture arm64
>>>>
>>>>
>>>> vlz wrote on 23/06/2024 16:05:
>>>>> yes, that example is for Csound 6. In Csound 7, that function disappears and instead if you want to use a deinit(), then it’s
>>>>> just a matter of implementing it (like init() in the class). I have yet to adjust these examples.
>>>>>
>>>>>> On 23 Jun 2024, at 11:25, Pierre Clisson  wrote:
>>>>>>
>>>>>> Hi!
>>>>>>
>>>>>> I'm trying to build the example CPOF plugin opcodes (develop branch) on MacOS using:
>>>>>>
>>>>>> gcc -O2 -dynamiclib -o opcodes.dylib opcodes.cpp -I/Users/mesca/Library/Frameworks/CsoundLib64.framework/Headers -std=c++11 -DUSE_DOUBLE
>>>>>>
>>>>>> Unfortunately, I have a bunch of unresolved symbols, including:
>>>>>>
>>>>>> opcodes.cpp:73:13: error: no member named 'plugin_deinit' in 'csnd::Csound'
>>>>>>      csound->plugin_deinit(this);
>>>>>>      ~~~~~~  ^
>>>>>> opcodes.cpp:138:36: error: no member named 'sr' in 'csnd::Csound'
>>>>>>      delay.allocate(csound, csound->sr() * inargs[1]);
>>>>>>
>>>>>> Also, using csound->init_error()/message()/... result in:
>>>>>>
>>>>>> ld: symbol(s) not found for architecture arm64
>>>>>>
>>>>>> What am I missing?
>>>>>>
>>>>>>
>>



Date2024-06-24 11:11
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] Building example CPOF plugin opcodes
Ah, that's it. I saw that in your other email and wondered. It doesn't have the C++ libs by
default.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 24 Jun 2024, at 10:31, Pierre Clisson  wrote:
> 
> Got it working. I was uing gcc instead of g++...
> Thanks again!
> 
> Victor Lazzarini wrote on 24/06/2024 00:59:
>> I have an M1 and the code compiles and runs.
>> 
>>  In fact, you probably would have trouble building Csound because the same code is used in several opcodes in the system.
>> 
>> I am wondering what the problem might be, check that the command line is right.
>> 
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>> 
>>>> On 23 Jun 2024, at 20:05, Pierre Clisson  wrote:
>>> 
>>> I'm using an Apple M2 chip, if that can help.
>>> I have the same issue on both branches master and develop.
>>> The code compiles when I comment `return csound->init_error("...");`
>>> 
>>> vlz wrote on 23/06/2024 21:59:
>>>> Actually, I am looking at this now and I can’t see there is any problem with these functions, no
>>>> build errors. LocalizeString() is ok, so I don’t know why you are getting linking errors.
>>>> 
>>>>>> On 23 Jun 2024, at 12:16, Pierre Clisson  wrote:
>>>>> Thanks.
>>>>> 
>>>>> I also see that sr() and kr() must now be called directly.
>>>>> 
>>>>> What is the recommended way to log messages? I have the following error while using csound->init_error()/perf_error()/warning()/message():
>>>>> 
>>>>> symbol(s) not found for architecture arm64
>>>>> 
>>>>> 
>>>>> vlz wrote on 23/06/2024 16:05:
>>>>>> yes, that example is for Csound 6. In Csound 7, that function disappears and instead if you want to use a deinit(), then it’s
>>>>>> just a matter of implementing it (like init() in the class). I have yet to adjust these examples.
>>>>>> 
>>>>>>> On 23 Jun 2024, at 11:25, Pierre Clisson  wrote:
>>>>>>> 
>>>>>>> Hi!
>>>>>>> 
>>>>>>> I'm trying to build the example CPOF plugin opcodes (develop branch) on MacOS using:
>>>>>>> 
>>>>>>> gcc -O2 -dynamiclib -o opcodes.dylib opcodes.cpp -I/Users/mesca/Library/Frameworks/CsoundLib64.framework/Headers -std=c++11 -DUSE_DOUBLE
>>>>>>> 
>>>>>>> Unfortunately, I have a bunch of unresolved symbols, including:
>>>>>>> 
>>>>>>> opcodes.cpp:73:13: error: no member named 'plugin_deinit' in 'csnd::Csound'
>>>>>>>     csound->plugin_deinit(this);
>>>>>>>     ~~~~~~  ^
>>>>>>> opcodes.cpp:138:36: error: no member named 'sr' in 'csnd::Csound'
>>>>>>>     delay.allocate(csound, csound->sr() * inargs[1]);
>>>>>>> 
>>>>>>> Also, using csound->init_error()/message()/... result in:
>>>>>>> 
>>>>>>> ld: symbol(s) not found for architecture arm64
>>>>>>> 
>>>>>>> What am I missing?
>>>>>>> 
>>>>>>> 
>>> 
> 
>