We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello! I have transfered my project from uVision to uVision2. The IDE has the compiler C51 V7.06 and the linker BL51 V5.03. If I rebuilt my target, the compiler displays an error-message for all functions. This occurs, even if a library function is used. "error C127: invalid storage class" The error-list contains an explanation, which I do not understand: "An object was declared with an invalid memory space specification. This occurs if an object is declared with storage- class of auto or register outside of a function." I dont know, why these error is created, because of I included the command "#pragma LARGE" and set even "Options for target" to "LARGE memory model". "Off Chip Xdata memory" is set to 64k. My project has the following structure (shortend). There could be parameters too.
// header-file: test.h // declaration of test() extern void test( void ); // main-file: main.c #pragma LARGE // include header-file #include "test.h" void main( void ) { // call test() test(); } // source-file: test.c #pragma LARGE void test( void ) { // test source code }
In detail, for each declaration of a function within the header-file, this error is created. Hmm... you haven't by any chance inadvertantly added the header files to the project as source files, have you? If that's not it, I think a small, but self-sufficient example case will be needed, along with the actual compiler output you get (including all options, as found in the first few lines of the *.lst file).