Results 1 to 4 of 4

Thread: #include problems in Apple's implementation

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    4

    #include problems in Apple's implementation

    I'm using the preprocessor macro #include in an OpenCL file.
    However, the compiler tells me that it cannot find the file during compile.
    Does anyone know if it is specified where the compiler should go looking for included files?

    The default behavior would be preferred, s.t. if I use
    #include "file"
    with quotes, it searches the same directory as the source file I'm compiling.
    Now I have no clue where it tries to locate the file....
    Any ideas?

    I'm using
    xcode 3.2.1 on snow leopard(obviously)

    Regards
    /Patrik

  2. #2
    Senior Member
    Join Date
    Jul 2009
    Location
    Northern Europe
    Posts
    311

    Re: #include problems in Apple's implementation

    I've had problems with this in the past where it looks for the file in the same directory as the executable, but when you're building with Xcode it usually puts that in a "debug" folder somewhere other than where your source code is located. Try copying the file you want to include to the same directory as the binary or changing the working directory for the executable and see if that helps. If it does you can add a copy phase to your build in Xcode to copy the file into the appropriate directory. If it doesn't, then I'm not sure where it is looking. You can always use fs_usage to monitor the process and see what it's trying to open.

  3. #3
    Junior Member
    Join Date
    Oct 2009
    Posts
    4

    Re: #include problems in Apple's implementation

    Thanks for your reply dbs2.
    I have tried both having the file in the source directory and having it copied to the executable directory, where the run-time looks for the .cl file to compile(as you proposed). Neither work.
    I might have to do some spying with fs_usage then...

    /patekd

  4. #4
    Senior Member
    Join Date
    Jul 2009
    Location
    Northern Europe
    Posts
    311

    Re: #include problems in Apple's implementation

    The only other thing I can think of is to make sure that you aren't having issues with a case-sensitive/insensitive filesystem. I believe OS X is by default case insensitive, but that can cause problems. (e.g., #include "OpenCL.h" vs. #include "opencl.h")

Similar Threads

  1. Replies: 1
    Last Post: 07-29-2012, 10:56 AM
  2. Port of Apple demos to Windows..
    By oscarbg in forum OpenCL
    Replies: 0
    Last Post: 11-04-2009, 05:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •