Highlighted

how to resolve build error C1189: #error PS SDK CS6 VS2013 SampleCode/SimpleFormat plugin?

New Here ,
Mar 20, 2014

Copy link to clipboard

Copied

I have inherited a Photoshop CS6 format Plugin developed at my company.  This plugin was modeled after the SimpleFormat project found in the adobe_photoshop_cs6_sdk_win\pluginsdk\samplecode\format\simpleformat folder.

I believe the plugin was originally developed under Visual Studio 2010 and then ported to Visual Studio 2012 on the same machine.

The solution/project currently compiles in Visual Studio 2012 on the original machine.  The Project Properties General Platform toolset is set to Windows7.1SDK on the original machine.

I have a brand new laptop.  I have just installed Visual Studio 2013.  I pulled the solution from our repository and opened it in Visual Studio 2013.  When prompted if I wanted to port the 2012 project to 2013 I answered yes.  The Project Properties General Platform toolset is now set to Visual Studio 2013 (v120).

When I build the project, I get several C1189: #errors.

I also tried building the SimpleFormat example in 2013 and also get the C1189 errors.

Error3error C1189: #error :  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro. (..\Common\SimpleFormatScripting.cpp)c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h2501SimpleFormat
Error6error C1189: #error :  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro. (..\..\..\common\sources\PIWinUI.cpp)c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h2501SimpleFormat

1>------ Build started: Project: SimpleFormat, Configuration: Debug Win32 ------

1>  Compiling PiPL resource...

1>  Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86

1>  Copyright (C) Microsoft Corporation.  All rights reserved.

1> 

1>  SimpleFormat.r

1>  CnvtPiPL. Release Version 13.0, Oct 25 2011 18:03:33.

1>  Copyright 1992-2010 Adobe Systems Incorporated.

1>  All rights reserved.

1>  SimpleFormat.cpp

1>  SimpleFormatScripting.cpp

1>  SimpleFormatUI.cpp

1>  FileUtilities.cpp

1>  FileUtilitiesWin.cpp

1>  PIDLLInstance.cpp

1>  PIUSuites.cpp

1>  PIWinUI.cpp

1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h(197): warning C4005: 'false' : macro redefinition (..\Common\SimpleFormatScripting.cpp)

1>          c:\adobe_photoshop_cs6_sdk_win\pluginsdk\photoshopapi\photoshop\pitypes.h(224) : see previous definition of 'false'

1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h(232): warning C4005: 'true' : macro redefinition (..\Common\SimpleFormatScripting.cpp)

1>          c:\adobe_photoshop_cs6_sdk_win\pluginsdk\photoshopapi\photoshop\pitypes.h(220) : see previous definition of 'true'

1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h(250): fatal error C1189: #error :  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro. (..\Common\SimpleFormatScripting.cpp)

1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h(197): warning C4005: 'false' : macro redefinition (..\..\..\common\sources\PIWinUI.cpp)

1>          c:\adobe_photoshop_cs6_sdk_win\pluginsdk\photoshopapi\photoshop\pitypes.h(224) : see previous definition of 'false'

1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h(232): warning C4005: 'true' : macro redefinition (..\..\..\common\sources\PIWinUI.cpp)

1>          c:\adobe_photoshop_cs6_sdk_win\pluginsdk\photoshopapi\photoshop\pitypes.h(220) : see previous definition of 'true'

1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h(250): fatal error C1189: #error :  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro. (..\..\..\common\sources\PIWinUI.cpp)

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Warnings are annoying but you should be ok now.

Topics

SDK

Views

12.0K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

how to resolve build error C1189: #error PS SDK CS6 VS2013 SampleCode/SimpleFormat plugin?

New Here ,
Mar 20, 2014

Copy link to clipboard

Copied

I have inherited a Photoshop CS6 format Plugin developed at my company.  This plugin was modeled after the SimpleFormat project found in the adobe_photoshop_cs6_sdk_win\pluginsdk\samplecode\format\simpleformat folder.

I believe the plugin was originally developed under Visual Studio 2010 and then ported to Visual Studio 2012 on the same machine.

The solution/project currently compiles in Visual Studio 2012 on the original machine.  The Project Properties General Platform toolset is set to Windows7.1SDK on the original machine.

I have a brand new laptop.  I have just installed Visual Studio 2013.  I pulled the solution from our repository and opened it in Visual Studio 2013.  When prompted if I wanted to port the 2012 project to 2013 I answered yes.  The Project Properties General Platform toolset is now set to Visual Studio 2013 (v120).

When I build the project, I get several C1189: #errors.

I also tried building the SimpleFormat example in 2013 and also get the C1189 errors.

Error3error C1189: #error :  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro. (..\Common\SimpleFormatScripting.cpp)c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h2501SimpleFormat
Error6error C1189: #error :  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro. (..\..\..\common\sources\PIWinUI.cpp)c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h2501SimpleFormat

1>------ Build started: Project: SimpleFormat, Configuration: Debug Win32 ------

1>  Compiling PiPL resource...

1>  Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86

1>  Copyright (C) Microsoft Corporation.  All rights reserved.

1> 

1>  SimpleFormat.r

