I am using Xcode on a mac osx with c++ and std project, I get the following error when I try to compile
Build OpenCLCpp of project OpenCLCpp with configuration Debug
Ld build/Debug/OpenCLCpp normal x86_64
cd /Users/mohammadjeragh/Documents/MyResearch/OpenCLCpp
setenv MACOSX_DEPLOYMENT_TARGET 10.6
/Developer/usr/bin/g++-4.2 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -L/Users/mohammadjeragh/Documents/MyResearch/OpenCLCpp/build/Debug -F/Users/mohammadjeragh/Documents/MyResearch/OpenCLCpp/build/Debug -filelist /Users/mohammadjeragh/Documents/MyResearch/OpenCLCpp/build/OpenCLCpp.build/Debug/OpenCLCpp.build/Objects-normal/x86_64/OpenCLCpp.LinkFileList -mmacosx-version-min=10.6 -framework OpenCL -o /Users/mohammadjeragh/Documents/MyResearch/OpenCLCpp/build/Debug/OpenCLCpp
Undefined symbols:
"sum(int, int)", referenced from:
_main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
here are my 4 files
/*
* function.h
* OpenCLCpp
*
* Created by Mohammad Jeragh on 7/18/10.
* Copyright 2010 KU. All rights reserved.
*
*/
int sum(int,int);
/*
* function.c
* OpenCLCpp
*
* Created by Mohammad Jeragh on 7/18/10.
* Copyright 2010 KU. All rights reserved.
*
*/
#include "function.h"
int sum(int a, int b){
return a + b;
}
#include <iostream>
#include "function.h"
int main (int argc, char **argv) {
// insert code here...
std::cout << "Hello, World!\n";
sum(3, 4);
return 0;
}
Please Help