0

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.

2 Answers 2

0

I have posted the answer to how to compile blacklib (c++) with headline COMPLETE GUIDE how to compile BLACKLIB directly on BEAGLEBONE BLACK (rev C) running ANGSTROM

0

you need to add header file unistd.h to BlackUART.h

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.