How to create a libarary in Atmel Studio 6

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

I want to create my own libraries in Atmel Studio 6 (The header file and source file for a library). I've already written my code in a simple editor but don't know how to make them .h and .c files in order to use them in my projects.

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

This will help http://www.avrfreaks.net/index.p...

There is also an updated PDF, use the link at the top of that page

Alex

"For every effect there is a root cause. Find and address the root cause rather than try to fix the effect, as there is no end to the latter."
Author Unknown

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

But I didn't find what I want, in that PDF. Sorry but maybe you didn't get it. I want to know how to create a .h file in Atmel studio 6.

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

There is nothing special about a header file (.h) apart from the extension, it is a simple text.
You can create it in any text editor or in AVRstudio and save it with .h extension.

Alex

"For every effect there is a root cause. Find and address the root cause rather than try to fix the effect, as there is no end to the latter."
Author Unknown

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

Thanks Alex.

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

But, In Studio 7, how does one specify where such .h files are to be located?

 

Thanks

David Abineri

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

Under the C/C++ compiler section there's an entry called "Directories", list any directories to be searched by the preprocessor there and they'll be passed as -I's on the command line.

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

Thanks for this hint but I just went carefully through all the menus in Studio 7 and there is no "C/C++ Compiler Section"

 

How does one get to the C/C++ Compiler Section in order specify the directories for the preprocessor to search?

 

Also, is just the  .h file needed in order to compile properly or are other files needed too?

 

Many thanks

David Abineri

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

You can just add the .c and .h files to your project, or tell the compiler where to search for them during the build.

 

 

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

Oh come on? You must have set SOMETHING in the projrct properties before now?? In the Solution Explorer you right click the project and select Properties. Under there you'll find option for Compiler and Linker (among other things).

 

Kiobk, your advice is normally 100% but in this case it's not as simple as just adding .h to the project, that won't lead to the prepro finding it for #include if it's not in an existing search path.

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

If I right-click on the project in the solution explorer and choose properties, I get

 

Common Properties

     Startup Project

     Project Dependencies

     Debug Source Files

Configuration Properties

     Configuration.

 

None of these lead to anything about the compile options.

 

What am I missing here?

 

Thanks.

David Abineri

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

dabineri wrote:
If I right-click on the project in the solution explorer and choose properties, I get   Common Properties      Startup Project

[...]

What am I missing here?

You're right-clicking the Solution (which is the top node in the tree view in the Solution Explorer).

 

Either right-click the node under the solution (which is the project node) and select Properties,

Or select Properties in the Project menu.

 

Both will lead to the project properties.

 

I would advise you to go through the Users Guide for Atmel Studio. Available in the Help menu in Studio, or online here.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Tue. Dec 26, 2017 - 11:13 PM