LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   gcc 4.3 c++ compilation: question about errors (http://www.linuxquestions.org/questions/programming-9/gcc-4-3-c-compilation-question-about-errors-746986/)

kpachopoulos 08-12-2009 09:23 AM

gcc 4.3 c++ compilation: question about errors
 
Hi,
trying to build something, i get the following error
Code:

...
sc_wrappers/read_file_to_matrix_wrapper.cpp: In constructor 'read_file_to_matrix_wrapper::read_file_to_matrix_wrapper(sc_core::sc_module_name)':
    [exec] sc_wrappers/read_file_to_matrix_wrapper.cpp:6: error: expected primary-expression before ')' token
...

Unfortunately the compilation process is very compicated and i cannot follow the whole of it. My question is, if the gcc compiler returns in the error the EXACT constructor signature found in the source code file; "read_file_to_matrix_wrapper::read_file_to_matrix_wrapper(sc_core::sc_module_name)". The problem is, that in the source files, which where supposed to be compiled, there is only the constructor with the signature "read_file_to_matrix_wrapper(sc_module_name name)" and i am afraid, that the compilation script compiles wrong files.

Thnx

johnsfine 08-12-2009 09:40 AM

Quote:

Originally Posted by nocturna_gr (Post 3640444)
gcc compiler returns in the error the EXACT constructor signature found in the source code file

It is the exact constructor signature it understood from that source code. It is not a quote of the original source code from which it read that signature.

So you are saying it understood read_file_to_matrix_wrapper::read_file_to_matrix_wrapper when it read read_file_to_matrix_wrapper and it understood sc_core::sc_module_name when it read sc_module_name

The second could be from any number of scoping situations and I hope you have the scope correct (so the sc_module_name that is in scope where it is used is supposed to be the one from sc_core).
The first implies the constructor is defined within the class so you have the whole class definition in a cpp rather than an hpp, which is unusual but may be perfectly correct. Or mabe you just left out a detail when copying from the source code.

Quote:

sc_wrappers/read_file_to_matrix_wrapper.cpp:6
If you quoted the important part of the error message, this part tells you where to look for your bug. If you show us the first 7 lines of that file we can probably guess the nature of the bug.

kpachopoulos 08-14-2009 11:07 AM

Thanks John for the answer, here are the first lines
Code:

In file included from lib/functional_trace.h:4,
                from lib/ProcessWrapper.h:9,
                from sc_wrappers/read_file_to_matrix_wrapper.h:4,
                from sc_wrappers/read_file_to_matrix_wrapper.cpp:1:
lib/trace.h:28: warning: deprecated conversion from string constant to 'char*'
lib/trace.h:28: warning: deprecated conversion from string constant to 'char*'
lib/trace.h:28: warning: deprecated conversion from string constant to 'char*'
lib/trace.h:28: warning: deprecated conversion from string constant to 'char*'
sc_wrappers/read_file_to_matrix_wrapper.cpp: In constructor 'read_file_to_matrix_wrapper::read_file_to_matrix_wrapper(sc_core::sc_module_name)':
sc_wrappers/read_file_to_matrix_wrapper.cpp:6: error: expected primary-expression before ')' token
sc_wrappers/read_file_to_matrix_wrapper.cpp:6: error: expected `;' before 'new'
sc_wrappers/read_file_to_matrix_wrapper.cpp: In destructor 'virtual read_file_to_matrix_wrapper::~read_file_to_matrix_wrapper()':
sc_wrappers/read_file_to_matrix_wrapper.cpp:15: error: 'Read_file_to_matrix_State' was not declared in this scope
sc_wrappers/read_file_to_matrix_wrapper.cpp:15: error: expected primary-expression before ')' token
sc_wrappers/read_file_to_matrix_wrapper.cpp:15: error: expected `;' before '_state'


johnsfine 08-18-2009 06:24 PM

I was away a few days. If you still have the problem, I meant the first 7 lines of the file.
sc_wrappers/read_file_to_matrix_wrapper.cpp

I can't deduce any more from the extra error messages you posted. I was asking for the source code that caused the errors.


All times are GMT -5. The time now is 09:17 PM.