naychrist / ofxLibArtnet

OF wrapper for libartnet
13 stars 6 forks source link

Support for linux #1

Closed sphaero closed 12 years ago

sphaero commented 12 years ago

Hi, I've just been going through your addon on linux. I couldn't get it to work out of the box. However once I downloaded libartnet from the googlecode site and compiled as a static lib it did work. It seems to need some config options I haven't figured out yet.

So it works on linux however your approach of including the source directly doesn't. I haven't found out why yet. Probably some compile option. Do you have any suggestion?

naychrist commented 12 years ago

Afraid I don't have any experience with OF on linux. Were you getting linker errors? There is another wrapper for libartnet called ofxArtnet where they have edited the include paths in the libartnet header files and file locations so that there were no subfolders used to simplify project settings. Does this work for you? If so, then it should be a matter of tweaking the header search paths and making sure they are recursive I think.

sphaero commented 12 years ago

No linker errors. It just compiles fine but just doesn't do anything except complain it can't find the ipaddress. I've tracked it down to the function which searches for interfaces. It always returns an empty list. But it seems to be caused by not setting the config.h right. I've tried to copy over the config.h from my own libartnet and setting the HAVE_CONFIG_H flag but to no avail.

So the only workable solution for me now is to change the addon to use a static lib instead of the source directly. This shouldn't be necessary however.

I've also tried ofxArtnet but that one didn't even compile.

sphaero commented 12 years ago

Hey I've managed to get it to work. I just added a preprocessor condition to check for the target and set diffent things in config.h. The problems I had seems to be some issue in the develop branch of OF. http://forum.openframeworks.cc/index.php/topic,10660.0.html

If you check my fork you can see how easy it is to get linux supported.

naychrist commented 12 years ago

That's great. Will definitely work it in next week.

naychrist commented 12 years ago

hi sphaero, I really don't want to edit any of the original libartnet files to keep maintenance simple. Maybe we could have a separate config file for linux and then the top of ofxLibArtnet.h could look something like below. Would you be able to try this for me? I have no linux box to do this myself.

pragma once

if TARGET_LINUX

include "config_linux.h"

undef HAVE_CONFIG_H

endif

include "ofMain.h"

include "artnet.h"

include "packets.h"

sphaero commented 12 years ago

Hi, the config.h is not an original file. It is generated by a configure script when issued in the original libartnet. I wouldn't mind you're approach but I would create a config_osx.h and config_linux.h so you don't need to touch the orginals at all.

Then again you could just set all the vars of config.h in the ofxLibartnet.h directly and skip inclusion of config.h totally...

On 09/12/2012 02:29 AM, naychrist wrote:

hi sphaero, I really don't want to edit any of the original libartnet files to keep maintenance simple. Maybe we could have a separate config file for linux and then the top of ofxLibArtnet.h could look something like below. Would you be able to try this for me? I have no linux box to do this myself.

pragma once

if TARGET_LINUX

include "config_linux.h"

undef HAVE_CONFIG_H

endif

include "ofMain.h"

include "artnet.h"

include "packets.h"

— Reply to this email directly or view it on GitHub https://github.com/naychrist/ofxLibArtnet/issues/1#issuecomment-8477524.

naychrist commented 12 years ago

good point. edited config.h as per yours although had to make it an if/else as xcode wasn't picking up on TARGET_OSX - I assume you weren't defining TARGET_LINUX yourself somewhere. Marking issue as closed but let me know if any issues.