0

I'm extremely confused over how to make in c++. I'm working on a school project where we downloaded several files -- some starter code, and some libraries. File structure is something along the lines of

main --- lib/ severalLibraryFolders
    \--- src/ starterCode

I cannot seem to get the starter code to make within the command line. There's a vector library within one of the library folders and when I run make on the starter file (a .cpp and .h) I get a fatal error: 'vector.h' not found. I managed to use gcc and the -I flag to include the folder that vector.h was in which fixed it -- however other similar problems popped up even after I used the -I flag on all possible library folders.

I'm fairly certain I'm doing something wrong/need a makefile but all the examples I've found are not clear on how to do what I need to do, which is essentially to find all header files below the parent directory. I'd love some direction here, as I come from a more scripty background where this sort of thing is much easier!

Rama
  • 3,222
  • 2
  • 11
  • 26
  • What error message are you getting with your current setup? – Sam Marinelli Feb 07 '17 at 07:42
  • I think you can check here: http://stackoverflow.com/questions/4134764/how-to-define-several-include-path-in-makefile – Vladimir Tsyshnatiy Feb 07 '17 at 08:04
  • Hey Sam -- My current error is `fatal error: 'private/init.h' file not found`. I have the `private` folder included with a -I, and init.h is inside of it. I'm confused over why this isn't working. – Peter Dolan Feb 07 '17 at 18:02
  • Try using `-I` to include the directory that *contains* `private/`. (And when you write your own code, remember: hard-coded header paths are a pain.) – Beta Feb 08 '17 at 01:17

0 Answers0