1>  CnvtPiPL. Release Version 13.0, Oct 25 2011 18:03:33.

1>  Copyright 1992-2010 Adobe Systems Incorporated.

1>  All rights reserved.

1>  SimpleFormat.cpp

1>  SimpleFormatScripting.cpp

1>  SimpleFormatUI.cpp

1>  FileUtilities.cpp

1>  FileUtilitiesWin.cpp

1>  PIDLLInstance.cpp

1>  PIUSuites.cpp

1>  PIWinUI.cpp

1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h(197): warning C4005: 'false' : macro redefinition (..\Common\SimpleFormatScripting.cpp)

1>          c:\adobe_photoshop_cs6_sdk_win\pluginsdk\photoshopapi\photoshop\pitypes.h(224) : see previous definition of 'false'

1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h(232): warning C4005: 'true' : macro redefinition (..\Common\SimpleFormatScripting.cpp)

1>          c:\adobe_photoshop_cs6_sdk_win\pluginsdk\photoshopapi\photoshop\pitypes.h(220) : see previous definition of 'true'

1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h(250): fatal error C1189: #error :  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro. (..\Common\SimpleFormatScripting.cpp)

1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h(197): warning C4005: 'false' : macro redefinition (..\..\..\common\sources\PIWinUI.cpp)

1>          c:\adobe_photoshop_cs6_sdk_win\pluginsdk\photoshopapi\photoshop\pitypes.h(224) : see previous definition of 'false'

1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h(232): warning C4005: 'true' : macro redefinition (..\..\..\common\sources\PIWinUI.cpp)

1>          c:\adobe_photoshop_cs6_sdk_win\pluginsdk\photoshopapi\photoshop\pitypes.h(220) : see previous definition of 'true'

1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h(250): fatal error C1189: #error :  The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro. (..\..\..\common\sources\PIWinUI.cpp)

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Warnings are annoying but you should be ok now.

Topics

SDK

Views

12.0K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Employee ,
Mar 25, 2014

Copy link to clipboard

Copied

The PITypes.h defines are wrapped in if undefined macros. So PITypes.h must be hit first. I would just remove them from PITypes.h.

I can't tell what is failing exactly for the SimpleFormatScripting.cpp file. Which line number is it complaining about? Or is it that it includes PITypes.h?

Likes

1 Like

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Mar 25, 2014

Copy link to clipboard

Copied

Thank you for responding ☺

The SimpleFormatScripting.cpp file seems to be failing due to the #include path. SimpleFormatScripting.cpp includes 1 .h file, #include "SimpleFormat.h". The SimpleFormat.h includes 5 .h files. The 3rd file included is PIUtilities.h. PIUtilities.h #includes PITypes.h

If I comment out the section in PITypes.h that defines TRUE true FALSE false as shown below, then I no longer get compile errors for C1189 or the warnings for C4005 for redefinition of true, false.

/*

#ifndef TRUE

#define TRUE 1

#endif

#ifndef FALSE

#define FALSE 0

#endif

#ifndef true

#define true TRUE

#endif

#ifndef false

#define false FALSE

#endif

*/

I do get several new warnings:

Warning 2 warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:LBR' specification C:\adobe_photoshop_cs6_sdk_win\pluginsdk\samplecode\format\simpleformat\win\SimpleFormat.obj SimpleFormat

Warning 1 warning LNK4075: ignoring '/INCREMENTAL' due to '/RELEASE' specification C:\adobe_photoshop_cs6_sdk_win\pluginsdk\samplecode\format\simpleformat\win\LINK SimpleFormat

Warning 3 warning LNK4237: /SUBSYSTEM:NATIVE specified when importing from 'KERNEL32.DLL'; Use /SUBSYSTEM:CONSOLE or /SUBSYSTEM:WINDOWS. C:\adobe_photoshop_cs6_sdk_win\pluginsdk\samplecode\format\simpleformat\win\kernel32.lib(KERNEL32.dll) SimpleFormat

Warning 4 warning LNK4237: /SUBSYSTEM:NATIVE specified when importing from 'USER32.DLL'; Use /SUBSYSTEM:CONSOLE or /SUBSYSTEM:WINDOWS. C:\adobe_photoshop_cs6_sdk_win\pluginsdk\samplecode\format\simpleformat\win\user32.lib(USER32.dll) SimpleFormat

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Employee ,
Mar 25, 2014

Copy link to clipboard

Copied

Warnings are annoying but you should be ok now.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Mar 25, 2014

Copy link to clipboard

Copied

Note: In my plugin that was modeled after the SimpleFormat solution delivered with the sdk, I was able to solve the build issue by adding ALLOWKEYWORD_MACROS to the solution properties Configuration Properties C/C++ Preprocessor Preprocessor Definitions.

I tried adding this same preprocessor definition to the SimpleFormat solution, but it didn’t solve the build errors. Only commenting out the block of code in the PITypes.h shown below solved the build issue on SimpleFormat.

/*

#ifndef TRUE

#define TRUE 1

#endif

#ifndef FALSE

#define FALSE 0

#endif

#ifndef true

#define true TRUE

#endif

#ifndef false

#define false FALSE

#endif

*/

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...