Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] interfaces lib building in windows with MSVC

Date2005-10-28 15:50
FromVictor Lazzarini
SubjectRe: [Cs-dev] interfaces lib building in windows with MSVC
I hit another problem:
filebuilding.cpp gives out an error message:

C:\Program Files\Microsoft Visual Studio\vc98\include\math.h(514) : error 
C2894: templates cannot be declared to have 'C' linkage

I had this problem before and I seemed to be able to fix it just by moving 
the order
of the headers include directives, but I can't seem to be able to do it now.

My suspicion is that in csound.h, everything is wrapped in extern "C",
including #include sysdep.h, which in turn does #include math.h and
I had a look at the MSVC header and it has a little C++ section
where it declares a template:


#ifdef  __cplusplus
}

#if     !defined(_M_M68K)

template inline
         _Ty _Pow_int(_Ty _X, int _Y)
         {unsigned int _N;
         if (_Y >= 0)
                 _N = _Y;
         else
                 _N = -_Y;
         for (_Ty _Z = _Ty(1); ; _X *= _X)
                 {if ((_N & 1) != 0)
                         _Z *= _X;
                 if ((_N >>= 1) == 0)
                         return (_Y < 0 ? _Ty(1) / _Z : _Z); }}


Now because this is wrapped up in the extern "C" from csound.h,
the compiler doesn't like it.

I moved the sysdep.h declaration (and everything around it) to
outside the extern "C" and now it compiles. Can someone move
it out for me? I can't commit my Windows changes because CVS+ssh
does not work in this machine (long battle with my system administrator...)

But then I'm getting lots of errors now from CppCsound.h. I notice that
it is now using boost. So there needs to be a check for boost to
be added in SConstruct.

Would it be possible to do it without using boost? It's a terribly big
library to build and it would be nice not to have to depend on it. The
code I built a couple of days ago did not use it.

Victor


At 15:13 28/10/2005, you wrote:
>Thanks for the information, I will try to take care of this tonight.
>
>Regards,
>Mike
>
>-----Original Message-----
>From: Victor Lazzarini 
>Sent: Oct 28, 2005 7:01 AM
>To: csound-devel@lists.sourceforge.net
>Subject: [Cs-dev] interfaces lib building in windows with MSVC
>
>I am now just trying to make the interfaces lib build on
>Windows with MSVC. I have swig and it is creating the
>pyhton_interface_wrap.c
>
>My problem is that MSVC does not have a long long type.
>I don't know much about SWIG *.i files. Is it possible for
>someone (Michael?)  to add some lines to the *.i files, so
>that you have something like #ifdef MSVC don't use
>long long
>
>This is the compilation error:
>interfaces\python_interface_wrap.c(1871) : error C2632: 'long' followed by
>'long' is illegal
>
>Thanks
>
>Victor
>
>Victor Lazzarini
>Music Technology Laboratory
>Music Department
>National University of Ireland, Maynooth
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by the JBoss Inc.
>Get Certified Today * Register for a JBoss Training Course
>Free Certification Exam for All Training Attendees Through End of 2005
>Visit http://www.jboss.com/services/certification for more information
>_______________________________________________
>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 JBoss Inc.
>Get Certified Today * Register for a JBoss Training Course
>Free Certification Exam for All Training Attendees Through End of 2005
>Visit http://www.jboss.com/services/certification for more information
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth 



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net