简体   繁体   中英

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 libraries 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 (eg, on a fully homogeneous computation cluster). However, if the machines differ (eg, 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM