Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Eclipse Managed make C++ Project includes .c files
Eclipse Managed make C++ Project includes .c files [message #172479] Mon, 25 September 2006 19:45
Eclipse UserFriend
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
Previous Topic:Mac OS X Tiger (ppc) v3.[1,2,3] won't start!
Next Topic:Tomcat "Missing Its Runtime"
Goto Forum:
  


Current Time: Sat Apr 20 03:23:28 GMT 2024

Powered by FUDForum. Page generated in 0.08085 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top