开发者

Ncurses static libraries to include with a C++ project

I have installed the latest ncurses library which my project is using. Now, I want to check in the ncurses static libr开发者_JAVA百科aries into svn so that I can checkout the project on a different machine and compile it without having to install ncurses on the system again.

So the question is what is the difference between libncurses.a, libncurses++.a and libncurses_g.a files? And do I need all of them for my C++ project?

Thanks!


libncurses.a   - This is the C compatible library.
libncurses++.a - This is the C++ compatible library.
libncurses_g.a - This is the debug library.
libncurses_p.a - This is the profiling library.

If you want to find out if you can get by without using libncurses.a, you can rename the library and run a build of your application.


My answer comes a little late [ :-) ] since you posted your question more than 4 years ago. But:

Archiving the pre-compiled library in your SVN means that your built application may fail if the target machine differs under some critical aspect.

Yes, you can safely run the application on other machines which are configured entirely in the same way (e.g., on a fully homogeneous computation cluster). However, if the machines differ (e.g., because one machine had a system upgrade and the other not), it may stop working. This is not very likely, so the risk may be acceptable for what you'd like to do.

I would suggest another solution: Commit a recent, stable version of the libncurses sources (tarball) to your SVN repo and add a little script (or make target) that runs the libncurses build and installs the built library to some project directory (not the system directory but next to your applciation build directories, without committing to SVN). This build step only needs to be repeated if the libary shall be upgraded or if you would like to build/run on another machine.

This does not apply to the ncurses library in special but to any library.

Depending on your project target, consider further reading about

  • package management
  • cross compile
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