Hi All!
I'm loosing my mind here. I'm trying Codewarrior 10, and I can't get a project to build. Firts, I try importing a project and I could not achieve that because of an error on a Toolchain Target wich I cannot solve. So I decide to create a new one using the existing files.
To my surprise I could link some existing folders to the project and all the files inside it would be built on my new project. The folder contains .c and .h files.
When I build the application, the compiler says that EVERY macro definition is "unndefined". I don't know what to do... The definitions exists since those same files compile with older versions of Codewarrior.
It's necesary to separate CODE files from HEADERS files? I mean using Source folder for .c files and Project Headers for .h files.... I try that and didn't work neither.
I totally don't understand this new interface.... I also looked for "Link Order" tab and couldn't find it.
Please help!
Well I did some test and get a simple project to compile, and now I've got a new question.
With older codewarrior versions, I added the files to the project, check the target wich I want to compile them.
Let's assume I've got 3 files:
SEBAS.c
SEBAS.h
main.c
in SEBAS.c, I declare a function:
void my_func (void){
.....CODE.....
}
in SEBAS.h
extern void my_func (void);
then in main.c I call my_func, then when I build the project, it says that my_func has no prototype.
The 3 files has the BUILD tab checked. This work fine with older codewarrior versions.
Now, in order for the build to work, I need to #include SEBAS.h in main.c file... Do I always need to do that for EVERY archive I want to add to my project? Why doesn't the checked-BUILD tab do that?
Hi CrasyCat, thanks for your reply. Yesterday, after posting I found those videos you mentioned, I couldn't watch them yet.
One more question eme... When creating a new fodler, There's the option to "link" a folder to the project, what's the difference with adding a folder without the link option checked?
One more thing, that maybe is the answer to the question above. I'm used to work this way: I've got a GENERIC folder with generic files containing generic routins, for example GENERIC_SCI.c conitaning basic routins such as putting a byte into a buffer (for receiving), extracting a byte from a buffer (for transmitting). Then I also have a project folder PROYECT1. Inside it, inside Source folder I've got main.c wich calls functions from the GENERIC files in Generic folder. So this way I used and UNIQUE file to receive/transmit data in several projects. If I modify a generic file, then ALL the projects can "see" this change.
The folder tree would be:
+---- GENERIC
| +-------------- GENERIC_SCI.c
| +-------------- GENERIC_SCI.h
|
|
+---- PROJECT_1
| +-------------- Source
| +---------- main.c (call functions from GENERIC_SCI.c)
|
+---- PROJECT_2
+-------------- Source
+---------- main.c (call functions from GENERIC_SCI.c)
So my question is how do I do what I want to do? I mean, PROJECT_1 and PROJECT_2 share GENERIC_SCI.c and .h
1) Should I use the #include instruction for both .c and .h?
2) What happend if I use the link option when creating a new fodler? What about the check-option in the BUILD tab?
I repeat, I could watch the videos yet... I'll do that in a moment
Thanks!
Hello
One more question eme... When creating a new folder, There's the option to "link" a folder to the project, what's the difference with adding a folder without the link option checked?
This is a standard Eclipse feature. You may find information on this feature on the Internet.
Basically, all sub-directories which are physically located under the project directory tree on your disk are automatically added as folder to your project.
Any source file you would add in any of the project sub-directories will be automatically added to the project.
You can add a linked folder if you want to add files located outside of the project directory tree to your project.
A linked folder is a virtual folder, where you can add source files from various location. It is not directly linked to directory physically present on your disk.
If you want to add a new file in a Linked folder, you have to use the menu entry Add File.
As for include file you do not need to add the .h file to the project but you need to add the path to the .h file to the compiler settings panel.
In your case "${ProjDirPath}/../GENERIC".
CrasyCat
Thanks again for your reply!
Well, I finally understand how the process work... With #include and also with the Build Tab checked. And the need of including the header path in the Compiler Settings.
I look for information about the linked folder and Eclipse, but I did not understand how it works.
I mean, Why would I what to use a linked folder?
If you could answer that, it would be great! Thanks!
Hello
In my understanding a linked folder is just a container, where you can add files located in various location on your hard disk.
The files includes in the linked folder will be part of the project (i.e. they will be compiled when you perform a "Build Project", A linked folder only includes the files which have explicitly been added to the folder. They do not directly display the content of any directory on your system.
Main differences between linked folders and regular folders are:
1- New files added to a directory associated with a regular folder will be automatically added to the project
(after a Refresh). In a linked folder, the new files will not be added.
2- If you select a file from a regular folder and select Delete, the file will be removed from the project and will
be deleted from your hard disk. Deleting a file in a linked folder will only remove the file from the project.
File will not be deleted from your computer.
3- If you have sub directories in a regular folders, you will see the same directory tree physically on your hard drive.
A linked folder is just a container. Any folder hierarchy defined in there will not be linked to any physical directory
tree on your system.
CrasyCat
Thanks CrasyCat, now I've got a more clear idea about linked folder. My question began, becuase I've got a soruce (.c) file in a folder I linked, and I've checked the BUILD tab in the "workspace inspector" and when I build the application and ERROR appears. Something like:
***make[<path of linked file.obj>]Error1
And I've got not idea of what is that. Then I UNchek the BUILD tab, and include the file in main.c and have no problem... But I still got no idea of what's going on
Well after viewing all the videos, my questions reminds...