Note that there are some explanatory texts on larger screens.

plurals
  1. POcompiling C code under VS 2010
    primarykey
    data
    text
    <p>I'm trying to compile an older C code under MS VS 2010. The error occurs with struct declaration and calling.</p> <p>Declaration (edit):</p> <pre><code>typedef struct tStr { int nInt; int ***anPoint; }; </code></pre> <p>Usage:</p> <pre><code>struct tStr tStuff; tStuff.nInt = 0; </code></pre> <p>Function declaration (edit: probably works now):</p> <pre><code>int doStuff(struct tStr *sStuff, int nStuff); </code></pre> <p>The compiler complains about unidentified identifiers, missing ( or ; or { and so on. They are all categorized as syntax errors. What I checked the syntax should be ok. So I am at my end...</p> <p>I redid the struct declaration. Yet still the same error:</p> <pre><code>error C2143: syntax error : missing ';' before 'type' </code></pre> <p>Ok, back to the old declaration. But if I try to access the struct variables as in usage, I get an error:</p> <pre><code>error C2065: 'tStuff' : undeclared identifier </code></pre> <p>So my live code is:</p> <pre><code>typedef struct tMatrix { int nRows; int nCols; int nVec; int ***anMatrix; }; int allocateMatrix(struct tMatrix *sMatrix, int nType); struct tMatrix sMatrix1; sMatrix1.nRows = 0; </code></pre> <p>The errors:</p> <pre><code>error C2143: syntax error : missing ';' before 'type' error C2065: 'sMatrix1' : undeclared identifier </code></pre> <p>Any ideas?</p> <p>EDIT: Thank you for all the answers, I guess I'll just rewrite it. I also get a lot more other errors about type conversion and so... To avoid a headache I'll just start fresh. Thanks again.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload