Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libfreenect_sync.h has broken includes #210

Closed
ccouzens opened this issue Mar 22, 2011 · 4 comments
Closed

libfreenect_sync.h has broken includes #210

ccouzens opened this issue Mar 22, 2011 · 4 comments
Milestone

Comments

@ccouzens
Copy link

On my Ubuntu system, the c headers are installed here:

/usr/local/include/libfreenect/libfreenect.h

/usr/local/include/libfreenect/libfreenect_sync.h

Including libfreenect_sync.h gives the following error:

/usr/local/include/libfreenect/libfreenect_sync.h:29:25: fatal error: libfreenect.h: No such file or directory

This is because libfreenect_sync.h has:

#include <libfreenect.h>

this should be:

#include <libfreenect/libfreenect.h>

or:

#include "libfreenect.h"

(I'm not sure which of the 2 would be best c practice)

@zarvox
Copy link
Member

zarvox commented May 3, 2011

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.

@bayanaa
Copy link

bayanaa commented Nov 23, 2011

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);
}
}

@nh2
Copy link

nh2 commented Dec 14, 2013

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?

@piedar piedar modified the milestones: v0.4.0, v0.3.1 Feb 3, 2014
@piedar
Copy link
Contributor

piedar commented Feb 15, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants