• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

VS/VC++ Struct Member Alignment (set to 4)?

Contributor ,
Sep 30, 2010 Sep 30, 2010

Copy link to clipboard

Copied

I would like to ask why Struct Member Alignement is set to 4 instead to Default (or 8 on x64)?

(in Visual Studio 2008 - Project properties ( -> Configuration  properties) -> C/C++ -> Code Generation -> Struct Member  Alignment)

There were runtime problems after linking with an external library (default alignment); so it might be better to change the skeleton template in SDK.

For example in After Effects CS5 SDK for windows in:

after_effects_cs5_sdk_win\Adobe After Effects CS5 Win SDK\Examples\template\Skeleton\win\Skeleton.vcproj

look for:

StructMemberAlignment="3"

and set it to 0 (default) or at least to 4 (64bit alignment)

StructMemberAlignment="0"

or

StructMemberAlignment="4"

greets

m

TOPICS
SDK

Views

1.3K

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
community guidelines
Adobe Employee ,
Oct 07, 2010 Oct 07, 2010

Copy link to clipboard

Copied

LATEST

Hi Mike,

I believe you're correct, thanks for pointing that out.  These projects had been brought forward from the CS4 versions, which were 32-bit, and used 4-byte alignment at the time.  Fortunately, the standard headers include PreConfig.h, which sets 8-byte alignment for the AE API structure definitions.  But it makes sense to no longer set 4-byte alignment in the vcprojs.

Cheers,

Zac

Votes

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
community guidelines