Проблема сборки PAPyRUS под OpenBSD 6.2
-
#BLA_BLA_BLA tcl/commandsAM.cc:466: undefined reference to `Tcl_SetObjResult' tcl/commandsAM.cc:471: undefined reference to `Tcl_AppendResult' tcl/commandsAM.o: In function `MoveCursorNextWord_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsAM.cc:383: undefined reference to `Tcl_NewByteArrayObj' tcl/commandsAM.cc:383: undefined reference to `Tcl_SetObjResult' tcl/commandsAM.cc:389: undefined reference to `Tcl_AppendResult' tcl/commandsAM.o: In function `CloseDocument_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsAM.cc:95: undefined reference to `Tcl_NewByteArrayObj' tcl/commandsAM.cc:95: undefined reference to `Tcl_SetObjResult' tcl/commandsAM.cc:100: undefined reference to `Tcl_SetVar2' tcl/commandsAM.o: In function `Debug_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsAM.cc:894: undefined reference to `Tcl_AppendResult' tcl/commandsAM.cc:908: undefined reference to `Tcl_AppendResult' tcl/commandsAM.o: In function `InsertImage_Cmd(void*, Tcl_Interp*, int, char**)': #BLA_BLA_BLA tcl/commandsAM.o: In function `MoveCursorXY_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsAM.cc:556: undefined reference to `Tcl_NewByteArrayObj' tcl/commandsAM.cc:556: undefined reference to `Tcl_SetObjResult' tcl/commandsAM.cc:560: undefined reference to `Tcl_GetInt' tcl/commandsAM.cc:563: undefined reference to `Tcl_GetInt' tcl/commandsAM.o: In function `DocumentConfigure_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsAM.cc:1247: undefined reference to `Tcl_AppendResult' tcl/commandsAM.cc:1227: undefined reference to `Tcl_AppendResult' tcl/commandsAM.o: In function `MoveCursorLeft_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsAM.cc:133: undefined reference to `Tcl_NewByteArrayObj' tcl/commandsAM.cc:133: undefined reference to `Tcl_SetObjResult' tcl/commandsAM.cc:145: undefined reference to `Tcl_AppendResult' tcl/commandsAM.o: In function `MoveCursorRight_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsAM.cc:192: undefined reference to `Tcl_NewByteArrayObj' tcl/commandsAM.cc:192: undefined reference to `Tcl_SetObjResult' tcl/commandsAM.cc:204: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.o: In function `WordOutput_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsNZ.cc:1260: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.cc:1249: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.o: In function `WordConfigure_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsNZ.cc:1185: undefined reference to `Tcl_GetInt' tcl/commandsNZ.cc:1191: undefined reference to `Tcl_GetBoolean' tcl/commandsNZ.cc:1194: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.cc:1172: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.cc:1166: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.o: In function `WordQuery_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsNZ.cc:1061: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.cc:1062: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.o:tcl/commandsNZ.cc:1057: more undefined references to `Tcl_AppendResult' follow tcl/commandsNZ.o: In function `SetKey_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsNZ.cc:969: undefined reference to `Tcl_NewByteArrayObj' tcl/commandsNZ.cc:969: undefined reference to `Tcl_SetObjResult' tcl/commandsNZ.o: In function `SetZoom_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsNZ.cc:912: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.cc:916: undefined reference to `Tcl_GetInt' tcl/commandsNZ.o: In function `NewDocument_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsNZ.cc:90: undefined reference to `Tcl_NewByteArrayObj' tcl/commandsNZ.cc:90: undefined reference to `Tcl_SetObjResult' tcl/commandsNZ.cc:94: undefined reference to `Tcl_SetVar2' tcl/commandsNZ.o: In function `PapyrusQuery_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsNZ.cc:491: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.cc:482: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.cc:494: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.o: In function `PapyrusConfigure_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsNZ.cc:398: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.cc:413: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.cc:427: undefined reference to `Tcl_GetBoolean' tcl/commandsNZ.cc:418: undefined reference to `Tcl_GetBoolean' tcl/commandsNZ.o: In function `NewParagraph_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsNZ.cc:138: undefined reference to `Tcl_NewByteArrayObj' tcl/commandsNZ.cc:138: undefined reference to `Tcl_SetObjResult' tcl/commandsNZ.cc:163: undefined reference to `Tcl_Eval' tcl/commandsNZ.cc:143: undefined reference to `Tcl_Eval' tcl/commandsNZ.cc:156: undefined reference to `Tcl_Eval' tcl/commandsNZ.cc:185: undefined reference to `Tcl_Eval' tcl/commandsNZ.o: In function `SelectRegion_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsNZ.cc:797: undefined reference to `Tcl_NewByteArrayObj' tcl/commandsNZ.cc:797: undefined reference to `Tcl_SetObjResult' tcl/commandsNZ.cc:801: undefined reference to `Tcl_GetInt' tcl/commandsNZ.cc:804: undefined reference to `Tcl_GetInt' tcl/commandsNZ.o: In function `NewWord_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsNZ.cc:263: undefined reference to `Tcl_NewByteArrayObj' tcl/commandsNZ.cc:263: undefined reference to `Tcl_SetObjResult' tcl/commandsNZ.cc:361: undefined reference to `Tcl_Eval' tcl/commandsNZ.cc:267: undefined reference to `Tcl_GetBoolean' tcl/commandsNZ.cc:286: undefined reference to `Tcl_Eval' tcl/commandsNZ.cc:291: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.o: In function `SetCursor_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsNZ.cc:1095: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.cc:1099: undefined reference to `Tcl_GetBoolean' tcl/commandsNZ.o: In function `ParagraphConfigure_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsNZ.cc:555: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.cc:572: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.cc:623: undefined reference to `Tcl_GetInt' tcl/commandsNZ.o: In function `ParagraphQuery_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsNZ.cc:721: undefined reference to `Tcl_AppendElement' tcl/commandsNZ.cc:718: undefined reference to `Tcl_AppendResult' tcl/commandsNZ.o: In function `RefreshScreen_Cmd(void*, Tcl_Interp*, int, char**)': tcl/commandsNZ.cc:755: undefined reference to `Tcl_NewByteArrayObj' tcl/commandsNZ.cc:755: undefined reference to `Tcl_SetObjResult' collect2: ld returned 1 exit status *** Error 1 in /home/Sataja/Downloads/Papyrus1.1.1 (Makefile:156 'bin/papyrus') $ exit Script done on Tue Oct 10 15:36:19 2023
-
Так, я прописал прямые ссылки на библиотеку tcl, устранил дублирование названий моих костылей list_c, т.е наплодил еще больше оных, PAPyRUS собрался, но его теперь не запустить. Пишет:
$ ./bin/papyrus X Error of failed request: BadDrawable (invalid Pixmap or Window parameter) Major opcode of failed request: 55 (X_CreateGC) Resource id in failed request: 0x7e0848d0 Serial number of failed request: 180 Current serial number in output stream: 182
glxgears работают исправно, поддержка OpenGL 2.0 - просто я искал на форумах, про это спрашивали со схожей ошибкой. Но тут явно не драйвера виноваты - я считаю надо выносить опции и параметры в конфиги, ибо пересобирать я задолбаюсь. -
Кстати, а разве можно хардкодить следующее:
char list_c[][32]={ "-visual", "*visual", "-depth", "*depth" }; XrmOptionDescRec Desc[] = { {list_c[0], list_c[1], XrmoptionSepArg, NULL}, {list_c[2], list_c[3], XrmoptionSepArg, NULL} };
?
И вообще там больше половины подобного, я считаю, надо вынести в отдельные конфигурационные файлы, ну или в один. -
AkhmedSataja:Так, я прописал прямые ссылки на библиотеку tcl, устранил дублирование названий моих костылей list_c, т.е наплодил еще больше оных, PAPyRUS собрался, но его теперь не запустить.
Ну слава богуAkhmedSataja:Кстати, а разве можно хардкодить следующее:char list_c[][32]={ "-visual", "*visual", "-depth", "*depth" }; XrmOptionDescRec Desc[] = { {list_c[0], list_c[1], XrmoptionSepArg, NULL}, {list_c[2], list_c[3], XrmoptionSepArg, NULL} };
?
И вообще там больше половины подобного, я считаю, надо вынести в отдельные конфигурационные файлы, ну или в один.
Захардкорить можно всё, надо знать как.
Единственное, будут ли они нормально из отдельных файлов работать?
$ ./bin/papyrus
X Error of failed request: BadDrawable (invalid Pixmap or Window parameter)
Major opcode of failed request: 55 (X_CreateGC)
Resource id in failed request: 0x7e0848d0
Serial number of failed request: 180
Current serial number in output stream: 182
Переменные окна посмотрите, разрешение, рамку и т.д. -
То есть, вот здесь смотреть:
int main(int argc, char*argv[]){ interactive_flag = (BOOL)TRUE; Get_Environment(); #ifdef HAVE_GUI Display *d; toplevel = XtVaAppInitialize(&app_context, "Papyrus", Desc, XtNumber(Desc), &argc, argv, NULL, NULL);
?olegus:AkhmedSataja:Единственное, будут ли они нормально из отдельных файлов работать?
Возможно, Вы правы. -
Методом тыка понял, что проблема в
xfs = XLoadQueryFont(disp, "fixed");
И, судя по тому, что при замене "fixed" на любые другие шрифты из вывода xlsfonts он выдает точно такую же ошибку, можно сделать вывод, что проблева с disp.void GUI_DrawPAPYRUS_Version(Widget dialog, Widget image) { printf("....Init:0.1\n"); Display *disp; printf("....Init:0.2\n"); Drawable draw; printf("....Init:0.3\n"); XGCValues gcv; printf("....Init:0.4\n"); XFontStruct *xfs; printf("....Init:0.5\n"); int x; printf("....Init:0.6\n"); GC gc; printf("....Init:0.7\n"); disp = XtDisplay(dialog); printf("....Init:0.8\n"); draw = XtWindow(image); printf("....Init:0.9\n"); gcv.function = GXcopy; printf("....Init:0.10\n"); gcv.foreground = BlackPixel(disp, DefaultScreen(disp)); printf("....Init:0.11\n"); gc = XCreateGC(disp, draw, GCFunction|GCForeground, &gcv); printf("....Init:0.12\n"); xfs = XLoadQueryFont(disp, "lucidasanstypewriter-bold-8"); printf("....Init:0.13\n"); x = XTextWidth(xfs, PAPYRUS_VERSION, strlen(PAPYRUS_VERSION)); printf("....Init:0.14\n"); XDrawString(disp, draw, gc, 340-x, 225, PAPYRUS_VERSION, strlen(PAPYRUS_VERSION)); printf("....Init:0.15\n"); x = XTextWidth(xfs, PAPYRUS_DATE, strlen(PAPYRUS_DATE)); printf("....Init:0.16\n"); XDrawString(disp, draw, gc, 340-x, 240, PAPYRUS_DATE, strlen(PAPYRUS_DATE)); printf("....Init:0.17\n"); XFreeGC(disp, gc); printf("....Init:0.18\n"); XFreeFont(disp, xfs); printf("....Init:0.19\n"); }
На бесчисленные printf прошу внимания не обращать - это костыли для определения бага. Ибо с отладчиком я не силен. -
Причем, здесь он не вылетает:
disp = XtDisplay(dialog);
Но явно что-то не то делает.
Я сделал не дело и закомментировал функцию:/*GUI_DrawPAPYRUS_Version()*/
После чего от вылетел на моменте инициализации TCL.
Выдает:papyrus(66563) in free(): bogus pointer (double free?) 0x7bff62c8 Abort trap (core dumped)
Короче, надо думать. -
Выходит, проблема с
, то есть, сif ( Tcl_AppInit(theInterp) != TCL_OK
Tcl_AppInit
, а вот это - уже серьезно.
gdb выдает:papyrus(62379) in free(): bogus pointer 0x85a55bc8 Program received signal SIGABRT, Aborted. thrkill () at -:3 3 -: No such file or directory. in - Current language: auto; currently asm (gdb) The program is running. Exit anyway? (y or n) y
Выпилить TCL я не могу, ибо на нем все приложение и держиться. -
системный язык вообще C
$ echo $LANG $LC_ALL C C
Пытался заделать даже локаль POSIX, коя есть, но, боюсь, проблема пока в самой программе.
Кстати, я никоим образом не сомневаюсь в вашей квалификации, и это совсем не в тему, но для перелючения раскладки в данной редакции OpenBSD используется файл конфигурационный, названный в инструкции /usr/X11R6/share/X11/xorg.conf.d/90-keyboard.conf:Section "InputClass" Identifier "system-keyboard" MatchIsKeyboard "on" Option "XkbLayout" "us,ru" Option "XkbModel" "pc101" Option "XkbVariant" "" Option "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll" EndSection