dji-sdk / Guidance-SDK

The official Guidance SDK package for Windows, Ubuntu and XU3.
134 stars 98 forks source link

Example Code Library Error #13

Closed thetoivonen closed 8 years ago

thetoivonen commented 8 years ago

$ make -f Makefile_noOpenCV

g++ -g -Wall -I/usr/local/include -I../../../include -c main.cpp DJI_utility.h main.cpp: In function ‘std::ostream& operator<<(std::ostream&, e_sdk_err_code)’: main.cpp:52:30: error: ‘strcpy’ was not declared in this scope main.cpp: In function ‘int main(int, const char**)’: main.cpp:230:6: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses] make: *** [main.o] Error 1

In Guidance-SDK/examples/usb_example/DJI_guidance_example/main.cpp

Line 2 reads: #include <string>

and must be changed to: #include <string.h> for program to compile correctly.

lanyusea commented 8 years ago

aha?

thetoivonen commented 8 years ago

Fixed my initial post, code was not displayed properly.

janwillemm commented 8 years ago

Another solution is to include <cstring>, as found on stackoverflow. After including cstring the issue is also solved