Csound Csound-dev Csound-tekno Search About

[Csnd] error building simple project

Date2012-11-15 18:09
Fromjakopinorama
Subject[Csnd] error building simple project
Dear all,

I wanted to build a simple test project in Microsoft Visual Studio 2010, and
I keep getting the same error. 

I downloaded the new version of CSound package from Source Forge
(Csound5.18-gnu-win32-d.exe) and wanted to build this piece of code:

 


and I keep getting this error:

1>c:\csound\include\sysdep.h(282): error C2371: 'intptr_t' : redefinition;
different basic types
1>          c:\program files (x86)\microsoft visual studio
10.0\vc\include\crtdefs.h(418) : see declaration of 'intptr_t'
1>c:\csound\include\sysdep.h(283): error C2371: 'uintptr_t' : redefinition;
different basic types
1>          c:\program files (x86)\microsoft visual studio
10.0\vc\include\vadefs.h(48) : see declaration of 'uintptr_t'

Thank you so much for your help,
Blaz



--
View this message in context: http://csound.1045644.n5.nabble.com/error-building-simple-project-tp5717991.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2012-11-15 18:27
FromRory Walsh
SubjectRe: [Csnd] error building simple project
A few questions, did you create an MSVC import lib from the Csound dll
and do you have MSVC set in your project Preprocessor directives?

On 15 November 2012 18:09, jakopinorama  wrote:
> Dear all,
>
> I wanted to build a simple test project in Microsoft Visual Studio 2010, and
> I keep getting the same error.
>
> I downloaded the new version of CSound package from Source Forge
> (Csound5.18-gnu-win32-d.exe) and wanted to build this piece of code:
>
> 
>
>
> and I keep getting this error:
>
> 1>c:\csound\include\sysdep.h(282): error C2371: 'intptr_t' : redefinition;
> different basic types
> 1>          c:\program files (x86)\microsoft visual studio
> 10.0\vc\include\crtdefs.h(418) : see declaration of 'intptr_t'
> 1>c:\csound\include\sysdep.h(283): error C2371: 'uintptr_t' : redefinition;
> different basic types
> 1>          c:\program files (x86)\microsoft visual studio
> 10.0\vc\include\vadefs.h(48) : see declaration of 'uintptr_t'
>
> Thank you so much for your help,
> Blaz
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/error-building-simple-project-tp5717991.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>

Date2012-11-15 18:29
FromRory Walsh
SubjectRe: [Csnd] error building simple project
AttachmentsCsoundAPITest.zip  
Here's a basic project that builds fine for me (MS Express 2010).
Check out my project options, and change the relevant paths.

Date2012-11-15 18:31
FromMichael Gogins
SubjectRe: [Csnd] error building simple project
I don't know if this is an issue for you, but with MSVC, Csound's C
API will work, but Csound's C++ API will not work because the MSVC ABI
differs from the GCC ABI for C++.

Regards,
Mike

On Thu, Nov 15, 2012 at 1:27 PM, Rory Walsh  wrote:
> A few questions, did you create an MSVC import lib from the Csound dll
> and do you have MSVC set in your project Preprocessor directives?
>
> On 15 November 2012 18:09, jakopinorama  wrote:
>> Dear all,
>>
>> I wanted to build a simple test project in Microsoft Visual Studio 2010, and
>> I keep getting the same error.
>>
>> I downloaded the new version of CSound package from Source Forge
>> (Csound5.18-gnu-win32-d.exe) and wanted to build this piece of code:
>>
>> 
>>
>>
>> and I keep getting this error:
>>
>> 1>c:\csound\include\sysdep.h(282): error C2371: 'intptr_t' : redefinition;
>> different basic types
>> 1>          c:\program files (x86)\microsoft visual studio
>> 10.0\vc\include\crtdefs.h(418) : see declaration of 'intptr_t'
>> 1>c:\csound\include\sysdep.h(283): error C2371: 'uintptr_t' : redefinition;
>> different basic types
>> 1>          c:\program files (x86)\microsoft visual studio
>> 10.0\vc\include\vadefs.h(48) : see declaration of 'uintptr_t'
>>
>> Thank you so much for your help,
>> Blaz
>>
>>
>>
>> --
>> View this message in context: http://csound.1045644.n5.nabble.com/error-building-simple-project-tp5717991.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>
>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

Date2012-11-15 18:33
FromRory Walsh
SubjectRe: [Csnd] error building simple project
No issue for me, I use the C API with your C++ wrapper. All very neat and tidy.

