LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-12-2009, 08:23 AM   #1
kpachopoulos
Member
 
Registered: Feb 2004
Location: Athens, Greece
Distribution: Gentoo,FreeBSD, Debian
Posts: 705

Rep: Reputation: 30
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
 
Old 08-12-2009, 08:40 AM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by nocturna_gr View Post
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.
 
Old 08-14-2009, 10:07 AM   #3
kpachopoulos
Member
 
Registered: Feb 2004
Location: Athens, Greece
Distribution: Gentoo,FreeBSD, Debian
Posts: 705

Original Poster
Rep: Reputation: 30
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'
 
Old 08-18-2009, 05:24 PM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
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.
 
  


Reply

Tags
error, gcc



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian Lenny symlink gcc question for nVidia Driver(s) compilation and Installation bruceam Linux - Newbie 8 06-16-2009 05:47 PM
have gcc compilation error during gcc installtion in linuxfromscratch vbshanmugaprakash Linux - General 3 12-13-2006 05:52 AM
GCC Compilation Errors The_Dish Programming 7 10-08-2004 04:33 PM
should I use gcc-2.95.3 for kernel compilation shanenin Linux From Scratch 9 07-25-2004 10:24 PM
strange gcc compilation errors in Tru64 UNIX Eric F Programming 0 12-18-2003 02:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration