Fix the C++ example (#41)
- Build with -pthread - Detach the thread to avoid std::thread exception - Remove __RASPBIAN__ check (it's not defined by the on-Pi compiler)
This commit is contained in:
parent
ddbf6b4b22
commit
7c5b84d7ef
4
deps/examples/cpp-multiCameraServer/Makefile
vendored
4
deps/examples/cpp-multiCameraServer/Makefile
vendored
|
@ -12,7 +12,7 @@ clean:
|
||||||
rm ${EXE} *.o
|
rm ${EXE} *.o
|
||||||
|
|
||||||
${EXE}: main.o
|
${EXE}: main.o
|
||||||
${CXX} -o $@ $< -L/usr/local/frc/lib -lcameraserver -lcscore -lntcore -lwpiutil
|
${CXX} -pthread -o $@ $< -L/usr/local/frc/lib -lcameraserver -lcscore -lntcore -lwpiutil
|
||||||
|
|
||||||
.cpp.o:
|
.cpp.o:
|
||||||
${CXX} -O -c -o $@ -I/usr/local/frc/include $<
|
${CXX} -pthread -O -c -o $@ -I/usr/local/frc/include $<
|
||||||
|
|
6
deps/examples/cpp-multiCameraServer/main.cpp
vendored
6
deps/examples/cpp-multiCameraServer/main.cpp
vendored
|
@ -47,11 +47,7 @@
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __RASPBIAN__
|
|
||||||
static const char* configFile = "/boot/frc.json";
|
static const char* configFile = "/boot/frc.json";
|
||||||
#else
|
|
||||||
static const char* configFile = "frc.json";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -216,7 +212,7 @@ int main(int argc, char* argv[]) {
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
runner.RunForever();
|
runner.RunForever();
|
||||||
});
|
}).detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
// loop forever
|
// loop forever
|
||||||
|
|
Loading…
Reference in New Issue
Block a user