Eclipse Managed make C++ Project includes .c files [message #172479] |
Mon, 25 September 2006 19:45 |
Eclipse User |
|
|
|
Originally posted by: lakhsri.gmail.com
Hi
I am new to Eclipse Environment. I greatly appreciate your help on this.
I created a managed C++ Project and added a new .c file in the project. In
the main.cpp, I am trying to include the .c file using the extern "C". The
project seems to be not recognizing the .c file.
In project properties, I added .c files in the C/C++ file Types, it still
is not able to run.
Here's the main.cpp
#include <iostream.h>
#include "CbHolder.h"
extern "C"
{
#include "TestCFile.h"
}
int main()
{
std::cout<< "Integration" <<std::endl;
RegisterFunc(&funcTest, 10);
return 0;
}
Here's the .c file:
h:
#ifndef TESTCFILE_H
#define TESTCFILE_H
typedef void (*cbFuncPtr) (int arg);
void RegisterFunc(cbFuncPtr cbFunc, int data);
#endif
c:
#include "TestCFile.h"
void RegisterFunc(cbFuncPtr cbFunc, int data)
{
cbFunc(data);
}
CbHolder cpp file:
h:
void funcTest(int data);
cpp:
#include "CbHolder.h"
#include <iostream.h>
void funcTest(int data)
{
std::cout<<"FuncTest Data Callback "<< data;
}
Sri
|
|
|
Powered by
FUDForum. Page generated in 0.08085 seconds