etwmc / Personal-HomeKit-HAP

This project will provide source code to build a HomeKit support accessories.
MIT License
236 stars 85 forks source link

Make error #56

Closed todely closed 8 years ago

todely commented 8 years ago

Hello,

I get an error at make. When it come to PHKAccessory.cpp compil error: PHKAccessory.cpp: In function 'void updateValueFromDeviceEnd(characteristics_, int, int, std::string)': PHKAccessory.cpp:336:114: error: cannot pass objects of non-trivially-copyable type 'std::string {aka class std::basicstring}' through '...' snprintf(broadcastTemp, 1024, "{\"characteristics\":[{\"aid\":%d,\"iid\":%d,\"value\":%s}]}", aid, iid, value); ^ makefile:42: recipe for target 'PHKAccessory.o' failed make: ** [PHKAccessory.o] Error 1

What's wrong ? Thanks

etwmc commented 8 years ago

What platform and compiler version are you using?

todely commented 8 years ago

Raspberry on raspbian

etwmc commented 8 years ago

Clang version?

todely commented 8 years ago

How to check on raspberry ?

etwmc commented 8 years ago

clang -v ?

todely commented 8 years ago

Clang does not exist.... -bash: clang : commande introuvable

Need to install it ?

etwmc commented 8 years ago

How about gcc? You can check with gcc -version

todely commented 8 years ago
todely commented 8 years ago

$ gcc --version gcc (Raspbian 4.8.2-21~rpi3rpi1) 4.8.2 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

beckmx commented 8 years ago

Hello @etwmc I redownloaded the code and found the same issue, I tested with gcc gcc version 4.7.2 20121015 (Red Hat 4.7.2-5) (GCC) and clang version 3.4.2 both are poping the error, is it safe If I make a rollback? and use the previous version?

beckmx commented 8 years ago

the problem is with the sprintf method, so I just commented, and the compiler continued

etwmc commented 8 years ago

Can you guys try the new push? My Linux box haven't have gcc 4.8 for a while now

beckmx commented 8 years ago

it says PHKAccessory.cpp:609:1: error: stray '\357' in program

beckmx commented 8 years ago

yes it compiles now fine, my previous error was a strange char I added, thanx ;)

todely commented 8 years ago

Works too Thanks !