Open Kinect - OpenNI, NITE - Compilation issues - kinect

I am busy trying to get the kinect working using Ubuntu 15.10. I have installed Libfreenect, OpenNI, NITE as well as SensorKinect.
I am able to run the programs in the OpenNI/Platform/Linux/Bin/x64-Release/ folder, for example Sample-NiUserTracker... However I have so far been unable to compile any of my own code.
I have tried to compile the examples in the Samples folder, for example SimpleViewer.java but I just get the following error:
SimpleViewerApplication.java:34: error: cannot find symbol
private SimpleViewer viewer;
^
symbol: class SimpleViewer
location: class SimpleViewerApplication
SimpleViewerApplication.java:66: error: cannot find symbol
app.viewer = new SimpleViewer();
^
symbol: class SimpleViewer
location: class SimpleViewerApplication
2 errors
I also tried to compile the C++ programs to no avail. Any suggestions on how to get something to compile would be awesome thanks.

Ok, so unfortunately you cannot just naively compile the example programs directly as they need to be linked with a whole bunch of files. One method of compiling without worrying about creating your own makefiles is to edit one of the existing files and go the OpenNI/Platform/Linux/Build and enter make. This will compile the example programs for you. and you can go to OpenNI/Platform/Linux/Bin/x64-Release and run the compile code.
Something that makes all this easier is to install PyOpenNI. Which enables you to code for the Kinect in glorious Python.
You can see full instructions at my github page https://github.com/RobbieJKatz/Kinect.

Related

undefined symbol: __afl_area_ptr when trying to compile Kisak strike

I want to fuzz the map loading feature in counter strike. The source code for csgo got leaked a while back and here is a build which you can compile https://github.com/SwagSoftware/Kisak-Strike . However, when I try to compile it using this command:
AFL_USE_ASAN=1 PERSIST=1 cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_ROCKETUI=ON -DFREETYPE_LIBRARY=/usr/lib/x86_64-linux-gnu/libfreetype.so -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/freetype/ -DUSE_KISAK_PHYSICS=ON -DCMAKE_C_COMPILER=/home/cyberhacker/Asioita/Hakkerointi/Counterstrikestuff/aflpp/afl-gcc-fastthing/AFLplusplus/afl-gcc-fast -DCMAKE_CXX_COMPILER=/home/cyberhacker/Asioita/Hakkerointi/Counterstrikestuff/aflpp/afl-gcc-fastthing/AFLplusplus/afl-g++-fast ..
and then when i try to run ./csgo_linux64 , it throws this error:
Failed to load the launcher(bin/linux64/launcher_client.so) (/home/cyberhacker/Asioita/Csgocompile/withjump/game/bin/linux64/libtier0_client.so: undefined symbol: __afl_area_ptr)
I am expecting it to just work as usual (same as with the regular build). It works completely fine when I try to compile it normally with this command:
cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_ROCKETUI=ON -DFREETYPE_LIBRARY=/usr/lib/x86_64-linux-gnu/libfreetype.so -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/freetype/ -DUSE_KISAK_PHYSICS=ON -DCMAKE_C_COMPILER=/usr/bin/cc -DCMAKE_CXX_COMPILER=/usr/bin/c++ ..
and then make -j8
I searched a bit and found this: this . In that conversation they say that this error can be cause by compiling with afl-gcc but then linking with normal gcc or ld. However this is not the cause of my problem since I have looked through the cmake log files and the binaries are being linked with afl-g++-fast so this shouldn't be a problem in my case. I read somewhere that the libraries should be statically included, not dynamic but I do not think that it is a necessity. Feel free to look at the Kisak strike source code if you want to (obviously).

When importing Nim module for Lua bindings, error shows: "could not load: lua(|5.1|5.0).dll"

I'm new to the Nim programming language, and coming from a Lua background, it excited me to find out that there is a module for adding Lua bindings to Nim.
I installed Nimble (Nim's package manager) for Windows and executed "nimble install lua" to download and install the correct module. Upon trying to import it and compile the source, this happened:
C:\Users\Ashley\Desktop\Stuff\Coding\Nim\Projects\LuaTest>nim c -r "C:\Users\Ashley\Desktop\Stuff\Coding\Nim\Projects\LuaTest\main.nim"
Hint: system [Processing]
Hint: main [Processing]
Hint: lua [Processing]
CC: main
CC: lua_lua
Hint: [Link]
Hint: operation successful (10698 lines compiled; 1.262 sec total; 16.163MB; Debug Build) [SuccessX]
could not load: lua(|5.1|5.0).dll
Error: execution of an external program failed: 'c:\users\ashley\desktop\stuff\coding\nim\projects\luatest\main.exe '
I have Lua 5.1 already installed with the proper entries in PATH. It's located in Program Files (x86). The directory contains a dll called lua5.1.dll. I tried looking up the error on Google, but there were no results that helped. What could be the problem?
On Windows you can put the library at the same place as the generated binary. In this case the file should be called lua.dll, lua5.1.dll or lua5.0.dll. Also make sure that the library and binary are both for the same system architecture, either x86 (32bit) or x86-64 (64bit).

Cocoapod fails to build on Travis-CI - "expected a type"

Objective: Build a cocoapod with CI support through travis-ci and coveralls.
Sub Objective: Keep git repo cleared of Pods/, while still including Podfile and Podfile.lock
Referenced repo: SRRandomUser
note: while indeed there exists a simple workaround solution (just removing Pod/ from my .gitignore, I ask this question because it will likely be helpful to understand this issue for future work.
Here is the situation I find myself in:
Using FSNetworking for network requests.
One of its classes, FSNData, has a class method withImage:jpegQuality:fileName: that accepts a UIImage and CGFloat as parameters.
Building this file without adding #import for UIKit and CoreGraphics results in a compiler error of expected a type with reference to the UIImage and CGFloat parameters
Locally, this is not a problem because I can add the module #imports, however since I am not committing the entirety of the Pods/ directory, these changes don't get pushed
Travis received the build and attempts to build, but since the FSNData doesn't have CoreGraphics or UIKit imported, when Travis goes to build the project, it throws the error in SRRandomUserGenerator since that class is #importing the affected FSNData class:
✗ Compile SRRandomUserGenerator.m (73 ms)
In file included from /Users/travis/build/spacedrabbit/SRRandomUser/Random Strangers/SRRandomUser/SRRandomUser/SRRandomUserAPIManager.h:10:
In file included from /Users/travis/build/spacedrabbit/SRRandomUser/Random Strangers/SRRandomUser/../../Pods/Headers/Public/FSNetworking/FSNConnection.h:36:
/Users/travis/build/spacedrabbit/SRRandomUser/Random Strangers/SRRandomUser/../../Pods/Headers/Public/FSNetworking/FSNData.h:42:18: error: expected a type
+ (id)withImage:(UIImage*)image jpegQuality:(CGFloat)quality fileName:(NSString*)fileName;
^
/Users/travis/build/spacedrabbit/SRRandomUser/Random Strangers/SRRandomUser/../../Pods/Headers/Public/FSNetworking/FSNData.h:42:46: error: expected a type
+ (id)withImage:(UIImage*)image jpegQuality:(CGFloat)quality fileName: (NSString*)fileName;
^
2 errors generated.
So, my questions are:
How do I either silence that warning so that the build runs anyhow or
How do I get that Pod to include the correct frameworks for building?
Many thanks in advance, SO.
I would recommend trying to search for the framework you need via Cocoapods.org. If you're using Cocoapods it usually means that it's been linked to your project (so there's really no way to silence the error, especially in this case where it seems that the framework you're using depends on other frameworks)

JNI UnsatisfiedLinkError- how do I load libraries correctly?

I'm trying to work with the Java sample Database program from the CardScan SDK.
I am working with files located in Java/JNI and Java/Database. The program must be run with a 32 bit JRE. I was able to do so on a 64 bit machine by uninstalling Java and installing the 32 bit version, then re-adding the system path for Java. I can run the program and interface with a CardScan database file (.cdb) successfully by double clicking the SDKData.bat file, but when I open the source files for editing and edit the Java.library.path to include the required library (CRTK_JNI.dll), I get UnsatisfiedLinkErrors everywhere:
Exception in thread "main" java.lang.UnsatisfiedLinkError: sdkdata.CRTK.CRTK_Init([I)I
at sdkdata.CRTK.CRTK_Init(Native Method)
at sdkdata.CRTK.(CRTK.java:239)
at sdkdata.SDKData.(SDKData.java:97)
at sdkdata.SDKData.main(SDKData.java:643)
Java Result: 1
Presumably this is happening because the library is not loading properly.
What do I need to do to run and edit the program at full capacity (with all the native functions from CRTK_JNI in working order)?
Presumably this is happening because the library is not loading properly.
On the contrary. The library load is complete. You aren't getting that from a System.load()/loadLibrary() call, you are getting the error when calling your native method, the one that should have the signature:
package sdkdata;
public class CRTK
{
public native int CRTK_Init(int[]);
}
So it isn't there, or you have changed the signature without regenerating the .h and .c files, or you have manually mangled the declaration some other way.
Post your code.
To clarify, this Java sample program is officially unsupported by the CardScan API - it was a bad idea to try to use the API with an unsupported language relying solely on an experimental implementation. I ended up using one of the supported languages (Visual Basic) to work with the SDK; if anyone looking at this question happens to be struggling with using the CardScan API, here is my VB implementation on Github.

Not getting TBB to compile test examples

I am not getting TBB to work. I am following the steps in the "Getting started" document.
I am doing the following steps:
downloading the linux files + the sources files.
extracting them in 1 directory
calling make
going to tbb.../bin calling source tbbvars.sh intel64
going to examples/Getting_started/sub_string_finder
calling make
I then get the error:
sub_string_finder.cpp:32:30: fatal error: tbb/parallel_for.h: No such file or directory
I really googled a lot but can't find any related stuff.
I did also try to add some -I statement but it didnt help
I assume it is kind of a including/linking problem but I dont know how to fix.
This is all done on fedora 16 64bit. (kernel 3.1.4) // TBB version 4.0
The solution was to install tbb-devel package.