Need help converting a makefile into a gyp file (raspberry pi camera)

110 views
Skip to first unread message

Gagle

unread,
May 9, 2014, 6:40:49 AM5/9/14
to nod...@googlegroups.com
My knowledge in compiling things in C/C++ is quite limited but I've managed to write a makefile with all the flags needed to compile a C library for the raspberry pi camera. Link to the repository: omxcam

A little spam:

omxcam is a promising C library for controlling the raspberry pi camera. It communicates directly with OpenMAX and as far as I know it's the first library that does this because it's very hard to write OpenMAX code: there are a few examples on the internet and even the core maintainers (the people that write the camera driver) need to help you. I've spent over 3 months to understand how OpenMAX works and write a multithreaded C lib. I still need to do lots of things but now I want to write the bindings to the nodejs code for having a functional example that streams h264 video and jpeg images. Link to the nodejs repository: omxcam

nodejs + raspberrypi + omxcam, the perfect union of the 2 most popular technologies, but I need help. I'm struggling to write the gyp file but I'm not getting the desired result. The makefile is the following: makefile. There first two variables let you configure the makefile:

APP: Name of the binary file
OMXCAM_HOME: Root directory of the library

Then, the most important thing is the last flag of the INCLUDES variable:

-I./$(OMXCAM_SRC_DIR)

It allows you to include the omxcam header without specifying a weird path relative from who-knows:

#include "omxcam.h"

This is the gyp file: gyp file. The omxcam source files are compiled without error but then when I include the omxcam.h file in the nodejs binding it says that the file doesn't exist, so presumably I'm doing something wrong. I appreciate any help.

I can upload the generated files if you need to see them.

Thanks

Kevin Ingwersen

unread,
May 9, 2014, 11:16:27 AM5/9/14
to nod...@googlegroups.com
Hey!

In a target, you may also specify the key include_dirs. Its a list. So just look at the example here: https://github.com/Deskshell-Core/node-ph7/blob/master/src/binding.gyp
Maybe it helps. :)


--
"Yo Dawg, I heard you like C++, so I  added C++ to your build system, so you have to compile before you compile.“ -StackOverflow, Matt Joiner ( http://stackoverflow.com/a/5025525/2423150 )

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/0dbbda14-446b-4fba-8f3d-ce149433b376%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gagle

unread,
May 9, 2014, 3:33:21 PM5/9/14
to nod...@googlegroups.com, ingwi...@googlemail.com
This is actually what I'm doing, but the path of the header files are not resolved correctly.

Gagle

unread,
May 12, 2014, 11:54:55 AM5/12/14
to nod...@googlegroups.com, ingwi...@googlemail.com
ok, fixed... gyp is very weird, I don't know why but I've put the directory includes inside a direct_dependent_settings property and now it compiles.

Kevin Ingwersen

unread,
May 12, 2014, 11:59:25 AM5/12/14
to Gagle, nod...@googlegroups.com
Yeah…GYP is weird like that. I am actually working on a replacement for this thing x)



--
"Yo Dawg, I heard you like C++, so I  added C++ to your build system, so you have to compile before you compile.“ -StackOverflow, Matt Joiner ( http://stackoverflow.com/a/5025525/2423150 )

Gagle

unread,
May 13, 2014, 3:23:39 AM5/13/14
to nod...@googlegroups.com, Gagle, ingwi...@googlemail.com
Well, it compiles but now I get a runtime error:

node: symbol lookup error: /home/pi/node-omxcam/build/Release/addon.node: undefined symbol: _Z24OMXCAM_initVideoSettingsP21OMXCAM_VIDEO_SETTINGS

Funny.


Gagle

unread,
May 13, 2014, 3:40:35 AM5/13/14
to nod...@googlegroups.com, Gagle, ingwi...@googlemail.com
mmm, ok, it seems that it's something related with the name mangling and extern "C".
Reply all
Reply to author
Forward
0 new messages