microsoft / Chakra-Samples

Repository for Chakra JavaScript engine related samples.
MIT License
216 stars 84 forks source link

compiling failure in Windows #54

Closed xzwang2005 closed 7 years ago

xzwang2005 commented 7 years ago

hi,

I got following errors while compiling the samples (in Windows 10):

chakracore.h(215): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int chakracore.h(215): error C2143: syntax error: missing ',' before '*' chakracore.h(273): error C2061: syntax error: identifier 'uint16_t'

any ideas?

liminzhu commented 7 years ago

Hi @xzwang2005! Which sample are you trying to compile and are you compiling against ChakraCore master? I'll take a look.

xzwang2005 commented 7 years ago

I was compiling "hello world", 64-bit with windows SDK 8.1. I first built chakra core as dll (cloned from master), copied the headers and lib files to a folder under Chakra-Samples. Then pointing to these folders in HelloWorld.sln.

liminzhu commented 7 years ago

@xzwang2005 I think some of our recent changes in the headers break the sample. @obastemur can you look into our windows sample?

r12f commented 7 years ago

I met the exact same issue while following the document: https://github.com/Microsoft/ChakraCore/wiki/Embedding-ChakraCore#before-you-start.

And after a quick look, it looks the stdint.h is not included by ChakraCore.h, so including stdint.h before including ChakraCore.h can work around this issue.

#include <stdint.h>
#include "ChakraCore.h"

But I guess Chakra prefer to having stdint.h included by ChakraCore.h by default?

r12f commented 7 years ago

Fixed by PR: https://github.com/Microsoft/ChakraCore/pull/2511

liminzhu commented 7 years ago

👍 👍