0

I am developing an Oculus project based on this framework: https://github.com/OculusRiftInAction/OculusRiftInAction

I added the wiiuse library from rpavlik to it. https://github.com/rpavlik/wiiuse

In both projects exists a file called "IO.h". After generating an XCode project with CMake I get an error within the OculusRiftInAction Code in File "opengl/Font.cpp". It pulls in the "IO.h" file but it's the one from the wiiuse library. I cant figure out how to pull in the "IO.h" file from the original location in OculusRiftInAction framework.

I suspect it's a general CMake or XCode question. Does anyone know this?

FIXED:

I made the wiiuse library static which somehow fixed the issue. But I dont know why it fixed it. I can still use the library, but it doesnt override the IO.h file in the main code anymore.

hottehead
  • 43
  • 7

1 Answers1

4

Don't place third party library headers directly in your compiler's header search path. Put them behind a directory that indicates the library they are from. For example, the wiiuse headers should probably be in a directory called wiiuse, and that directory should be in the search path. So in order to include the "IO.h" header from it, you would need to do this:

#include <wiiuse/IO.h>

If you don't know how to muck about with the search paths using XCode, neither do I. But perhaps this question will help you.

Community
  • 1
  • 1
Benjamin Lindley
  • 101,917
  • 9
  • 204
  • 274
  • They are already in a seperate folder and this folder is in the include path. I solved the issue by making the wiiuse library static. – hottehead Jan 25 '15 at 15:36
  • ***and this folder is in the include path.*** That was the problem @BenjaminLindley was showing you how to fix. ***I solved the issue by making the wiiuse library static.*** This does not really make sense. I mean making a library static versus dynamic should not change how files are included. – drescherjm Jan 26 '15 at 14:14
  • Yes it doesnt make sense, I know. I looked into it again and I made a mistake which made it work. It's complicated ... Bottom line: The library type has nothing to do with it. Your solution is totally right. I now included only the wiiuse folder so that I have to prefix my includes like Benjamin said. – hottehead Jan 26 '15 at 16:48