obviousjim / ofxOculusDK2

OculusDK2 repository
Other
47 stars 31 forks source link

On Mac example compiles fine, but in project generated by open frameworks Project Generator, there are errors #6

Open ghost opened 9 years ago

ghost commented 9 years ago

When I first install the library and then generate a project using the standard OFX project generator with it, compiler generates the error:

Unknown Type Name ID3D1xDevice

If I then compile the example project-- the example project will compile fine and work great, but then attempt to create a new project with the library and compile I get:

define OVR_D3D_VERSION to 10 or 11

followed by:

Lexical or Preprocessor Issue: 'd3compiler.h' file not found. 

So, the error seems to be in the xcode file config... but I'm not sure where. Any thoughts?

Thanks for the awesome library!

Mac OS X Yosemite, OF 8.4, XCode 6.1

mattebb commented 9 years ago

Hi, for now you might want to try my fork, which is working on Mac https://github.com/mattebb/ofxOculusDK2 Haven't had a chance to clean it up and merge our repos yet, hopefully will get around to it soon.

mattebb commented 9 years ago

The other thing too is that when using the project generator, it doesn't set up the correct include and library paths to the oculus sdk. You can add these yourself in the Xcode config but it would be nice in the future to try and get things a bit more automatic too.

ghost commented 9 years ago

Thanks! I've gotten a little further. I've removed everything except ofxOculudDK2.cpp.

Now the library compiles when I include

 #include "ofxOculusDK2.h"

(which is further than before), but as soon as I instantiate a oculus with:

    ofxOculusDK2        oculusRift;

I get:

 Undefined symbols for architecture i386:
   "_ovrHmd_Destroy", referenced from:
       ofxOculusDK2::~ofxOculusDK2() in ofxOculusDK2.o
    "_ovr_Shutdown", referenced from:
        ofxOculusDK2::~ofxOculusDK2() in ofxOculusDK2.o
   "OVR::Util::Render::StereoConfig::StereoConfig(OVR::Util::Render::StereoConfig::StereoMode)",    referenced from:
       ofxOculusDK2::ofxOculusDK2() in ofxOculusDK2.o
 ld: symbol(s) not found for architecture i386
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've played with other compile settings.... can't seem to find a solution to this.

Thanks for your help!

aferriss commented 9 years ago

I was having the same problem, the example worked fine but using the addon with a new project was not getting all the oculus files. I was importing the addon with adamsyn's xcode plugin fwiw (https://github.com/admsyn/OFPlugin).

I added this to the project.xconfig and it seems to work now.

///////////////////////////////////////////
// ADDONS

// path to the addons dir
ADDONS_PATH = $(OF_PATH)/addons

// ofxOculusRift
OFX_OCULUSRIFT_HEADERS = $(ADDONS_PATH)/ofxOculusDK2/src $(ADDONS_PATH)/ofxOculusDK2/libs/LibOVR/Include $(ADDONS_PATH)/ofxOculusDK2/libs/LibOVR/Src

OFX_OCULUSRIFT_LIBS = "$(ADDONS_PATH)/ofxOculusDK2/libs/LibOVR/Lib/MacOS/Release/libovr.a"

// all addons
OF_ADDON_HEADERS = $(OFX_OCULUSRIFT_HEADERS)
OF_ADDON_LIBS = $(OFX_OCULUSRIFT_LIBS)

///////////////////////////////////////////
garrettburnett commented 8 years ago

Hi, I still get a significant amount of errors when attempting to compile. Even with the above fix ^

aferriss commented 8 years ago

@garrettburnett what kind of errors? What is your os and version of oF?

garrettburnett commented 8 years ago

Hi I'm on OS 10.11, Version .8.4 of OS.

The library works fine when I am using the example, but I get loads of "file not found errors"

This is what my Project.config looks like right now:

//THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED OF_PATH = ../../..

//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE

include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"

//ICONS - NEW IN 0072 ICON_NAME_DEBUG = icon-debug.icns ICON_NAME_RELEASE = icon.icns ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/

//IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: //ICON_FILE_PATH = bin/data/

HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) $(OF_ADDON_HEADERS) OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_ADDON_LIBS)

/////////////////////////////////////////// // ADDONS

// path to the addons dir ADDONS_PATH = $(OF_PATH)/addons

// ofxOculusRift OFX_OCULUSRIFT_HEADERS = $(ADDONS_PATH)/ofxOculusDK2/src $(ADDONS_PATH)/ofxOculusDK2/libs/LibOVR/Include $(ADDONS_PATH)/ofxOculusDK2/libs/LibOVR/Src

OFX_OCULUSRIFT_LIBS = "$(ADDONS_PATH)/ofxOculusDK2/libs/LibOVR/Lib/MacOS/Release/libovr.a"

// all addons OF_ADDON_HEADERS = $(OFX_OCULUSRIFT_HEADERS) OF_ADDON_LIBS = $(OFX_OCULUSRIFT_LIBS)

garrettburnett commented 8 years ago

@aferriss I'm also adding the library using adamsyn's OF plugin