Link to home
Start Free TrialLog in
Avatar of jimstar
jimstar

asked on

Adding version resource to VS proj causes compile errors

I'm adding a resource file into two different VStudio 8.0 projects, and then adding a version resource into that file. One of the projects is a win32 service, another is a dll. The dll project builds fine with the inserted version resource, however the win32 service breaks immediately (using the default .rc contents / version contents that VS inserts).

Since I haven't made any modifications, it should just work... however I must be missing either a project build setting, or else perhaps an include file. Can anyone offer any advice on things to try?

1>c:\<path>\version.rc(20) : error C2146: syntax error : missing ';' before identifier 'LANG_ENGLISH'
1>c:\<path>\version.rc(20) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\<path>\version.rc(20) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\<path>\version.rc(21) : warning C4068: unknown pragma
1>c:\<path>\version.rc(55) : error C2146: syntax error : missing ';' before identifier 'VS_VERSION_INFO'
1>c:\<path>\version.rc(55) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\<path>\version.rc(56) : error C2146: syntax error : missing ';' before identifier 'VERSIONINFO'
1>c:\<path>\version.rc(56) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\<path>\version.rc(56) : error C2146: syntax error : missing ';' before identifier 'FILEVERSION'
1>c:\<path>\version.rc(56) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\<path>\version.rc(56) : error C2143: syntax error : missing ';' before 'constant'
1>c:\<path>\version.rc(56) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\sal.h(226) : error C2143: syntax error : missing ';' before '{'
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\sal.h(226) : error C2447: '{' : missing function header (old-style formal list?)

=====================

Here's one of the sections where errors occur:

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US   <---- ERROR
#pragma code_page(1252)  <--- ERROR
#endif //_WIN32

...
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jimstar
jimstar

ASKER

Yep, I have both. Actually, one is resource2.h because I've added and deleted a few different resource files, and it adds a new .h for each one.

--------------

// Microsoft Visual C++ generated resource script.
//
#include "resource2.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

...
Avatar of jimstar

ASKER

==== Resource2.h ====

//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by version.rc

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        101
#define _APS_NEXT_COMMAND_VALUE         40001
#define _APS_NEXT_CONTROL_VALUE         1001
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif
Avatar of jimstar

ASKER

I went ahead and created a new project, copied in the old files, and it magically started working. Why, I have no idea. I'll just be happy it's working now. Thanks for the ideas, I do appreciate it.
Thanks, sorry for the delays, but I tend to visit the "first life" on weekends ;o)