質問

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?

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top