|
From: Christoph H. <sha...@ar...> - 2006-08-08 18:30:58
|
Hi,
thank you the compile log is now only five lines :)
I used your tips with the new and std:: and I also found out that I
didn't need #include<vector> in the main.cpp.
But still the allocation fails. It says something like function call in
constant expression. I tried to read the values in temporary variables,
but it say again that t0,t1 (the temp vars) cannot appear as constant
expression.
Any workarounds for this?
Regards,
Christoph
The problem:
int * Plasma;
Plasma=new(std::nothrow)int[Config.getInt("PlasmaWidth")][Config.getInt("PlasmaHeight")];
The current compile log:
E:\files\programmierung\arbeitsproben\plasmagen\src\main.cpp In
function `int SDL_main(int, char**)':
189 E:\files\programmierung\arbeitsproben\plasmagen\src\main.cpp
`Config' cannot appear in a constant-expression
189 E:\files\programmierung\arbeitsproben\plasmagen\src\main.cpp `.'
cannot appear in a constant-expression
189 E:\files\programmierung\arbeitsproben\plasmagen\src\main.cpp a
function call cannot appear in a constant-expression
E:\files\programmierung\arbeitsproben\plasmagen\src\Makefile.win
[Build Error] [main.o] Error 1
Luke Dunstan wrote:
> ----- Original Message -----
> From: "Christoph Harder" <sha...@ar...>
> To: <min...@li...>
> Sent: Monday, August 07, 2006 10:37 PM
> Subject: [Mingw-users] unknown error
>
>
>
>> Hi,
>> currently I'm programming a small plasma generator, but since I tried to
>> use "int *Plasma; Plasma=new(nothrow)int[PlasmaWidth][PlasmaHeight];"
>> nothing works anymore :(
>> Even if I delete it the errors occur.
>> I have tried everything I know, but nothing changes. I don't even know
>> what this compile log means
>> (http://home.arcor.de/familie.harder/cpp/doc/compile.log.txt).
>>
>> Maybe someone can look at the
>> sources(http://home.arcor.de/familie.harder/cpp/doc/project.htm) and
>> tell me whats wrong?
>>
>> Thanks in advance,
>> Christoph
>>
>
> Try std::nothrow, and #include <new>
>
> Luke
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> MinGW-users mailing list
> Min...@li...
>
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users
>
>
|