| | |
C2143, unable to understand the cause...
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
For the last 3 days I have been trying to compile m assingment on visual studio 2008. Its giving me error:
This is the same error its giving me in my main:
The lines are:
Main.cpp:
And similarly in Screen.cpp
Can some one please tell me what the error might be? console.h is the header for all the 'C' functions from my previous that I have to use in the current assignment.
•
•
•
•
Error 2 error C2143: syntax error : missing ';' before 'using' screen.cpp 27 Assignment_2
This is the same error its giving me in my main:
•
•
•
•
Error 1 error C2143: syntax error : missing ';' before 'using' main.cpp 9 Assignment_2
Main.cpp:
C++ Syntax (Toggle Plain Text)
extern "C" { // to allow the low-level C functions to be compiled #include "console.h" // by the C compiler only } #include "screen.h" #include <iostream> #include <cstdlib> #include <new> using namespace std;
And similarly in Screen.cpp
C++ Syntax (Toggle Plain Text)
/*Above are just comments*/ extern "C" { // to allow the low-level c functions to be compiled #include "console.h" // by the c compiler only } #include "screen.h" #include <cstdlib> #include <iostream> #include <new> using namespace std;
Can some one please tell me what the error might be? console.h is the header for all the 'C' functions from my previous that I have to use in the current assignment.
Live free.... Die Hard!
OK. After spending 4 days trying to fix it, I finally found the problem. I was missing a semicolon in my screen.h header file at the very bottom! Shame on me! LOL!!
NOTE FOR ANYONE HAVING THE SAME PROBLEM:
If you are including header files and getting this error, then go and check for any missing semicolons in your header file. AND DONT PANIC!! PM me if you like.
NOTE FOR ANYONE HAVING THE SAME PROBLEM:
If you are including header files and getting this error, then go and check for any missing semicolons in your header file. AND DONT PANIC!! PM me if you like.
Last edited by sid78669; Mar 19th, 2009 at 2:18 pm. Reason: NOTE for Googlers
Live free.... Die Hard!
![]() |
Other Threads in the C++ Forum
- Previous Thread: How to notice usb plug in
- Next Thread: Taskkill frontend problems
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node output parameter pointer problem program programming project proxy python read recursion recursive reference return rpg string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






