S
S
sddvxd2018-12-25 19:08:39
C++ / C#
sddvxd, 2018-12-25 19:08:39

How to build static libraries from source?

Hello!
Please tell me how to compile lib files
The book told me that it is best to compile the sources on the machine where I am going to program, but I have never done this, much less compile someone else's code into an unknown file type

GLUT source structure
5c225592d35b8535487414.png

I see that, most likely, the structure of this archive is compiled according to some specification, following the standard, which means that there must be a universal way to collect such archives, please tell me how

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Movchan, 2018-12-25
@sddvxd

For many programming languages, build systems come with compilers and are the de facto standard for the respective language.
There is no de facto build standard for C/C++, but there are several build systems that are commonly used:
make is a very simple utility, but inconvenient for large projects.
Can be identified by the presence of a Makefile. Sometimes this file is generated by the configure script.
If there is a Makefile, run:
Delete generated files (to start the build again):
cmake - a higher-level build system that generates projects for the IDE or the same Makefile.
Can be determined by the presence of CMakeLists.txt

mkdir cmake-build
# Создаём папку для сгенерированных файлов, чтобы не смешивались с исходниками
# Это называеться out-of-source build
cd cmake-build

# Генерируем проект или Makefile
cmake ..

# Запускаем билд, можно просто запустить make
cmake --build .

qmake is a build system designed for building Qt and projects using Qt.
Can be identified by the presence of .pro files. Build like this:
qmake
make

In your case make is used.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question