Getting Started

/usr/include   you need headerfiles. For c these are always located in /usr/include and subdirectories andsubdirectories thereof

gcc  -I/home/chenpenghello.c   direct the compiler to look in the directory/home/chenpeng,as well as the standard places

 

 

staticlibrary

     Standardsystem libraries are usually stored in /liband /usr/lib.

    .a  for traditional, static libraries

    .so for shared libraries(seethe following)

 

gcc –o fred fred.c /usr/lib/libm.a   tells the compiler to compile file fred.c, call the resulting programfile fred, and search the m library in addition to the standard C                                                 library  toresolve references to functions. A similar result is achieved with thefollowing command:

gcc –o fredfried.c –lm    in this case /usr/lib, compiler willautomatically choose the shared library

gcc –o x11fred –L/usr/openwin/lib x11fred.c -1X11  

              addto the search directories by using the –L(uppercase letter) flag to thecompiler. will compile and link a program called x11fred using the version of                   the library libX11 found in the /usr/openwin/lib directory

gcc –c bill.c fred.c    individually to produce object files.

ar crv libfoo.a bill.o fred.o     create the archive and add our objectfiles to it

gcc –o program program.o libfoo.a

ranlib libfoo.a     a table ofcontent be created for the library, speed access to archives

 

sharedlibraries

    one disadvantage of staticlibraryies is that when you run many applications at

    the same time and they all use functions from the samelibrary, you may end up white many copyies of the same functions in memory andindeed many copies in program files themselves

    shared libraries canovercome this disadvantage.

 

    On a typical Linux system,the shared version of the standard math library is /lib/libm.so.When a program uses a shared library, it islined in such a way that it doesn’t contain function code itself, butreferences to shared code that will be made available atrun time.

    We can seewhich shared libraries are required by a program by running the utility ldd. the following:

$ ldd program

      linux-vdso.so.1 =>  (0x00007ffff6fff000)

      libc.so.6 => /lib64/libc.so.6 (0x0000003c51400000)

      /lib64/ld-linux-x86-64.so.2 (0x0000003c50c00000)

   shared libraries are similar to dynamic-link libraries used underwindows. the .a libraries are similar to .LIB files.

 

GettingHelp

man gcc

info gcc      The info system also contains its ownhelp page in info form pages,of course.If you type Ctrl+H ,you’ll be presentedwith som help that includes a                        turorial on using info.

     The man commandprovides access to the online manual pages.

     The GNU software suite and some other free software use an onlinedumentation system called info.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MCAL是Microcontroller Abstraction Layer的缩写,是一种用于微控制器开发的软件层。MCAL Getting Started Tutorial介绍了如何在MCAL平台上开始进行开发。 首先,在开始MCAL开发之前,我们需要了解MCAL的基本概念和特性。MCAL提供了一套抽象的API(应用程序编程接口),用于对底层硬件进行访问和控制。它的目的是将底层硬件和上层应用程序解耦,使得应用程序可以更方便地进行开发和移植。 接下来,我们需要安装所需的开发工具和环境。根据MCAL的厂商和平台的不同,安装过程也会有所差异。通常,我们需要安装MCAL的开发库、编译器、调试工具等。 安装完成后,我们可以开始编写第一个MCAL应用程序。在MCAL Getting Started Tutorial中,通常会提供一些示例代码和演示用例,以帮助我们理解MCAL的使用方法。我们可以按照教程的步骤来进行代码编写、编译和调试。 在编写MCAL应用程序时,我们需要了解MCAL提供的API和功能库。这些API和功能库包括了对GPIO、UART、SPI、I2C等外设的访问和配置接口,以及中断、时钟管理、内存管理等系统级功能。 最后,在编写和调试完成应用程序之后,我们可以将其下载到目标硬件上进行运行。为了确保应用程序的稳定性和性能,我们还可以进行性能分析和优化。 总的来说,MCAL Getting Started Tutorial为我们提供了一个学习和入门MCAL开发的入口。通过这个教程,我们可以掌握MCAL的基本概念、使用方法和开发流程,从而在微控制器开发中更高效地使用MCAL。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值