Trouble adding an include path

Go To Last Post
27 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using Atmel Studio 7 on a Windows 7 Ultimate (32 bit) PC.  I created a file that I named my_c_preproc.h which contains preprocessor macros.  I created a directory where I placed the file, and I added the path using the add command and dialog box in the toolchain - AVR/GNU C Compiler - Directories.  I have tried this using both relative and absolute paths.  When I build solution, I get a compiler error:

 

AD9850PSK31.ino: 4:28: fatal error: my_c_preproc.h: No such file or directory
   #include "my_c_preproc.h"
   compilation terminated
Error compiling project sources

 

When I go back to toolchain - AVR/GNU C Compiler - Directories, the path that I added is not longer there.  The solution builds properly when I either specify the entire path in the .c source file for the header file or when I place a copy of the header file in one of the directories in the existing paths list.

 

I have applied latest updates to both Windows 7 and Atmel Studio 7.

 

Any advice will be appreciated.

Frank

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try adding a -I to the "miscellaneous" (which is all Directories is supposed to do anyway).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is the directory there before you build?

 

Do you use the "browse" button or do you type in the path?   The browse button (three dots) is easier. 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson, thank you for the response.  I added the -I flag to "miscellaneous".  The results are the same: I get the error message, the path that I added is gone, but the -I flag is still there.

Frank

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

steve17, thank you for answering.  Yes, I verified that the directory is present and the header file is located there.  I did use the browse button.  I also tried to type in the path directly with the same results both times.

Frank

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What happens if you use angle brackets instead of quotes?

 

#include <my_c_preproc.h>
// instead of 
#include "my_c_preproc.h"

 

Greg Muth

Portland, OR, US

Xplained/Pro/Mini Boards mostly

 

Make Xmega Great Again!

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Greg, thanks for the reply.  I tried the angle brackets, and the results are the same.

Frank

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you have a lot of entries, maybe you exceeded the limit.    You can move the entries up or down to change the search order by using the arrow buttons.  You might try bumping it up in the list.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Steve17, I used your advice as follows:

 

I counted that there are 10 entries in the directories window (not including the one I want to add)

I removed 4 of those that are not needed for this particular project using the "X" button

I added the path to my header file using the browse method

I rebuilt the solution

I still received the same error message

My added path is now missing from the Directories window

The 4 unneeded paths that I had removed are again present in the Directories window.

 

'Any other ideas?  Thanks

Frank

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why would angle brackets be the solution? It's not a system header. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Clawson, I did not assert that adding angle brackets should be a solution.  I was following a suggestion of another poster.  Thanks

Frank

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

opc100 wrote:

 

The 4 unneeded paths that I had removed are again present in the Directories window.

 

'Any other ideas?  Thanks

Are you saying the 4 you deleted magically appeared later?

 

If so, it seems Studio doesn't remember your changes.

 

You might make some changes, then close the solution.  I assume it should ask if you want to save your changes.  Then open the solution again and see what you have.

 

 You could also try the "Save All" thing.  I guess that is supposed to save your changes.  Then close and reopen Studio.

 

Try rebooting Windows.

 

Maybe your project or solution file is write protected in such a way that Studio can't unprotect it. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

steve17, I appreciate your not giving up on me.

 

I tried each of your suggestions, and none of them helped.  I will add that I've tried running Atmel Studio both as administrator and not.

 

As you mentioned, perhaps the project has some unintended protection.  I will start a new project and copy my source files into it.  I will advise on the outcome.  Thanks.

Frank

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Starting over with a new project did not help.  All of the behaviors are the same as before.  I am going to uninstall and reinstall Atmel Studio 7.0.  Perhaps my installation has somehow become corrupted.  I will continue to advise.

Frank

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

opc100 wrote:

Clawson, I did not assert that adding angle brackets should be a solution.  I was following a suggestion of another poster.  Thanks

I was commenting on post #6.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have uninstalled (using the control panel tool) and reinstalled  Atmel Studio 7 (7.0.1188).

 

All the behaviors and errors are just the same as before.  I made a do-nothing project that compiles successfully until I add the header file and try to include its path as I described above.

 

It looks like my installation has inherited setting from my prior installation.  Perhaps someone could suggest what files I need to strip out to get a clean re-installation.

 

Thanks

Frank

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Re-installation sounds a bit fierce. I'd try to identify what's going on first.

 

If you create a blank project and then set "Directories" to some c:\nested\directory and then build what do you see passed as a -I value when the code is compiled?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson, I have reinstalled Atmel Studio.  Before I did that, though, I created a blank project, set the "Directories", etc., I got the same results and error as before.  The directory for my header file was not passed with the -I flag.

 

The re-installation was a real pain.  I followed the instructions given at the site (http://atmel.force.com/support/a...), but AppData\Local does not exist on Windows 7; so, I did a search for all files and directories with Atmel in the name and deleted them before the reinstall.  The clean reinstall solved the problem.

 

Thanks for your patience and assistance.  The root of the problem, broadly stated, was bad settings that remained after the Windows Control Panel Programs Uninstall.

 

 

Frank

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

opc100 wrote:

but AppData\Local does not exist on Windows 7;

I'm glad you got it working.

 

Actually AppData does exist on Win7.  You are the victim of a Microsoft trick.   AppData is a hidden folder.  You can access it a couple of ways.  

 

You can browse to your user folder and then add \AppData to the end of the path in the address bar.  Voila! you are there.  This is the way it looks when browsing a Win7 installation while running Win10:

 

 

 

 

You can also change the view options.  I'm running Win10 now but I think the procedure is similar.  Click File > change file and folder options > view tab.  Check  "Show hidden files, folders, and drives".

While you are there, you'll probably want to uncheck "Hide extensions for known types".

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

steve17, yes that did the trick.  And, it would have made the clean reinstall easier.  Hopefully, there won't be a next time.  If there is, though, I'm prepared.

 

Thanks

Frank

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I realize this is an old thread but the stated problem is exactly what I'm experiencing with Atmel Studio 7  (unable to add a Toolchain Directory).

 

I just want to confirm the only solution is to re-install Atmel Studio 7?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Isn't the project file just XML ?

Before undertaking a complete (and lengthy) re-install try adding the paths manually using a decent editor like notepad++.

 

I've had to "repair" Visual Studio projects like this more than once.

 

Last Edited: Sat. Nov 30, 2019 - 10:25 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had similar issues with "no such file or directory" using DUE board on Atmel Studio 7. Though it´s not directly an answer to the subject above, may this help any newbie like me on how to set Path in Atmel Studio 7: https://youtu.be/9cqO55C2a9w

Good luck.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you so much! I was looking for the "Include Paths" everywhere lol

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had a similar issue - I was unable to add or edit include paths for compiler include directory by entering text in the input field. It worked if I used the browse button and the select folder dialog 'OK' return entered the text into the input field for me.

mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try double clicking to start editing a "blank" line.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Double clicking (on an existing entry)  to open the path input field operated the same as when I entered text manually. There was no change to the list of paths. No worries though, using the browse is a fine workaround. I mainly wanted to alert others of what worked for me because failure of the manual text input had me originally thinking I was facing a re-installation as mentioned in previous posts.

mike