Include Directories

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Include Directories

1,608件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rtos on Sun Jun 27 12:23:05 MST 2010
In LPCXpresso IDE how do you tell a project to look for .h and .c files in a certain specific directory?  I want to put all of my driver .h and .c files in a directory called "drivers".

Thanks.
0 件の賞賛
返信
9 返答(返信)

1,585件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Sat Jul 24 00:54:50 MST 2010
The correct answer to all these question should be RTFM (Read The Fancy Manual) but I found this a challenging task :eek:. We've got all these tools glued together; Eclipse, a build manager, a debugger, the GCC compiler/linker and who knows what else.

Where do you look for the proper documentation ???

What rtos want is in fact to create a static library with the drivers and add this library to his application. There are a few easy steps how to do this:

[LIST=1]
[*]Create a static library with the drivers (use the "Create C static library project" from the "Project and File wizards") and add your C driver files to this.
That is the easiest way to start your driver library
[*]Add the include directory of the driver (project) to your application.
this makes the .h files visible during compilation.
[*]Add the library to your application (you need to specify both the path to the library and the library name.
This tells the linker to add the library to the application.
[/LIST]
edit: I added a .pdf document giving some more instructions for step 2 and 3. Unfortunately it is not allowed to add decent sized pdfs so I had to zip it ...

Rob
0 件の賞賛
返信

1,585件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by KaraMuraT on Fri Jul 23 07:36:31 MST 2010
You also have to include the header files to required locations (probably to main.c).

Like:
#include "SomeDriverHeader.h"
0 件の賞賛
返信

1,585件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CLD on Fri Jul 23 06:35:24 MST 2010
Hi.

I tried to use Drivers available in NXP website (http://ics.nxp.com/support/documents/microcontrollers/zip/lpc17xx.cmsis.driver.library.zip) in my projetc.
I created a folder called "Drivers" and copied all .h and .c to "Drivers/include" and "Drivers/source", respectively. I added include folder to "directories", inside MCU C Compiler in Prject Options.
So, got a lot of 'undefined reference to' to all "Driver" functions I used. What's wrong?

Thanks in advance.
0 件の賞賛
返信

1,585件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Sun Jun 27 14:40:41 MST 2010
It will look for include files on the include path of the compiler, as mentioned above (it makes no difference if the include files are in another project, or another folder - you still need to tell the compiler where to find them

You can make a folder a Source folder to make the build system find your source files. If you already have a folder, File->New->Source folder and give it the name of the existing directory will convert it into a Source folder.

HTH
0 件の賞賛
返信

1,585件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by KaraMuraT on Sun Jun 27 14:39:33 MST 2010
What I've understood from the reference page, same thing is applied to your question.

For example you have "/drivers" directory in your project. You'll include this directory from the "Project/Properties/C/C++ Build/Tool Settings/Directories" just like mentioned in the given page.

You just don't have to add any libraries (explained in the second part of the page), since the files are already in your project.

This can be seen also from some of the examples, like USBCDC. "/inc" directory has been added to "includes".

Hope this helps.
0 件の賞賛
返信

1,585件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rtos on Sun Jun 27 14:23:31 MST 2010
Thanks but my question that started this thread was not related to Library Projects.

I just want to setup a folder inside my project folder that contains a bunch of .c and .h files.  How do I tell the IDE/Compiler/Linker to look inside that folder if it cant find the files in the project root folder?
0 件の賞賛
返信

1,585件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by KaraMuraT on Sun Jun 27 13:56:28 MST 2010
Thanks, it helped a lot.

I've read mentioned pages several times, but looks like without an actual project, it feels just like a bed time story :)
0 件の賞賛
返信

1,585件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Sun Jun 27 13:09:54 MST 2010

Quote: KaraMuraT

How can I add the LPC13xx_lib to a project? It's already open in the workspace, already referenced in the project properties, but if I compile my simple project, I get "no such file or directory" error.


Details of how to add references to library projects can be found in knowledgebase entry [I]Using library projects from your own projects[/I] at:

http://lpcxpresso.code-red-tech.com/LPCXpresso/node/22
[login required]

Regards,
CodeRedSupport
0 件の賞賛
返信

1,585件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by KaraMuraT on Sun Jun 27 12:40:36 MST 2010
I opened the forum to ask very similar question. In fact mine is simpler.

How can I add the LPC13xx_lib to a project? It's already open in the workspace, already referenced in the project properties, but if I compile my simple project, I get "no such file or directory" error.

What I'm trying to do is, generate a Hello World program and include "gpio.h" from the LPC13xx_lib project to make the LED blink.

(@rtos, I hope my question does not interfere with yours. I thought that they are just the same.)
0 件の賞賛
返信