This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

#include paths

Im new to uvision and programming and im looking at a project that has some headers as,
#include "..\..\..\swim\lpc_types.h". How do i give it the correct path to the file?..how is "..\..\..\" supposed to define a path?, ive only seen headers included like #include lpc_types.h

Parents
  • Do you mean the dots? Because the backslashes don't look that standard to me. I prefer to use forward slashes most of the time.

    Forward slashes are fine in the code and you're right "..\.." is the same as "....", which of course doesn't make sense. So using "../.." is more convenient.

    However don't use / in the .uvproj files. Instead use a single \ there. That's of course only relevant if you happen to generate parts of the .uvproj from your code, like I do, or manually edit it. µVision accepts / in the .uvproj, but relative includes (even those in the same directory) don't work any more. Took me quite some time to find out.

Reply
  • Do you mean the dots? Because the backslashes don't look that standard to me. I prefer to use forward slashes most of the time.

    Forward slashes are fine in the code and you're right "..\.." is the same as "....", which of course doesn't make sense. So using "../.." is more convenient.

    However don't use / in the .uvproj files. Instead use a single \ there. That's of course only relevant if you happen to generate parts of the .uvproj from your code, like I do, or manually edit it. µVision accepts / in the .uvproj, but relative includes (even those in the same directory) don't work any more. Took me quite some time to find out.

Children