简体   繁体   中英

BeagleBone Black + BlackLib- program+library compilation

I need to compile library with my program (just main.cpp). The library is BlackLib 2.0 (there is already how to compile blacklib (c++) , but I am not able to reproduce the result ... maybe I am misinterpreting something).

Anyway, 3 important points:

1) main.cpp includes :

#include <iostream>
#include <unistd.h>

#include <BlackCore.h>
#include <BlackDef.h>
#include <BlackErr.h>
#include <BlackLib.h>
#include <BlackUART.h>

2) all files (library files - .cpp & .h ... and main.cpp) are in 1 folder:

/home/martin/uart/uart_5#

3) command to compile the files (directly on BeagleBone Black)

g++ *.cpp -o main -std=c++11

Problems :

BlackI2C.cpp: In member function 'bool BlackLib::BlackI2C::close()':
BlackI2C.cpp:133:13: error: '::close' has not been declared
BlackI2C.cpp: In member function 'bool BlackLib::BlackI2C::writeLine(uint8_t*, size_t)':
BlackI2C.cpp:287:13: error: '::write' has not been declared
BlackI2C.cpp: In member function 'bool BlackLib::BlackI2C::readLine(uint8_t*, size_t)':
BlackI2C.cpp:302:13: error: '::read' has not been declared
BlackSPI.cpp: In member function 'bool BlackLib::BlackSPI::close()':
BlackSPI.cpp:213:13: error: '::close' has not been declared
BlackUART.cpp: In member function 'bool BlackLib::BlackUART::close()':
BlackUART.cpp:166:13: error: '::close' has not been declared
BlackUART.cpp: In member function 'bool BlackLib::BlackUART::read(char*, size_t)':
BlackUART.cpp:226:12: error: '::read' has not been declared
BlackUART.cpp: In member function 'std::string BlackLib::BlackUART::read()':
BlackUART.cpp:244:24: error: '::read' has not been declared
BlackUART.cpp: In member function 'bool BlackLib::BlackUART::write(char*, size_t)':
BlackUART.cpp:262:12: error: '::write' has not been declared
BlackUART.cpp: In member function 'bool BlackLib::BlackUART::write(std::string)':
BlackUART.cpp:276:12: error: '::write' has not been declared
BlackUART.cpp: In member function 'bool BlackLib::BlackUART::transfer(char*, char*, size_t, uint32_t)':
BlackUART.cpp:293:12: error: '::write' has not been declared
BlackUART.cpp:303:23: error: 'usleep' was not declared in this scope
BlackUART.cpp:309:12: error: '::read' has not been declared
BlackUART.cpp: In member function 'std::string BlackLib::BlackUART::transfer(std::string, uint32_t)':
BlackUART.cpp:324:12: error: '::write' has not been declared
BlackUART.cpp:334:23: error: 'usleep' was not declared in this scope
BlackUART.cpp:339:24: error: '::read' has not been declared
BlackUART.cpp: In member function 'BlackLib::BlackUART& BlackLib::BlackUART::operator<<(std::string&)':
BlackUART.cpp:960:12: error: '::write' has not been declared
BlackUART.cpp: In member function 'BlackLib::BlackUART& BlackLib::BlackUART::operator>>(std::string&)':
BlackUART.cpp:977:24: error: '::read' has not been declared
main.cpp:4:23: fatal error: BlackCore.h: No such file or directory
compilation terminated.

I am a bit desparate. The BackLib FAQ doesnt help either.

我已经发布了有关如何使用标题COMPLETE GUIDE 编译blacklib(c ++)的答案, 如何 直接在运行ANGSTROM的BEAGLEBONE BLACK(rev C)上编译BLACKLIB

您需要将头文件unistd.h添加到BlackUART.h

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM