473,667 Members | 2,670 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(nore turn)
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 9458
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 <sstreamrequi re 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(nore turn)
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.hbefore hand.
>
Thanks
Mac

Jun 27 '08 #3

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

Similar topics

20
2881
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 go with VS2005 and I am trying to convince to buy VS2008. Can somebody provide links to compare 2 products in terms of how stable they are. I do not need VS2008 new features, I need to prove to my management that VS2008 is a stable product. TIA
6
1892
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 is not.
2
2439
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 installed but can't find the site now. Is there a problem? Would reinstalling vs2008 fix any problem that may occur because of uninstalling vs2005.
0
1054
by: AAaron123 | last post by:
The RegexOptions Enumeration contains: Multiline ExplicitCapture Compiled Singleline IgnorePatternWhitespace RightToLeft ECMAScript CultureInvariant
6
4888
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 other pc, and running it I get an error. The Dataset loads properly, but when the button is pushed to view the report I get this error: ************** Exception Text **************
4
3299
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: https://www.sdn.sap.com/irj/sdn/businessobjects-downloads ..NET Utility CR 2008 Merge Modules for the .NET Framework ZIP 74.716 Windows English 12.03.2008 and it states:
3
5799
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 uninstall Silverlight first (which is described in some blogs) and install .NET framework 3.5 SP1 manually but still failed. My VS2008 is Team Suit for developer and Vista SP1 is also installed.
1
1734
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 links in the header object. Using VS2008, framework 3.5, C#. I need to set conditional statements in the header section of page to
1
2497
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 .net resource files (using VS2008), I only get strange "blocks". The same is true (not surprisingly) if I try to paste them into Notepad. So how can I make VS2008 and my .net resource files read these non-
0
8458
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8366
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8888
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8790
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8650
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6206
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5677
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2017
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.