napTu 4 Posted 2008-03-28 13:48:25 Share Posted 2008-03-28 13:48:25 помогите плз. нужен консольный конфигуратор для новой версии стг, но он не собирается из дистрибутива. надо под фрю4.10. намекните пожалуйста, куда копнуть? Link to post Share on other sites
madf 279 Posted 2008-03-28 14:26:51 Share Posted 2008-03-28 14:26:51 Выложить лог сборки Link to post Share on other sites
napTu 4 Posted 2008-03-28 15:48:50 Author Share Posted 2008-03-28 15:48:50 http://local.com.ua/forum/index.php?showtopic=8789 этого хватит? Link to post Share on other sites
madf 279 Posted 2008-03-28 16:01:27 Share Posted 2008-03-28 16:01:27 Тебе нужно установить getopt Link to post Share on other sites
napTu 4 Posted 2008-04-06 11:37:20 Author Share Posted 2008-04-06 11:37:20 дык до установки оно ругается на отсутствие, а после установки - на конфлик объявлений /usr/include/unistd.h:112: error: declaration of C function `int getopt(int, char* const*, const char*)' conflicts with /usr/local/include/getopt.h:136: error: previous declaration `int getopt()' here Link to post Share on other sites
madf 279 Posted 2008-04-06 11:41:54 Share Posted 2008-04-06 11:41:54 Чуть позже напишу что сделать Link to post Share on other sites
madf 279 Posted 2008-04-06 12:02:51 Share Posted 2008-04-06 12:02:51 В самой первой строчке main.cpp, перед всеми директивами #include вставь строчку: #define HAVE_DECL_GETOPT 1 PS: опять фришники собаку подложили... Link to post Share on other sites
napTu 4 Posted 2008-04-06 12:29:43 Author Share Posted 2008-04-06 12:29:43 одному богу известными манипуляциями довел сборку до состояния: g++ -c parser.cpp -O2 -Wall -I /usr/home/napTu/stg-2.404.9.7-wo_netflow_patch/projects/sgconf/../../include -DFREE_BSD g++ main.o parser.o /usr/home/napTu/stg-2.404.9.7-wo_netflow_patch/projects/sgconf/../../lib/libconffiles.so /usr/home/napTu/stg-2.404.9.7-wo_netflow_patch/projects/sgconf/../../lib/libstg_common.so /usr/home/napTu/stg-2.404.9.7-wo_netflow_patch/projects/sgconf/../../lib/libsrvconf.so /usr/lib/libexpat.so /usr/lib/libc_r.so /usr/lib/libc.so -Wl,-E -L/usr/home/napTu/stg-2.404.9.7-wo_netflow_patch/projects/sgconf/../../lib -Wl,-rpath,//usr/lib/stg -Wl,-rpath-link,/usr/home/napTu/stg-2.404.9.7-wo_netflow_patch/projects/sgconf/../../lib -o sgconf /usr/lib/libc.so: WARNING! setkey(3) not present in the system! /usr/lib/libc.so: warning: this program uses gets(), which is unsafe. /usr/lib/libc.so: warning: mktemp() possibly used unsafely; consider using mkstemp() /usr/lib/libc.so: WARNING! des_setkey(3) not present in the system! /usr/lib/libc.so: WARNING! encrypt(3) not present in the system! /usr/lib/libc.so: warning: tmpnam() possibly used unsafely; consider using mkstemp() /usr/lib/libc.so: warning: this program uses f_prealloc(), which is not recommended. /usr/lib/libc.so: WARNING! des_cipher(3) not present in the system! /usr/lib/libc.so: warning: tempnam() possibly used unsafely; consider using mkstemp() main.o: In function `main': main.o(.text+0x1538): undefined reference to `getopt_long' collect2: ld returned 1 exit status gmake: *** [sgconf] Ошибка 1 указание на #define HAVE_DECL_GETOPT 1 при этом уже ни на что не влияет. Link to post Share on other sites
madf 279 Posted 2008-04-06 12:47:06 Share Posted 2008-04-06 12:47:06 Ты, случайно, из main.cpp не убрал #include <getopt.h>? Link to post Share on other sites
napTu 4 Posted 2008-04-06 13:09:50 Author Share Posted 2008-04-06 13:09:50 убирал, но сейчас всё вернул назад. сначала убрал из usr/include/unistd.h объявление getopt, с этого момента стало говорить main.o(.text+0x1538): undefined reference to `getopt_long'. потом обновил getopt с 2.1 до 2.1_1 потом вернул объявление getopt в usr/include/unistd.h так и выдает main.o(.text+0x1538): undefined reference to `getopt_long'. Link to post Share on other sites
napTu 4 Posted 2008-04-06 13:40:16 Author Share Posted 2008-04-06 13:40:16 вернул старую getopt.h добавил #define HAVE_DECL_GETOPT 1 всё равно ругается на /usr/local/include/getopt.h:136: error: previous declaration `int getopt()' here Link to post Share on other sites
napTu 4 Posted 2008-04-15 13:32:14 Author Share Posted 2008-04-15 13:32:14 блиииин. getopt.h сократил до непристойного вида: extern "C" { struct option { const char *name; int has_arg; int *flag; int val; }; extern int getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); } а оно мне всё одно: main.o: In function `main': main.o(.text+0x1538): undefined reference to `getopt_long' collect2: ld returned 1 exit status gmake: *** [sgconf] Ошибка 1 как будто и не обращается туда, но с пустым файлом не компилится g++ -c main.cpp -O2 -Wall -I /usr/home/napTu/stg-2.404.9.7/projects/sgconf/../../include -DFREE_BSD main.cpp:87: error: elements of array `option long_options[]' have incomplete type main.cpp:87: error: storage size of `long_options' isn't known main.cpp: In function `int main(int, char**)': main.cpp:541: error: `getopt_long' was not declared in this scope main.cpp:541: warning: unused variable 'getopt_long' main.cpp: At global scope: main.cpp:52: error: storage size of `long_options' isn't known gmake: *** [main.o] Ошибка 1 madf, чего делать, подскажи? Link to post Share on other sites
napTu 4 Posted 2008-04-15 14:07:35 Author Share Posted 2008-04-15 14:07:35 что самое интересное, не могу поставить getopt - /usr/ports/misc/getopt говорит gcc -L/usr/local/lib -lintl -o getopt getopt.o getopt.o: In function `generate_output': getopt.o(.text+0x32a): undefined reference to `getopt_long' getopt.o: In function `main': getopt.o(.text+0xadc): undefined reference to `getopt_long' collect2: ld returned 1 exit status gmake: *** [getopt] Ошибка 1 *** Error code 2 но /usr/ports/devel/libgnugetopt поставилось и содержит getopt_long какой еще getopt ставить? Link to post Share on other sites
madf 279 Posted 2008-04-15 19:51:21 Share Posted 2008-04-15 19:51:21 Верни все хидеры в исходное состояние. Нечего их портить. Все решается дефайнами. Ты когда дефайн добавлял - ты его в самый верх файла ставил? Над инкладами? Link to post Share on other sites
napTu 4 Posted 2008-04-16 06:34:16 Author Share Posted 2008-04-16 06:34:16 да, #define HAVE_DECL_GETOPT 1 стоит в самом начале и в данном случае на повтор определения getopt() не ругается. Дело в том что переменная HAVE_DECL_GETOPT 1 влияет только на определение функции getopt() , но не getopt_long(). А тут я getopt_long() уже задаю принудительно, безо всяких условий. да и при компиляции из cpp оно видится и обрабатывается без проблем. Ошибка почемуто происходит уже при перекомпиливании обжекта - main.o(.text+0x1538): undefined reference to `getopt_long' Такое впечатление что это определение уже не зависит от getopt.h, а задается гдето в другом месте. Вопрос в каком? Link to post Share on other sites
madf 279 Posted 2008-04-16 06:44:07 Share Posted 2008-04-16 06:44:07 "undefined reference" говорит об отсутствии символа на этапе компоновки, а не компиляции. В Makefile добавь в LIBS -lgnugetopt LIBS += -lexpat \ -lc_r \ -lc \ -lgnugetopt Link to post Share on other sites
napTu 4 Posted 2008-04-16 07:37:23 Author Share Posted 2008-04-16 07:37:23 О БОГИ! СЛАВА ВАМ! СПАСИБО madf !!! Еще поставил gnugetopt.h и там ему задал #define __GNU_LIBRARY__ 1 и #include gnugetopt.h Link to post Share on other sites
Shtorm 0 Posted 2009-04-21 06:02:47 Share Posted 2009-04-21 06:02:47 Помогите и мне у меня не собирается с такой ошибкой Система AltLinux 4,1 ############################################################################# Building sgconf for Linux ############################################################################# Checking for -lexpat... yes gmake -C /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../stglibs includes gmake[1]: Entering directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs' gmake includes -C conffiles.lib gmake[2]: Entering directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/conffiles.lib' cp -p conffiles.h /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../include gmake[2]: Leaving directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/conffiles.lib' gmake includes -C crypto.lib gmake[2]: Entering directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/crypto.lib' cp -p ag_md5.h blowfish.h /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../include gmake[2]: Leaving directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/crypto.lib' gmake includes -C common.lib gmake[2]: Entering directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/common.lib' cp -p debug.h stg_error.h common.h /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../include gmake[2]: Leaving directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/common.lib' gmake includes -C srvconf.lib gmake[2]: Entering directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/srvconf.lib' cp -p servconf.h netunit.h /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../include gmake[2]: Leaving directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/srvconf.lib' gmake[1]: Leaving directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs' gmake -C /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../stglibs gmake[1]: Entering directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs' gmake -C conffiles.lib gmake[2]: Entering directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/conffiles.lib' gmake[2]: Leaving directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/conffiles.lib' gmake[2]: Entering directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/conffiles.lib' g++ -O2 -Wall -fPIC -I /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../include -I ./ -DLINUX -DSTG_TIME -c conffiles.cpp g++ -shared -Wl,-rpath,//usr/lib/stg -Wl,-soname,libconffiles.so conffiles.o -o libconffiles.so -L /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib ar rc libconffiles.a conffiles.o ranlib libconffiles.a cp *.so /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib cp *.a /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib gmake[2]: Leaving directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/conffiles.lib' gmake -C crypto.lib gmake[2]: Entering directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/crypto.lib' gmake[2]: Leaving directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/crypto.lib' gmake[2]: Entering directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/crypto.lib' g++ -O2 -Wall -fPIC -I /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../include -I ./ -DLINUX -DSTG_TIME -c ag_md5.c g++ -O2 -Wall -fPIC -I /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../include -I ./ -DLINUX -DSTG_TIME -c blowfish.cpp g++ -shared -Wl,-rpath,//usr/lib/stg -Wl,-soname,libstg_crypto.so ag_md5.o blowfish.o -o libstg_crypto.so -L /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib ar rc libstg_crypto.a ag_md5.o blowfish.o ranlib libstg_crypto.a cp *.so /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib cp *.a /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib gmake[2]: Leaving directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/crypto.lib' gmake -C common.lib gmake[2]: Entering directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/common.lib' gmake[2]: Leaving directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/common.lib' gmake[2]: Entering directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/common.lib' g++ -O2 -Wall -fPIC -I /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../include -I ./ -DLINUX -DSTG_TIME -c debug.c g++ -O2 -Wall -fPIC -I /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../include -I ./ -DLINUX -DSTG_TIME -c stg_error.c g++ -O2 -Wall -fPIC -I /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../include -I ./ -DLINUX -DSTG_TIME -c common.cpp g++ -O2 -Wall -fPIC -I /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../include -I ./ -DLINUX -DSTG_TIME -c stg_strptime.cpp g++ -shared -Wl,-rpath,//usr/lib/stg -Wl,-soname,libstg_common.so debug.o stg_error.o common.o stg_strptime.o -lstg_crypto -o libstg_common.so -L /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib ar rc libstg_common.a debug.o stg_error.o common.o stg_strptime.o ranlib libstg_common.a cp *.so /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib cp *.a /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib gmake[2]: Leaving directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/common.lib' gmake -C srvconf.lib gmake[2]: Entering directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/srvconf.lib' gmake[2]: Leaving directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/srvconf.lib' gmake[2]: Entering directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/srvconf.lib' g++ -O2 -Wall -fPIC -I /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../include -I ./ -DLINUX -DSTG_TIME -c netunit.cpp g++ -O2 -Wall -fPIC -I /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../include -I ./ -DLINUX -DSTG_TIME -c parser.cpp g++ -O2 -Wall -fPIC -I /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../include -I ./ -DLINUX -DSTG_TIME -c servconf.cpp servconf.cpp: In function `int AnsRecv(void*, std::list<std::string, std::allocator<std::string> >*)': servconf.cpp:68: warning: int format, XML_Size arg (arg 3) g++ -shared -Wl,-rpath,//usr/lib/stg -Wl,-soname,libsrvconf.so netunit.o parser.o servconf.o -o libsrvconf.so -L /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib ar rc libsrvconf.a netunit.o parser.o servconf.o ranlib libsrvconf.a cp *.so /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib cp *.a /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib gmake[2]: Leaving directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs/srvconf.lib' gmake[1]: Leaving directory `/home/soft/Stargazer/stg-2.405.9.8/stglibs' g++ main.o common_sg.o /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib/libconffiles.so /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib/libstg_common.so /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib/libsrvconf.so /usr/lib/libexpat.so /usr/lib/libpthread.so /usr/lib/libdl.so -Wl,-E -L/home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib -Wl,-rpath,//usr/lib/stg -Wl,-rpath-link,/home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib -o sgconf /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib/libsrvconf.so: undefined reference to `XML_ParserCreate' /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib/libsrvconf.so: undefined reference to `XML_GetErrorCode' /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib/libsrvconf.so: undefined reference to `XML_SetUserData' /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib/libsrvconf.so: undefined reference to `XML_ParserReset' /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib/libsrvconf.so: undefined reference to `XML_GetCurrentLineNumber' /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib/libsrvconf.so: undefined reference to `XML_ErrorString' /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib/libsrvconf.so: undefined reference to `XML_SetElementHandler' /home/soft/Stargazer/stg-2.405.9.8/projects/sgconf/../../lib/libsrvconf.so: undefined reference to `XML_Parse' collect2: ld returned 1 exit status gmake: *** [sgconf] Ошибк Link to post Share on other sites
madf 279 Posted 2009-04-21 11:19:21 Share Posted 2009-04-21 11:19:21 Добавь в stglibs/srvconf.lib/Makefile перед include ../Makefile.in строку LIBS += -lexpat как здесь: LIB_NAME = srvconf PROG = lib$(LIB_NAME) SRCS = netunit.cpp \ parser.cpp \ servconf.cpp INCS = servconf.h \ netunit.h LIBS += -lexpat include ../Makefile.in Link to post Share on other sites
Shtorm 0 Posted 2009-04-21 11:57:51 Share Posted 2009-04-21 11:57:51 скомпилилось но при запуске выдает ( либо надо строку параметров перечислить ) ./sgconf: error while loading shared libraries: libsrvconf.so: cannot open shared object file: No such file or directory Link to post Share on other sites
Shtorm 0 Posted 2009-04-22 06:02:07 Share Posted 2009-04-22 06:02:07 Собрал это http://stg.dp.ua/download/sgconf/1.04.9/sg....1.04.9.src.tgz Работает )))) Link to post Share on other sites
madf 279 Posted 2009-04-23 06:51:00 Share Posted 2009-04-23 06:51:00 скомпилилось но при запуске выдает ( либо надо строку параметров перечислить ) ./sgconf: error while loading shared libraries: libsrvconf.so: cannot open shared object file: No such file or directory Скопируй lib/libsrvconf.so в /usr/lib/stg Link to post Share on other sites
Shtorm 0 Posted 2009-04-23 10:54:14 Share Posted 2009-04-23 10:54:14 Спасибо за ответы , пока посижу на http://stg.dp.ua/download/sgconf/1.04.9/sg....1.04.9.src.tgz Одно не понятно , почему выложенный отдельно он собирается , а находящийся внутри сборки нет ))) Link to post Share on other sites
madf 279 Posted 2009-04-24 07:08:55 Share Posted 2009-04-24 07:08:55 А я писал выше почему. Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now