0
votes
#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("Hello world!\n");
    return 0;
}

When i compile this I get a TON of errors, in stdio.h and stdlib.h...

All the errors look like this:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h|234|error: expected a ")"|

I set the compiler up using the guide on the Code:blocks website: http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler

Build Log:

-------------- Clean: Debug in test (compiler: Intel C/C++ Compiler)---------------

Cleaned "test - Debug"

-------------- Build: Debug in test (compiler: Intel C/C++ Compiler)---------------

icl.exe /nologo -Wall /Zi /I"C:\Program Files (x86)\Intel\Compiler\C++\10.1.014\IA32\include" /I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include" /I"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include" /c main.c /Foobj\Debug\main.obj main.c

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(234): error: expected a ")" _Check_return_ _CRT_INSECURE_DEPRECATE(fopen_s) _CRTIMP FILE * __cdecl fopen(_In_z_ const char * _Filename, _In_z_ const char * _Mode); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(249): error: expected a ")" _Check_return_ _CRT_INSECURE_DEPRECATE(freopen_s) _CRTIMP FILE * __cdecl freopen(_In_z_ const char * _Filename, _In_z_ const char * _Mode, Inout FILE * _File); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(253): error: expected a ")" _Check_return_ _CRT_INSECURE_DEPRECATE(fscanf_s) _CRTIMP int __cdecl fscanf(Inout FILE * _File, _In_z_ _Scanf_format_string_ const char * _Format, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(254): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_fscanf_s_l) _CRTIMP int __cdecl _fscanf_l(Inout FILE * _File, _In_z_ _Scanf_format_string_ const char * _Format, _In_opt_ _locale_t _Locale, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(277): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0(char *, __RETURN_POLICY_SAME, _CRTIMP, gets, _Pre_notnull_ _Post_z_ _Out_z_cap_c_(((size_t)-1)), char, _Buffer) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(299): error: expected a ")" _CRT_NONSTDC_DEPRECATE(_unlink) _CRTIMP int __cdecl unlink(_In_z_ const char * _Filename); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(304): error: expected a ")" _Check_return_ _CRT_INSECURE_DEPRECATE(scanf_s) _CRTIMP int __cdecl scanf(_In_z_ _Scanf_format_string_ const char * _Format, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(305): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_scanf_s_l) _CRTIMP int __cdecl _scanf_l(_In_z_ _Scanf_format_string_ const char * _Format, _In_opt_ _locale_t _Locale, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(313): error: expected a ")" _CRT_INSECURE_DEPRECATE(setvbuf) _CRTIMP void __cdecl setbuf(Inout FILE * _File, _Inout_opt_cap_c_(BUFSIZ) _Post_count_c_(0) char * _Buffer); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(325): error: expected a ")" _Check_return_ _CRT_INSECURE_DEPRECATE(sscanf_s) _CRTIMP int __cdecl sscanf(_In_z_ const char * _Src, _In_z_ _Scanf_format_string_ const char * _Format, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(326): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_sscanf_s_l) _CRTIMP int __cdecl _sscanf_l(_In_z_ const char * _Src, _In_z_ _Scanf_format_string_ const char * _Format, _In_opt_ _locale_t _Locale, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(333): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_snscanf_s) _CRTIMP int __cdecl _snscanf(_In_bytecount_(_MaxCount) _Pre_z_ const char * _Src, In size_t _MaxCount, _In_z_ _Scanf_format_string_ const char * _Format, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(334): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_snscanf_s_l) _CRTIMP int __cdecl _snscanf_l(_In_bytecount_(_MaxCount) _Pre_z_ const char * _Src, In size_t _MaxCount, _In_z_ _Scanf_format_string_ const char * _Format, _In_opt_ _locale_t _Locale, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(338): error: expected a ")" _Check_return_ _CRT_INSECURE_DEPRECATE(tmpfile_s) _CRTIMP FILE * __cdecl tmpfile(void); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(344): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0(char *, __RETURN_POLICY_DST, _CRTIMP, tmpnam, _Pre_maybenull_ _Post_z_, char, _Buffer) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(354): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(vsnprintf_s) _CRTIMP int __cdecl vsnprintf(_Out_cap_(_MaxCount) char * _DstBuf, In size_t _MaxCount, _In_z_ _Printf_format_string_ const char * _Format, va_list _ArgList); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(363): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_ARGLIST_EX(int, __RETURN_POLICY_SAME, _CRTIMP, _snprintf, _vsnprintf, _Pre_notnull_ _Post_maybez_ char, _Out_cap_(_Count) _Post_maybez_, char, _Dest, In size_t, _Count, _In_z_ _Printf_format_string_ const char *, _Format) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(363): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_ARGLIST_EX(int, __RETURN_POLICY_SAME, _CRTIMP, _snprintf, _vsnprintf, _Pre_notnull_ _Post_maybez_ char, _Out_cap_(_Count) _Post_maybez_, char, _Dest, In size_t, _Count, _In_z_ _Printf_format_string_ const char *, _Format) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_ARGLIST(int, __RETURN_POLICY_SAME, _CRTIMP, sprintf, vsprintf, _Pre_notnull_ _Post_z_, char, _Dest, _In_z_ _Printf_format_string_ const char *, _Format) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_ARGLIST(int, __RETURN_POLICY_SAME, _CRTIMP, sprintf, vsprintf, _Pre_notnull_ _Post_z_, char, _Dest, _In_z_ _Printf_format_string_ const char *, _Format) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(402): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_sprintf_s_l) _CRTIMP int __cdecl _sprintf_l(_Pre_notnull_ _Post_z_ char * _DstBuf, _In_z_ _Printf_format_string_ const char * _Format, _In_opt_ _locale_t _Locale, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(405): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_vsprintf_s_l) _CRTIMP int __cdecl _vsprintf_l(_Pre_notnull_ _Post_z_ char * _DstBuf, _In_z_ const char * _Format, _In_opt_ _locale_t, va_list _ArgList); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(414): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_snprintf_s_l) _CRTIMP int __cdecl _snprintf_l(_Out_cap_(_MaxCount) char * _DstBuf, In size_t _MaxCount, _In_z_ _Printf_format_string_ const char * _Format, _In_opt_ _locale_t _Locale, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(417): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_vsnprintf_s_l) _CRTIMP int __cdecl _vsnprintf_l(_Out_cap_(_MaxCount) char * _DstBuf, In size_t _MaxCount, _In_z_ _Printf_format_string_ const char * _Format, _In_opt_ _locale_t _Locale, va_list _ArgList); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(449): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0(wchar_t *, __RETURN_POLICY_SAME, _CRTIMP, _getws, _Pre_notnull_ _Post_z_, wchar_t, _String) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(488): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_ARGLIST_EX(int, __RETURN_POLICY_SAME, _CRTIMP, _snwprintf, _vsnwprintf, _Pre_notnull_ _Post_maybez_ wchar_t, _Out_cap_(_Count) _Post_maybez_, wchar_t, _Dest, In size_t, _Count, _In_z_ _Printf_format_string_ const wchar_t *, _Format) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(488): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_ARGLIST_EX(int, __RETURN_POLICY_SAME, _CRTIMP, _snwprintf, _vsnwprintf, _Pre_notnull_ _Post_maybez_ wchar_t, _Out_cap_(_Count) _Post_maybez_, wchar_t, _Dest, In size_t, _Count, _In_z_ _Printf_format_string_ const wchar_t *, _Format) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(525): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_snwprintf_s_l) _CRTIMP int __cdecl _snwprintf_l(_Out_cap_(_MaxCount) wchar_t * _DstBuf, In size_t _MaxCount, _In_z_ _Printf_format_string_ const wchar_t * _Format, _In_opt_ _locale_t _Locale, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(527): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_vsnwprintf_s_l) _CRTIMP int __cdecl _vsnwprintf_l(_Out_cap_(_MaxCount) wchar_t * _DstBuf, In size_t _MaxCount, _In_z_ _Printf_format_string_ const wchar_t * _Format, _In_opt_ _locale_t _Locale, va_list _ArgList); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(544): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_ARGLIST_EX(int, __RETURN_POLICY_SAME, _SWPRINTFS_DEPRECATED _CRTIMP, _swprintf, _swprintf_s, _vswprintf, vswprintf_s, _Pre_notnull_ _Post_z_, wchar_t, _Dest, _In_z_ _Printf_format_string_ const wchar_t *, _Format) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(544): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_ARGLIST_EX(int, __RETURN_POLICY_SAME, _SWPRINTFS_DEPRECATED _CRTIMP, _swprintf, _swprintf_s, _vswprintf, vswprintf_s, _Pre_notnull_ _Post_z_, wchar_t, _Dest, _In_z_ _Printf_format_string_ const wchar_t *, _Format) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(544): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_ARGLIST_EX(int, __RETURN_POLICY_SAME, _SWPRINTFS_DEPRECATED _CRTIMP, _swprintf, _swprintf_s, _vswprintf, vswprintf_s, _Pre_notnull_ _Post_z_, wchar_t, _Dest, _In_z_ _Printf_format_string_ const wchar_t *, _Format) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(544): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_ARGLIST_EX(int, __RETURN_POLICY_SAME, _SWPRINTFS_DEPRECATED _CRTIMP, _swprintf, _swprintf_s, _vswprintf, vswprintf_s, _Pre_notnull_ _Post_z_, wchar_t, _Dest, _In_z_ _Printf_format_string_ const wchar_t *, _Format) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(545): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2_ARGLIST_EX(int, __RETURN_POLICY_SAME, _SWPRINTFS_DEPRECATED _CRTIMP, __swprintf_l, __vswprintf_l, _vswprintf_s_l, _Pre_notnull_ _Post_z_ wchar_t, , wchar_t, _Dest, _In_z_ _Printf_format_string_ const wchar_t *, _Format, _locale_t, _Plocinfo) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(545): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2_ARGLIST_EX(int, __RETURN_POLICY_SAME, _SWPRINTFS_DEPRECATED _CRTIMP, __swprintf_l, __vswprintf_l, _vswprintf_s_l, _Pre_notnull_ _Post_z_ wchar_t, , wchar_t, _Dest, _In_z_ _Printf_format_string_ const wchar_t *, _Format, _locale_t, _Plocinfo) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(545): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2_ARGLIST_EX(int, __RETURN_POLICY_SAME, _SWPRINTFS_DEPRECATED _CRTIMP, __swprintf_l, __vswprintf_l, _vswprintf_s_l, _Pre_notnull_ _Post_z_ wchar_t, , wchar_t, _Dest, _In_z_ _Printf_format_string_ const wchar_t *, _Format, _locale_t, _Plocinfo) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(545): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2_ARGLIST_EX(int, __RETURN_POLICY_SAME, _SWPRINTFS_DEPRECATED _CRTIMP, __swprintf_l, __vswprintf_l, _vswprintf_s_l, _Pre_notnull_ _Post_z_ wchar_t, , wchar_t, _Dest, _In_z_ _Printf_format_string_ const wchar_t *, _Format, _locale_t, _Plocinfo) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(574): error: expected a ")" _Check_return_ _CRT_INSECURE_DEPRECATE(fwscanf_s) _CRTIMP int __cdecl fwscanf(Inout FILE * _File, _In_z_ _Scanf_format_string_ const wchar_t * _Format, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(575): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_fwscanf_s_l) _CRTIMP int __cdecl _fwscanf_l(Inout FILE * _File, _In_z_ _Scanf_format_string_ const wchar_t * _Format, _In_opt_ _locale_t _Locale, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(582): error: expected a ")" _Check_return_ _CRT_INSECURE_DEPRECATE(swscanf_s) _CRTIMP int __cdecl swscanf(_In_z_ const wchar_t * _Src, _In_z_ _Scanf_format_string_ const wchar_t * _Format, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(583): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_swscanf_s_l) _CRTIMP int __cdecl _swscanf_l(_In_z_ const wchar_t * _Src, _In_z_ _Scanf_format_string_ const wchar_t * _Format, _In_opt_ _locale_t _Locale, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(588): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_snwscanf_s) _CRTIMP int __cdecl _snwscanf(_In_count_(_MaxCount) _Pre_z_ const wchar_t * _Src, In size_t _MaxCount, _In_z_ _Scanf_format_string_ const wchar_t * _Format, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(589): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_snwscanf_s_l) _CRTIMP int __cdecl _snwscanf_l(_In_count_(_MaxCount) _Pre_z_ const wchar_t * _Src, In size_t _MaxCount, _In_z_ _Scanf_format_string_ const wchar_t * _Format, _In_opt_ _locale_t _Locale, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(592): error: expected a ")" _Check_return_ _CRT_INSECURE_DEPRECATE(wscanf_s) _CRTIMP int __cdecl wscanf(_In_z_ _Scanf_format_string_ const wchar_t * _Format, ...); compilation aborted for main.c (code 2) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(593): error: expected a ")" _Check_return_opt_ _CRT_INSECURE_DEPRECATE(_wscanf_s_l) _CRTIMP int __cdecl _wscanf_l(_In_z_ _Scanf_format_string_ const wchar_t * _Format, _In_opt_ _locale_t _Locale, ...); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(601): error: expected a ")" _Check_return_ _CRT_INSECURE_DEPRECATE(_wfopen_s) _CRTIMP FILE * __cdecl _wfopen(_In_z_ const wchar_t * _Filename, _In_z_ const wchar_t * _Mode); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(603): error: expected a ")" _Check_return_ _CRT_INSECURE_DEPRECATE(_wfreopen_s) _CRTIMP FILE * __cdecl _wfreopen(_In_z_ const wchar_t * _Filename, _In_z_ const wchar_t * _Mode, Inout FILE * _OldFile); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(614): error: expected a ")" __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0(wchar_t *, __RETURN_POLICY_DST, _CRTIMP, _wtmpnam, _Pre_maybenull_ _Post_z_, wchar_t, _Buffer) ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(714): error: expected a ")" _CRT_NONSTDC_DEPRECATE(_tempnam) _CRTIMP char * __cdecl tempnam(_In_opt_z_ const char * _Directory, _In_opt_z_ const char * _FilePrefix); ^ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(720): error: expected a ")" Process terminated with status 2 (0 minutes, 0 seconds) 50 errors, 0 warnings (0 minutes, 0 seconds)

Thanks, Any help at all is appreciated.

2
SuddyD, I do not often use MVS. My best guess is that perhaps there is a setting in MVS which indicates that your program (or project) is intended for a command-line environment (rather than a GUI, etc., environment). Perhaps you should add the "visual-studio" tag?Mahonri Moriancumer
The Build log would help to see the command line used for executing the Intel compiler including the errors. What version of ICC are you using?Alexander Weggerle
@AlexanderWeggerle ICL version 10.1. Do you want me to include the build log?gregyjames
why are you including stdlib.h here? printf is in stdio.hphuclv

2 Answers

0
votes

I guess your Visual Studio 2010 is simply to new to work with the Intel Compiler 10.1.014 - or in other words your Intel Compiler version is too old. VS 2010 was released 2 years after ICC 10.1.014. Even VS 2008 is not officially supported in your compiler version.

I would try one of the following to solve your issue:

  1. Update your version of the Intel Compiler. With a valid license you should be able to login to http://registrationcenter.intel.com . Your license may also include newer versions of the Intel compiler.
  2. Downgrade your Visual Studio to 2008 or 2005.
1
votes

Instead of:

#include "stdio.h"
#include "stdlib.h"

Use:

#include <stdio.h>
#include <stdlib.h>