0

I am attempting to use this DOSL template for my C++ code. It is found at: https://github.com/subh83/DOSL

It says that I should be able to access it without installing the library simply by using the header: #include <dosl/dosl>

I put that include header but when I compiled, I got an error message at that line saying "dosl/dosl ... no such file or directory". Am I misunderstanding the instructions? How does the #include header actually access the template library without a full path to the files?

Fatcow808
  • 11
  • 2
  • Did you install dosl somewhere your project can find it? Your toolchain's documentation can tell you where that would be. – Stephen Newell Apr 16 '20 at 03:55
  • of course you need to specify the path to the library headers. The wording they use might be confusing for someone not experienced, but it is sort of understood that you need to. – bolov Apr 16 '20 at 03:55
  • 1
    Not a duplicate, but might help you figure out what's going wrong: [What is the difference between #include and #include “filename”?](https://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename) – user4581301 Apr 16 '20 at 03:55
  • @StephenNewell No, I was attempting to use it without installing since the documentation said that installation was optional. – Fatcow808 Apr 16 '20 at 04:28
  • What's your build environment? Windows, Mac, or Linux? What tool are you using to build? An IDE or command line? I'll tailor my answer to fit your needs if you want. – selbie Apr 16 '20 at 04:34
  • @bolov Okay, that makes more sense then. So would I have to install the libraries locally or is it possible to just specify a path to the files via github url? Sorry if that is a dumb question, I am indeed lacking in experience – Fatcow808 Apr 16 '20 at 04:37
  • @selbie I am building on Linux using Visual Studio Code – Fatcow808 Apr 16 '20 at 04:38
  • @Fatcow808 locally – bolov Apr 16 '20 at 04:50
  • Thanks to everyone that commented, i think i get it now. Y'all were really helpful! – Fatcow808 Apr 16 '20 at 07:43

1 Answers1

2

It's unfortunate that the repro, subfolder, and header file are all named the same: DOSL. That's what makes it confusing.

Open a command prompt or terminal window

cd to your home directory:

cd ~/ or cd %USERPROFILE

Clone the repo:

git clone https://github.com/subh83/dosl   # this will create a DOSL subfolder

At this point, the directory structure looks like this:

/home/Fatcow808/                    # home directory
                 dosl/              # git repo root directory
                      dosl/         # primary code directory
                            dosl    # actual header file

Update your project settings such that the INCLUDE path points to the git repro root directory. That is, add /home/Fatcow808/dosl or C:/Users/Fatcow808/dosl to your INCLUDE path. Or from the command line you can do something like -I/home/Fatcow808/dosl.

Then in your code can add this to all source files of your project as you see fit.

#include <dosl/dosl> 

It should correctly pick up the dosl header and everything it includes will resolve correctly.

selbie
  • 100,020
  • 15
  • 103
  • 173
  • Thank you so much for the tailored response! Especially for explaining it step by step, it really helped me picture it better! – Fatcow808 Apr 16 '20 at 07:55