[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 500
  • Last Modified:

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

...
0
jimstar
Asked:
jimstar
  • 3
  • 2
1 Solution
 
jkrCommented:
Do you have a

#inlude "resurce.h"

and

#include "afxres.h"

?
0
 
jimstarAuthor Commented:
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

...
0
 
jimstarAuthor Commented:
==== 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
0
 
jimstarAuthor Commented:
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.
0
 
jkrCommented:
Thanks, sorry for the delays, but I tend to visit the "first life" on weekends ;o)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now