473,508 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Header files problem in VS2008

Hello,

I have a simple .c file in VS2008 and I have set the compile type in
(project properties-C, C++ -Advanced -Compile as) to C.
main.c content:

#include <GL/glut.h>
#include <GL/glu.h>
#include <GL/gl.h>
#include <string>
#include <sstream>
#include <assert.h>

int main( int argc, char** argv )
{
return 0;
}
1- Now I am trying to compile the file but I get these errors (more than
100):

Error 1 error C2143: syntax error : missing '{' before ':'
f:\programming\vs9\vc\include\cstdio 39 gl0001
Error 2 error C2059: syntax error : ':'
f:\programming\vs9\vc\include\cstdio 39 gl0001
Error 3 error C2143: syntax error : missing '{' before ':'
f:\programming\vs9\vc\include\cstdio 41 gl0001
Error 4 error C2059: syntax error : ':'
f:\programming\vs9\vc\include\cstdio 41 gl0001
Error 5 error C2143: syntax error : missing '{' before ':'
......

2- If I change extension and compile type to .cpp I get the following error:

Error 1 error C2381: 'exit' : redefinition; __declspec(noreturn)
differs f:\programming\vs9\vc\include\stdlib.h 371 gl0001
- Could someone kindly tell me the reason of those errors in number 1?

- What about Number 2?

Thanks
Mac
Jun 27 '08 #1
2 9452
1- Now I am trying to compile the file but I get these errors (more than
100):

Error 1 error C2143: syntax error : missing '{' before ':'
f:\programming\vs9\vc\include\cstdio 39 gl0001
Error 2 error C2059: syntax error : ':'
f:\programming\vs9\vc\include\cstdio 39 gl0001
Error 3 error C2143: syntax error : missing '{' before ':'
f:\programming\vs9\vc\include\cstdio 41 gl0001
Error 4 error C2059: syntax error : ':'
f:\programming\vs9\vc\include\cstdio 41 gl0001
Error 5 error C2143: syntax error : missing '{' before ':'
.....
- Could someone kindly tell me the reason of those errors in number 1?
Your code wont work as a .c file since <stringand <sstreamrequire a C++
compiler.
Don't know about your other error.
Jun 27 '08 #2
Siamak Sarmady wrote:
Hello,

I have a simple .c file in VS2008 and I have set the compile type in
(project properties-C, C++ -Advanced -Compile as) to C.
main.c content:

#include <GL/glut.h>
#include <GL/glu.h>
#include <GL/gl.h>
#include <string>
#include <sstream>
#include <assert.h>

int main( int argc, char** argv )
{
return 0;
}
1- Now I am trying to compile the file but I get these errors (more
than 100):

Error 1 error C2143: syntax error : missing '{' before ':'
f:\programming\vs9\vc\include\cstdio 39 gl0001
Error 2 error C2059: syntax error : ':'
f:\programming\vs9\vc\include\cstdio 39 gl0001
Error 3 error C2143: syntax error : missing '{' before ':'
f:\programming\vs9\vc\include\cstdio 41 gl0001
Error 4 error C2059: syntax error : ':'
f:\programming\vs9\vc\include\cstdio 41 gl0001
Error 5 error C2143: syntax error : missing '{' before ':'
.....

2- If I change extension and compile type to .cpp I get the following
error:
Error 1 error C2381: 'exit' : redefinition; __declspec(noreturn)
differs f:\programming\vs9\vc\include\stdlib.h 371 gl0001
- Could someone kindly tell me the reason of those errors in number 1?
You can't use the C++ standard library in C code.
>
- What about Number 2?
Add #include <stdlib.hat the top of your program to get the correct
prototype for exit, then the compiler will tell you where in the gl/*
headers exit is declared badly. Or get a better copy of the gl/* headers.

You can post back here the new line that the error occurs on after #include
<stdlib.hbeforehand.
>
Thanks
Mac

Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
2862
by: Iouri | last post by:
Hi everybody, We are currently using VS2003 and now we are in the porcess of upgrading to the next Visual Studio version. Does somebody have a real life experience with VS2008? My boss wants to...
6
1887
by: Academia | last post by:
I just installed VS2008 and Edit menu has "Quick Find" and "Quick Replace" but no "Find in Files" nor "Replace in Files" Help says: On the Edit menu "Find and Replace" should be there but it...
2
2430
by: Academia | last post by:
I have vs2005 installed on the System disk and vs2008 installed on a different disk. I want to remove VS2005. I read one time about some problem with uninstalling vs2005 after vs2008 is...
0
1044
by: AAaron123 | last post by:
The RegexOptions Enumeration contains: Multiline ExplicitCapture Compiled Singleline IgnorePatternWhitespace RightToLeft ECMAScript CultureInvariant
6
4871
by: Miro | last post by:
I can run an exe ( and its install ) i have created on my machine. The exe has a button that populates a dataset and then shoots it to a crystal report. But... Installing the setup.exe on my...
4
3280
by: Miro | last post by:
<i have also added this reply to the other newsgroup - now that I have realizd ( and assuming ) it is not a localized error directly to vb.> I have found this link on the website:...
3
5793
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Hi everybody, There is a fatal error while installing VS2008 SP1 on Vista 64bit Business edition. The last line of error log is Installation failed with error code: (0x80070643) I tried to...
1
1729
by: WT | last post by:
Hello, My web application uses themes, selecting a theme from codebind for current page object. Each theme includes several css files. And I also add some specific javascript from codebehind as...
1
2492
by: JoeyMP | last post by:
Hello, I can successfully copy Chinese and other non-English characters form web pages and paste them into Microsoft Word 2003. However, when I attempt to paste them into "Value" fields in my...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7132
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7401
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7063
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4720
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.