2

I am attempting to include a Spotify player (to play a playlist) as part of my app.

I have imported and successfully linked cocoalibspotify and it compiles fine, but as soon as I do the line

#include "appkey.c"

I get the compiler error

'appkey.c' file not found

My .c file is 'checked' under target membership for my target, I obtained it from the spotify developer area and 'right click save target as' to create the file.

The contents of the file looks like this (contents of the const omitted for obvious reasons)

#include <stdint.h>
#include <stdlib.h>
const uint8_t g_appkey[] = {
    0x01, .... etc etc etc
};
const size_t g_appkey_size = sizeof(g_appkey);

I've never used .c files before in xcode, only .h and .m files. Is there something special I have to do to compile with .c files?

Bongeh
  • 2,300
  • 2
  • 18
  • 30

1 Answers1

3

You don't need to actually add the file to Xcode. Remove it from your project and make sure it's in the same folder as the .m file you're including it from and you'll be set.

iKenndac
  • 18,730
  • 3
  • 35
  • 51
  • Amazing!, Thank you. I'm not sure how obvious this is to the average xcode user, it might be worth putting a note in the read me (unless its just incredibly stupid and I'm a dunce haha) – Bongeh Sep 11 '13 at 16:24
  • Nice Job @iKenndac but it's spotifyLib hard to understand its sdk or it's stucture. In to the documentation there is no any clear info regarding its different- different function or feature.I study this from morning and having no any help with that documentation. :( – Nitin Gohel Jan 12 '14 at 13:28