So I'm trying to build this simple (incomplete) C program in Visual Studio Express 2013 and I get the linker error "unresolved external symbol _strtok referenced in _split".
This confuses me since I was pretty sure my string.h include would include a strtok definition?
#define _CRT_SECURE_NO_WARNINGS
#include <string.h>
#include "parser.h"
char split (char *str[]) {
char delimiter[] = " ";
char *result;
char strArray[10];
int count = 0;
result = srtok(str, delimiter);
while (result) {
strcpy(strArray[count++], result);
//result = strtok(0, delimiter);
}
return strArray;
}
void *parse (char *cmdline) {
char *commands = split(*cmdline);
printf("%s\n", commands[0]);
}
Any ideas? Thanks.