Sign in to follow this  
Ra

MSVC++2K5EB bug?

Recommended Posts

Ra    1062
Alright, I've been trying to figure out why this code doesn't compile with MS Visual C++ 2005 Express Beta. According to #gamedev it should work fine. Any ideas? I can work around it, but it'd be nice if this actually worked. Note: I'm using C, not C++.
/* ERROR: "initializer is not a constant" on line "{ foo[0] }" */

#include <stdio.h>

char const * const foo[1] =
{
        "test"
};

struct
{
        char const * const blah;
}
const moo[1] =
{
        { foo[0] }
};

int main(void)
{
        printf("blahblahlbahla\n");
}




Share this post


Link to post
Share on other sites
Gav    124
I'm running version 8.0.40607.16 (beta1.040607-1600) and that code compiles fine. Not that that's much help to you, sorry.

Share this post


Link to post
Share on other sites
Ra    1062
Do you have Compile as C Code (/TC) set in Configuration Properties -> C/C++ -> Advanced?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this