Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Silly MSVC++ Errors!

Status
Not open for further replies.

joeGrammar

Programmer
Jun 4, 2001
162
CA
Hey guys,

I'm trying to compile a bit of code and I'm getting some silly VC++ errors

c:\program files\microsoft visual studio\vc98\include\sqltypes.h(114) : error C2146: syntax error : missing ';' before identifier 'SQLHWND'
c:\program files\microsoft visual studio\vc98\include\sqltypes.h(114) : fatal error C1004: unexpected end of file found

Now these are system header files, why would I be getting these errors? Thanks
 
try to put #include<sql...h> before any headers you defined. Put it in one single place, in StdAfx.h. John Fill
1c.bmp


ivfmd@mail.md
 
Also... another thing to look at is if you created the include file &quot;sqltypes.h&quot;, and if it is a class, enum, struct, union... make sure you put a semi-colon at the end of the declaraction of it.

Matt
 
OK, that didn't seem to work... any other suggestions?
 
It is a MSVC system header file, I did not create anything
 
Try to include stqext.h or sql.h instead if sqltypes.h.
John Fill
1c.bmp


ivfmd@mail.md
 
Nah, all three, in any combination give me the same error
 
Do you have an MFC project? if yes, does it have database support? John Fill
1c.bmp


ivfmd@mail.md
 
Yes, and I'm assuming yes, how would I check?

P.S. I'm creating a DLL here
 
1. Try to see in all your own h files, maybe where you have defined class with miised ; at the end.
2. Try to include before sqltypes some sql.h and/or sqlext.h, or try other files.
3. If you are assured all is right and nothing helped, try to make an MFC project without database support. Add by hand odbc32.lib odbccp32.lib to linker option even if it is a compiller error. John Fill
1c.bmp


ivfmd@mail.md
 
Well I do have database support, I just don't understand why I would be getting this error, its saying there is a syntax error in the sqltypes.h file which is included in the VC++ package. I know this is something easy and stupid like most other errors in VC++, someone must have seen something like this before...
 
if you didn't insert/delete/replace accidentally some characters, the file is correct. If you are not sure if you did it or not, just replace the file in VC++s folder \include. John Fill
1c.bmp


ivfmd@mail.md
 
Could you please put up the code where you have the compilation error.

Thanx

Anyway in sqltypes.h, if you are using WIN32 environment SQLHWND is defined as HWND(with typedef). Try to put HWND and see what happens. Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
The error &quot;unexpected end of file found&quot; can be because in your setting, u stipulated /Yu, meaning 'include PCH'. (pre compiled header). Depending on ur application, please determine the pch file ur program uses and simply #include it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top