compiling c code with a c++ compiler -
i attempting use c code did not write myself in tandem own c++ code. when attempt compile c code below error. unsure c code attempting accomplish .xxx format. @ loss appreciated.
const bmpfile_header_t bmp_fh = { .filesz = offset + bmp_ih->bmp_bytesz, .creator1 = 0, .creator2 = 0, .bmp_offset = offset };
throws error: missing'}' before '.'
the .field = value
designated initializers fields of struct
, i.e., bmp_fh.bmp_offset
set value offset
, etc. either give values fields of structure (in order) without designated (.field
) initializers, or remove const
, assign values afterwards.
or, unless wish port c code c++ compiler, compile c code c compiler , link c++ program. c++ code can call c functions.
Comments
Post a Comment