daeArray compilation bug vc9

Hello,

line 172 : new (&newData[i]) T(get(i));

1>d:\coding\libs\colladadom\include\dae\daearray.h(172) : error C2059: syntax error : ‘&’
1> d:\coding\libs\colladadom\include\dae\daearray.h(162) : while compiling class template member function ‘void daeTArray<T>::grow(size_t)’
1> with
1> [
1> T=daeBool
1> ]
1> d:\coding\libs\colladadom\include\dae\daeelement.h(60) : see reference to class template instantiation ‘daeTArray<T>’ being compiled
1> with
1> [
1> T=daeBool
1> ]
1>d:\coding\libs\colladadom\include\dae\daearray.h(172) : error C2143: syntax error : missing ‘;’ before ‘)’
1>d:\coding\libs\colladadom\include\dae\daearray.h(172) : error C2143: syntax error : missing ‘;’ before ‘)’

I have this error when I simply include dae.h into my projet.

Which version of the DOM are you using? I built DOM 2.0 for VS 2008 and didn’t get any compilation errors. I also added some 2008 projects files to the trunk yesterday and built again using VS 2008, no errors. I’m a bit stumped as to how you’re getting this error.

If you want to post your code somewhere, including the .vcproj you’re using to build your app, or email it to me at x@y (x = steven_thomas, y = playstation.sony.com), I’d be happy to take a further look.

Steve

I’m using the current vc9 download from sourceforge (already compiled version).

My source code is just #include “dae.h”. For the project options, I have nothing special, I’ll check somes options.

EDIT: I’ve tryed in release and all works. It’s only in debug mode…

Frederic

Did you set up your project according to the setting up guide on the wiki?

UP :slight_smile: srry I’ve edited my previous post there is 2 seconds.

It really doesn’t make sense that you would get this compilation error in debug but not in release. I feel like there must be something wrong with your debug project settings or something.

Ok, I’ve found the options :

/MDd + _DEBUG. If I use /MD and NDEBUG it works. But this is not logic…
I need to have /MDd into my project…

Ok. I’ve found. It is because I have a memory manager that redefine a new operator with a prepocessor directive.

All is good now :slight_smile: