Coder Social home page Coder Social logo

Comments (4)

zarvox avatar zarvox commented on July 2, 2024

Github's Markdown processor appears to have eaten important relevant details from your bug report, but I'm guessing that you wanted the include to read:

#include <libfreenect/libfreenect.h>

or

#include "libfreenect.h"

One alternative solution would be to add

-I/usr/local/include/libfreenect
to your compiler include path, but I'm not sure which approach is considered best practice. I think we'd have to restructure our git tree to accomplish the first suggestion, the second one seems less correct, and I'm somewhat used to doing the third, but it could be considered incorrect form for a library...not sure what the right thing to do here is. :/

Also, sorry for the ridiculously latent reply.

from libfreenect.

bayanaa avatar bayanaa commented on July 2, 2024

Hello ,
I have some quistions and problems.
when I compile freenect and opencv in code blocks on ubuntu.
there was an error :freenect_sync_get_rgb was not declared in this scope.
when I see libfreenect_sync.h there is not freenect_sync_get_rgb function.
here is the code :
#include <opencv/highgui.h>
#include <libfreenect/libfreenect_sync.h>

freenect_context *f_ctx;
freenect_device *f_dev;

int main(int argc, char *_argv)
{
IplImage *image = cvCreateImageHeader(cvSize(640,480), 8, 3);
while (cvWaitKey(10) < 0) {
char *data;
unsigned int timestamp;
freenect_sync_get_rgb(&data, &timestamp);
cvSetData(image, data, 640_3);
cvCvtColor(image, image, CV_RGB2BGR);
cvShowImage("RGB", image);
free(data);
}
}

from libfreenect.

nh2 avatar nh2 commented on July 2, 2024

Hey,

yes, I think something is wrong here.

libfreenect installs its files into $PREFIX/include/libfreenect/libfreenect.h, so in a libfreenect/ subdirectory in the include path. That usually suggest to people that they should use #include <libfreenect/libfreenect.h> instead of #include <freenect.h> in their source code, but libfreenect_sync.h itself uses #include <libfreenect.h> which means you have to mess around with include path flags a lot in order to get things compiling (especially bindings from other languages).

It would be nice if libfreenect could pick one of the two ways and consistently follow it (personally I believe that the current structure looks good and that libfreenect_sync.h should be changed to #include <libfreenect.h>).

What do you think?

from libfreenect.

piedar avatar piedar commented on July 2, 2024

7b9a5de introduces the following changes:

  • All headers (including libfreenect.hpp) are installed to $PREFIX/include/libfreenect/.
  • All libfreenect files have #include "libfreenect.h" rather than #include <libfreenect.h>. This works during build and after installation all include files are in the same directory.
  • Rename libfreenect-audio.h -> libfreenect_audio.h and libfreenect-registration.h -> libfreenect_registration.h. This makes them consistent with other libraries.

THIS IS A BREAKING CHANGE; UPDATE YOUR INCLUDES

from libfreenect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.