On 15 November 2012 18:31, Michael Gogins  wrote:
> I don't know if this is an issue for you, but with MSVC, Csound's C
> API will work, but Csound's C++ API will not work because the MSVC ABI
> differs from the GCC ABI for C++.
>
> Regards,
> Mike
>
> On Thu, Nov 15, 2012 at 1:27 PM, Rory Walsh  wrote:
>> A few questions, did you create an MSVC import lib from the Csound dll
>> and do you have MSVC set in your project Preprocessor directives?
>>
>> On 15 November 2012 18:09, jakopinorama  wrote:
>>> Dear all,
>>>
>>> I wanted to build a simple test project in Microsoft Visual Studio 2010, and
>>> I keep getting the same error.
>>>
>>> I downloaded the new version of CSound package from Source Forge
>>> (Csound5.18-gnu-win32-d.exe) and wanted to build this piece of code:
>>>
>>> 
>>>
>>>
>>> and I keep getting this error:
>>>
>>> 1>c:\csound\include\sysdep.h(282): error C2371: 'intptr_t' : redefinition;
>>> different basic types
>>> 1>          c:\program files (x86)\microsoft visual studio
>>> 10.0\vc\include\crtdefs.h(418) : see declaration of 'intptr_t'
>>> 1>c:\csound\include\sysdep.h(283): error C2371: 'uintptr_t' : redefinition;
>>> different basic types
>>> 1>          c:\program files (x86)\microsoft visual studio
>>> 10.0\vc\include\vadefs.h(48) : see declaration of 'uintptr_t'
>>>
>>> Thank you so much for your help,
>>> Blaz
>>>
>>>
>>>
>>> --
>>> View this message in context: http://csound.1045644.n5.nabble.com/error-building-simple-project-tp5717991.html
>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>>
>>>
>>> Send bugs reports to the Sourceforge bug tracker
>>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>>
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>
>
>
>
> --
> Michael Gogins
> Irreducible Productions
> http://www.michael-gogins.com
> Michael dot Gogins at gmail dot com
>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>

Date2012-11-15 19:50
Fromfrancesco
Subject[Csnd] Re: error building simple project
Apologies for my ignorance, but what that means?

> I use the C API with your C++ wrapper.

Thanks,
ciao,
francesco.




--
View this message in context: http://csound.1045644.n5.nabble.com/error-building-simple-project-tp5717991p5717996.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2012-11-15 20:02
FromRory Walsh
SubjectRe: [Csnd] Re: error building simple project
Csound.hpp declares a Csound class which wraps all the Csound API
calls. For example the Csound::SetChannel method looks like this:

void Csound::SetChannel(const char *name, double value)
  {
    MYFLT *p;
    if (!(csoundGetChannelPtr(csound, &p, name,
                              CSOUND_CONTROL_CHANNEL | CSOUND_INPUT_CHANNEL)))
      *p = (MYFLT) value;
  }

As you can see it simply calls the underlying Csound API function
csoundGetChannelPtr().


On 15 November 2012 19:50, francesco  wrote:
> Apologies for my ignorance, but what that means?
>
>> I use the C API with your C++ wrapper.
>
> Thanks,
> ciao,
> francesco.
>
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/error-building-simple-project-tp5717991p5717996.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>

Date2012-11-15 20:56
FromAdam Puckett
SubjectRe: [Csnd] Re: error building simple project
I'm curious to know how the ABIs are different.

On 11/15/12, Rory Walsh  wrote:
> Csound.hpp declares a Csound class which wraps all the Csound API
> calls. For example the Csound::SetChannel method looks like this:
>
> void Csound::SetChannel(const char *name, double value)
>   {
>     MYFLT *p;
>     if (!(csoundGetChannelPtr(csound, &p, name,
>                               CSOUND_CONTROL_CHANNEL |
> CSOUND_INPUT_CHANNEL)))
>       *p = (MYFLT) value;
>   }
>
> As you can see it simply calls the underlying Csound API function
> csoundGetChannelPtr().
>
>
> On 15 November 2012 19:50, francesco  wrote:
>> Apologies for my ignorance, but what that means?
>>
>>> I use the C API with your C++ wrapper.
>>
>> Thanks,
>> ciao,
>> francesco.
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://csound.1045644.n5.nabble.com/error-building-simple-project-tp5717991p5717996.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>

Date2012-11-15 21:02
FromJustin Smith
SubjectRe: [Csnd] Re: error building simple project
C++ ABIs are vendor specific. In general, no compiler of C++ can be expected to use compiled code from another C++ compiler. On the other hand, C has standard library formats such that compiling a lib with one compiler and the app using it with another is unremarkable.

IIRC, the root issue is that to put some real teeth in the convention of information hiding (ie. how private class slots and private methods are stored), there is intentionally no standard for implementing such hidden or private properties portably.


On Thu, Nov 15, 2012 at 12:56 PM, Adam Puckett <adotsdothmusic@gmail.com> wrote:
I'm curious to know how the ABIs are different.

