Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » C files being ignored?(C files present in source, but not included in compile.)
C files being ignored? [message #1290689] Thu, 10 April 2014 10:44 Go to next message
Kenny Spider is currently offline Kenny SpiderFriend
Messages: 1
Registered: April 2014
Junior Member
I have a C project in eclipse using the GNU build tools.
It started with a single .c file and I want to add another c/h file pair to keep parts of the code in separate files. Pretty normal stuff.

I have added a new .c file and .h file using the "file / new / Source File" and "file / New / Header" file menus.
I have populated the files as usual.

I have #included the new header file in the main C file.

The contents of the header are processed, I know because some of my #DEFINEs are present.
But the implementation of the functions in the new C files are not found.

When I build I get:
/home/user/workspace/mercury/src/mercury.c:70: undefined reference to `becomeDaemon'

But the method 'becomeDaemon' is correctly define in the new .h file, and correctly implemented in the new .c file.

Further, I can put any syntax errors I wish in the new .c file and they are ignored, and do not flag as errors.

So it looks like the build tools are ignoring my new source file?

How do I tell the build tools to include the new source file?
I have attached a screen shot of Eclipse, showing the original source, the new files and the errors.

Any suggestions?

Re: C files being ignored? [message #1324383 is a reply to message #1290689] Wed, 30 April 2014 19:12 Go to previous message
Programmist Setevik is currently offline Programmist SetevikFriend
Messages: 12
Registered: January 2013
Junior Member
I suggest you convert the project to use a Makefile. It is much easier to control Makefile project - you have full control, you can define dependencies, configure steps to perform (aka Makefile targets) etc.

You'd need to add a simple Makefile to the source directory and make sure you can perform a build by running "make". Then you can import your source tree into Eclipse as "File -> new project with existing makefile".
Previous Topic:Help with makefile
Next Topic:use g++ instead of clang on Mac osx mavericks
Goto Forum:
  


Current Time: Fri Apr 19 19:36:12 GMT 2024

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

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

Back to the top