C Error C2275
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies
Visual Studio C99 Support
of this site About Us Learn more about Stack Overflow the company Business error c2143: syntax error : missing ';' before 'type' Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges
Xerox C2275
Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: c2275 fuji xerox Sign up error C2275 : illegal use of this type as an expression up vote 44 down vote favorite 7 Since yesterday, I've been facing a compiling error for my C project. The project itself consists on creating a service that will make some tasks. I don't what has changed since yesterday, but this morning, my code can't compile anymore. Here are the c89 errors I have : c:\path\main.c(56): error C2275: 'SERVICE_TABLE_ENTRY' : illegal use of this type as an expression c:\program files\microsoft sdks\windows\v7.0a\include\winsvc.h(773) : see declaration of 'SERVICE_TABLE_ENTRY' c:\path\main.c(56): error C2146: syntax error : missing ';' before identifier 'DispatchTable' c:\path\main.c(56): error C2065: 'DispatchTable' : undeclared identifier c:\path\main.c(56): error C2059: syntax error : ']' c:\path\main.c(57): error C2065: 'DispatchTable' : undeclared identifier c:\path\main.c(57): warning C4047: 'function' : 'const SERVICE_TABLE_ENTRYA *' differs in levels of indirection from 'int' c:\path\main.c(57): warning C4024: 'StartServiceCtrlDispatcherA' : different types for formal and actual parameter 1 Here's the code concerned by these errors (from lines 45 to 58) : int main(int ac, char *av[]) { if (ac > 1) { if (!parse_args(ac, av)) { aff_error(ARGUMENTS); return EXIT_FAILURE; } } SERVICE_TABLE_ENTRY DispatchTable[] = {{MY_SERVICE_NAME, ServiceMain}, {NULL, NULL}}; StartServiceCtrlDispatcher(DispatchTable); return EXIT_SUCCESS; } And here's the code of my ServiceMain function : void WINAPI ServiceMain(DWORD ac, LPTSTR *av) { gl_ServiceStatus.dwServiceType = SERVICE_WIN32; gl_ServiceStatus.dwCurrentState = SERVICE_START_PENDING; gl_ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP; gl_ServiceStatus.dwWin32ExitCode = 0; gl_ServiceStatus.dwServiceSpecificExitCode = 0; gl_ServiceStatus.dwCheckPoint = 0; gl_ServiceStatus.dwWaitHint = 0; gl_ServiceStatusHandle = RegisterServiceCtrlHandler(MY_SERVICE_NAME, ServiceCtrlHandler); if (gl_ServiceStatusHandle == (SERVICE_STATUS_HANDLE)0) return; gl_ServiceStatus.dwCurrentState = SERVICE_RUNNING; gl_ServiceStatus.dwCheckPoint = 0; gl_ServiceStatus.dwWaitHint = 0; SetServiceStatus(gl_Serv
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Visual Studio “illegal use of this type as an expression” up vote 4 down vote favorite I've just started using Visual Studio (I got VS 2012 from dreamspark, and it hasn't http://stackoverflow.com/questions/9903582/error-c2275-illegal-use-of-this-type-as-an-expression been long since I've started using Windows again) and I'm having some trouble. I have a single file named "main.c" under my Source Files folder that looks like this: #include
FIRE CD-adapco STAR-CCM+ STAR-CD CONVERGE FloEFD & FloTHERM FLOW-3D NUMECA OpenFOAM News & Announcements Installation Meshing Pre-Processing Solving Post-Processing Programming Verification & Validation Bugs Phoenics SU2 News & Announcements Installation Shape Design Pre-processors ANSA enGrid GridPro Pointwise Post-Processors EnSight FieldView ParaView Tecplot Special Topics Mesh Generation Visualization CFD Online Community Site News Site Help & Discussions CFD-Wiki Wiki Introduction Recent Changes Reference Section Fluid Dynamics Turbulence Modeling Numerical Methods Meshing Special Topics Aero-Acoustics Combustion Parallel Computing Turbulence Application Areas Aerospace Automotive Turbomachinery Best Practice Guides Automotive CFD Turbomachiney CFD Heat Transfer CFD Validation Cases Codes Source Code Archive FAQ's Ansys CD-adapco CHAM Fluent Numeca History of CFD About CFD-Wiki Help FAQ Getting Started Community Portal Donate Texts Donated Texts Links What's New Introduction Modeling & Numerics Turbulence Combustion Discretization Schemes Solvers Multigrid Methods Finite Element Methods Cartesian Methods / AMR Numerial Analysis Mesh Generation General Resources Selected Projects Companies Programming & Dev. Data Formats Software Libraries Numerical Software Parallel Computing General Sites Software Fluid Dynamics Mesh Generation Visualization Commercial CFD Codes Hardware Benchmarks News and Reviews Hardware Vendors Clusters GPGPU Misc References Validation Cases Airfoils Material Properties Glossaries Finding Documents Preprints Online Papers & Reports Books Journals Publishers Online Tools Unit Converters Calculators y+ Estimation Compressible Flow Heat Transfer Airfoil Generators Simple Cases Combustion Cycles & Processes Online Books & Guides CFD Introductions Books Best Practice Guidelines Fluid & Aero Dynamics Seminars Encyclopedias Social Media Discussion Forums Blogs Twitter YouTube Facebook LinkedIn Usenet Newsgroups Mailing Lists Chats News Education CFD Programmes Online Labs Online Courses Course Material Jobs CFD Job Resources Companies & Orgs. General Resources Events Event Calendars Specific Organizations Vendor Events Lists Misc Pictures and Movies Fun Links to Links Suggest New Link About this Section Jobs Post Job Ad List All Jobs List Jobs by Type Job in Industry (61) Job in Academia (25) Contract Work (5) PostDoc Position (44) PhD Studentship (51) Internship (2) Diploma Work (3) Misc (1) List Jobs by Location Asia China (9) Hong Kong (3) India (1