On 11/15/12, Rory Walsh <rorywalsh@ear.ie> wrote:
> Csound.hpp declares a Csound class which wraps all the Csound API
> calls. For example the Csound::SetChannel method looks like this:
>
> void Csound::SetChannel(const char *name, double value)
>   {
>     MYFLT *p;
>     if (!(csoundGetChannelPtr(csound, &p, name,
>                               CSOUND_CONTROL_CHANNEL |
> CSOUND_INPUT_CHANNEL)))
>       *p = (MYFLT) value;
>   }
>
> As you can see it simply calls the underlying Csound API function
> csoundGetChannelPtr().
>
>
> On 15 November 2012 19:50, francesco <ilterzouomo@fastwebnet.it> wrote:
>> Apologies for my ignorance, but what that means?
>>
>>> I use the C API with your C++ wrapper.
>>
>> Thanks,
>> ciao,
>> francesco.
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://csound.1045644.n5.nabble.com/error-building-simple-project-tp5717991p5717996.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2012-11-15 21:39
FromBlaz Jakopin
SubjectRe: [Csnd] error building simple project
Rory, thank you for your reply.

I've checked out your project and set the MSVC in the Preprocessor directives.

Now I get a linker error, so i figure it has to do with the other Csound lib that you mentioned. What did you mean by "MSVC import lib from the Csound dll"?

The error I get is:

1>CSound_test.obj : error LNK2019: unresolved external symbol _csoundDestroy referenced in function _wmain
1>CSound_test.obj : error LNK2019: unresolved external symbol _csoundCleanup referenced in function _wmain
1>CSound_test.obj : error LNK2019: unresolved external symbol _csoundPerformKsmps referenced in function _wmain
1>CSound_test.obj : error LNK2019: unresolved external symbol _csoundCompile referenced in function _wmain
1>CSound_test.obj : error LNK2019: unresolved external symbol _csoundCreate referenced in function _wmain
1>C:\Users\Blaz\Documents\Visual Studio 2010\Projects\CSound_test\Debug\CSound_test.exe : fatal error LNK1120: 5 unresolved externals

Thanks again,
Blaz

On Thu, Nov 15, 2012 at 7:29 PM, Rory Walsh <rorywalsh@ear.ie> wrote:
Here's a basic project that builds fine for me (MS Express 2010).
Check out my project options, and change the relevant paths.

Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2012-11-15 22:19
FromRory Walsh
SubjectRe: [Csnd] error building simple project
The Csound lib that comes with Csound is built using MinGW. In order
for you to use it you need to create an MS import lib...I'll throw
down some instructions for you. Just give me a little time...

On 15 November 2012 21:39, Blaz Jakopin  wrote:
> Rory, thank you for your reply.
>
> I've checked out your project and set the MSVC in the Preprocessor
> directives.
>
> Now I get a linker error, so i figure it has to do with the other Csound lib
> that you mentioned. What did you mean by "MSVC import lib from the Csound
> dll"?
>
> The error I get is:
>
> 1>CSound_test.obj : error LNK2019: unresolved external symbol _csoundDestroy
> referenced in function _wmain
> 1>CSound_test.obj : error LNK2019: unresolved external symbol _csoundCleanup
> referenced in function _wmain
> 1>CSound_test.obj : error LNK2019: unresolved external symbol
> _csoundPerformKsmps referenced in function _wmain
> 1>CSound_test.obj : error LNK2019: unresolved external symbol _csoundCompile
> referenced in function _wmain
> 1>CSound_test.obj : error LNK2019: unresolved external symbol _csoundCreate
> referenced in function _wmain
> 1>C:\Users\Blaz\Documents\Visual Studio
> 2010\Projects\CSound_test\Debug\CSound_test.exe : fatal error LNK1120: 5
> unresolved externals
>
> Thanks again,
> Blaz
>
> On Thu, Nov 15, 2012 at 7:29 PM, Rory Walsh  wrote:
>>
>> Here's a basic project that builds fine for me (MS Express 2010).
>> Check out my project options, and change the relevant paths.
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>

Date2012-11-15 22:23
FromRory Walsh
SubjectRe: [Csnd] error building simple project
Voila.

1) create a .DEF file (using pexports, you might need to download a
version for windows) from the Csound dll:

pexports csound64.dll.5.2 > csound64.def

2) then create a lib file (using the MSVC lib tool),
you will need to launch the MSVC Command line prompt in
order to avail of 'lib':

lib /machine:i386  /def:csound32.def

(you may not need to do the following step.....)
3) Comment out typedefs between "#ifdef MSVC" and "#else" in Csound's
sysdep.h file

4) Open the MSVC solution and edit the project settings so that
the location of the Csound include files is known.

5) Edit the linker command line option and replace
"C:\Users\Rory\Documents\SourceCode\Csound\Csound5.17.11\csound64.lib"
with the correct location of your csound64.lib

Then you should be good to go.