Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Newbie -- can't add file to C/C++ project
Newbie -- can't add file to C/C++ project [message #217713] Mon, 23 June 2008 18:01 Go to next message
Eclipse UserFriend
Originally posted by: rball.zilog.com

I'm an Eclipse newbie, with what I assume is a very basic question. I've
inherited an Eclipse C/C++ project and would like to add a new source code
file. I used File > New > Source File and File > New > Header File to
create new files LCD_Draw.h and LCD_Draw.c. After typing code into those
files, I saved them and the asterisk went away; they are both listed in
the Project view for this project, and *seem* to be "in" the project now.
But when I try to call a function WriteDemoText() which is defined in
these files from inside main.c, I get the error message:

/cygdrive/c/Program Files/ZiLOG/BSP_2.0.0/No_OS_Test/main.c:165: undefined
reference to `WriteDemoText'

Also, there's no object file LCD_Draw.o created by the build, and when I
look at the makefile, there is no entry for how to build such an object
file, nor is it listed among the OBJECTS in the makefile.

Having inherited this project, I'm not sure if it's a "Managed Make" or
"Standard" project. I've been assuming the former since Project >
Properties . Builders indicates CDT Makefile Builder as one of the
Builders. I assume that means that the makefile is auto-generated by the
CDT Makefile Builder, but I could be wrong.

My questions, then, are: how can I tell if this project is a Managed Make
project or a Standard project? If it is a Managed Make project in which
the makefile is auto-generated, what do I have to do to get this new
module added to the list of things that must be made when the project is
built?

Thanks,

Roger
Re: Newbie -- can't add file to C/C++ project [message #217723 is a reply to message #217713] Tue, 24 June 2008 09:03 Go to previous messageGo to next message
Eclipse UserFriend
Because you added the new file the correct way, I assume your project is
not a managed one. Otherwize it would have found it. Please check as
follows:
Right-click on your project and select properties.
In the property window click on C/C++ Build and now in the register
"Builder Settings" you should see a checkbox labeled "Gernate Makefiles
Automatically". I assume in your case, the box will be unchecked. Leave it
this way and edit your Makefile accordingly.

Regards from yet another newbie Robert
Re: Newbie -- can't add file to C/C++ project [message #217746 is a reply to message #217723] Tue, 24 June 2008 14:40 Go to previous message
Eclipse UserFriend
Originally posted by: rball.zilog.com

Hi Robert,

Thanks for your message. Yes, I think you are right; I had concluded from
a couple of other indications that this project doesn't do automated
makefile generation. However, I don't quite see the interface that you're
describing. When I go to Project > Properties, I don't have a selection
called "C/C++ Build". I do have one called "Builders", which includes an
item "CDT Makefile Builder", which IS checked; that's what made me
originally think this was an automatic-makefile project. Then there's
another screen called "C/C++ Make Project", but there's nothing there so
straightforward as a check box for "generate makefile automatically".

I'm running Eclipse version 3.3.2, build M20080221-1800. Is this a
different version from yours?

Thanks,

Roger
Previous Topic:Search fields
Next Topic:how to get the *.o files to a separate folder?
Goto Forum:
  


Current Time: Tue Jun 03 07:44:18 EDT 2025

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

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

Back to the top