Ошибка при сборке программы написанной на С++

Автор Sandorin, 04 февраля 2024, 08:25:09

« назад - далее »

0 Пользователи и 2 гостей просматривают эту тему.

Sandorin

Приветствую. Необходимо в Debian 12 х64, установить программу Astrolog 7.60.
Скачал исходный код.
Распаковал архив. Нашел Makefile. (текст файла под спойлером).
Открыть содержимое (спойлер)
# Astrolog (Version 7.60) File: Makefile (Unix version)
#
# IMPORTANT NOTICE: Astrolog and all chart display routines and anything
# not enumerated elsewhere in this program are Copyright (C) 1991-2023 by
# Walter D. Pullen (Astara@msn.com, http://www.astrolog.org/astrolog.htm).
# Permission is granted to freely use, modify, and distribute these
# routines provided these credits and notices remain unmodified with any
# altered or distributed versions of the program.
#
# First created 11/21/1991.
#
# This Makefile is included only for convenience. One could easily compile
# Astrolog on most Unix systems by hand with the command:
# % cc -c -O *.cpp; cc -o astrolog *.o -lm -lX11
# Generally, all that needs to be done to compile once astrolog.h has been
# edited, is compile each source file, and link them together with the math
# library, and if applicable, the main X library.
#
NAME = astrolog
OBJS = astrolog.o atlas.o calc.o charts0.o charts1.o charts2.o charts3.o\
 data.o express.o general.o intrpret.o io.o matrix.o placalc.o placalc2.o\
 xdata.o xgeneral.o xdevice.o xcharts0.o xcharts1.o xcharts2.o xscreen.o\
 swecl.o swedate.o swehouse.o swejpl.o swemmoon.o swemplan.o sweph.o\
 swephlib.o

# If you don't have X windows, delete the "-lX11" part from the line below:
# If not compiling with GNUC, delete the "-ldl" part from the line below:
LIBS = -lm -lX11 -ldl -s
CPPFLAGS = -O -Wno-write-strings -Wno-narrowing -Wno-comment
RM = rm -f

$(NAME): $(OBJS)
   cc -o $(NAME) $(OBJS) $(LIBS)

clean:
   $(RM) $(OBJS) $(NAME)
#
[свернуть]

Из файла интересует эта часть

This Makefile is included only for convenience. One could easily compile
# Astrolog on most Unix systems by hand with the command:
# % cc -c -O *.cpp; cc -o astrolog *.o -lm -lX11

команда отдельно:

% cc -c -O *.cpp; cc -o astrolog *.o -lm -lX11
Пользуясь поиском сделал следующее:
Установил g++
sudo apt install g++Установил libx11-dev
sudo apt install libx11-dev
Привел команду к такому виду, чтобы Debian понимал что надо с ней делать:
sudo g++ cc -c -O *.cpp; cc -o astrolog *.o -lm -lX11
Разделил на две части команду
Первая
sudo g++ cc -c -O *.cppВторая
sudo cc -o astrolog *.o -lm -lX11
Выполненил первой команды (в папке полученной после распаковки)
sudo g++ cc -c -O *.cppВывод процесса работы команды длинный. Не привожу тут.
При выполнении команды неоднократно проскакивает сообщение
warning: ISO C++ forbids converting a string constant to 'char*'В таком контексте:
swephlib.cpp:4179:29: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
 4179 | # define AMODELS_SE_1_00    "1,3,1,1,1,0,0,1"
Начало и конец вывода меняются. Разные имена файлов.
Выполнение завершается вот таким выводом:
g++: warning: gcc: linker input file unused because linking not done
g++: error: cc: linker input file not found: Нет такого файла или каталога

Поиск по этим трем сообщениям ничего не пояснил. Так как первая команда завершается выводом ошибки вторую не запускал.

Как исправить ошибку?

Aalexeey

https://debianforum.ru/index.php?topic=6879 100% защиты от "Ааааа у меня всё поломалось"

Sandorin

Цитата: Aalexeey от 04 февраля 2024, 09:06:03А то что они сами под linux собрали у вас не запускается?
https://www.astrolog.org/astrolog.htm
https://www.astrolog.org/astrolog/astlink.htm
https://codeberg.org/toddcarnes/Astrolog-64/releases/tag/v7.60 внизу.

Большое спасибо. Не видел этого. Но там по содержанию вроде то же самое. Не понимаю как его запустить, архив с последней ссылки. Вот этот ast76lin.tar.gz

delytant

распаковать в файловом менеджере. зайти в директорию. двойной клик по astrolog.

ferum

Честно не знаю ни чего про эту прогу...
Просто распаковал во вложенную папку и перешёл в неё, сделал make
Что то собралось без ошибок
Дальше
alex@ferum:~/ast76src$ ./astrolog
** Astrolog version 7.60 (See '-Hc' switch for copyrights and credits.) **
   Invoke as 'astrolog -H' for list of command line options.
Enter month for chart (e.g. '3' 'Mar') >

Если запустить с ключом -H вываливается целый список опций, очевидно всё работоспособно.
Русские дебианщики против цифрового слабоумия !