Header files for C++ programming

26 views
Skip to first unread message

Bill Dussault

unread,
Apr 3, 2017, 6:19:22 PM4/3/17
to BeagleBoard
Greetings.

I have a directory "Setup" on the Beaglebone Black with all my .cpp files stored in it. Within this directory is a sub directory holding all my header files appropriately labeled "header" 
To access these files within the beaglebone blacks directories do I have to use

<include> "/home/UART/Setup/header.BlackADC.h"

or simply use 

<include> "/header.blackADC.h"

I cannot figure this out. 
Thanks 

Jacek Radzikowski

unread,
Apr 3, 2017, 6:27:57 PM4/3/17
to beagleboard
#include "header.blackADC.h"


and add search path for the header files to the compiler options, e.g.:

g++ -I/home/UART/Setup [other options] your_source.cpp -o your_binary

Jacek
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beagleboard...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/64f89cd8-af26-4f77-b2bf-c44a04166217%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Given a choice between two theories, take the one which is funnier

Dennis Lee Bieber

unread,
Apr 3, 2017, 9:51:39 PM4/3/17
to beagl...@googlegroups.com
On Mon, 3 Apr 2017 15:19:22 -0700 (PDT), Bill Dussault
<franki...@gmail.com> declaimed the
following:

>Greetings.
>
>I have a directory "Setup" on the Beaglebone Black with all my .cpp files
>stored in it. Within this directory is a sub directory holding all my
>header files appropriately labeled "header"
>To access these files within the beaglebone blacks directories do I have to
>use
>
Confusing... Do you mean the header files all start with "header.****",
or do you mean the SUBdirectory is named "header"?

><include> "/home/UART/Setup/header.BlackADC.h"
>
>or simply use
>
><include> "/header.blackADC.h"
>

Where are you building in?

If building in setup directory, you would specify

#include "subdirectory/header.BlackADC.h"

if they are in the unnamed subdirectory

...

#include "header/BlackADC.h"

if the subdirectory is named "header"


If building from some other directory, you'll need enough path
specification to find the correct directory.
--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com HTTP://wlfraed.home.netcom.com/

Reply all
Reply to author
Forward
0 new messages