Автор Тема: Как компелировать  (Прочитано 14215 раз)

Оффлайн him

  • Завсегдатай
  • *
  • Сообщений: 1 032
Как компелировать
« : 07.11.2018 14:44:15 »
есть проект:
https://github.com/dov/dovtk-lasso

Как его откомпилировать и попробовать тестовую программку ?

$ gcc -Wall -g -o test-dovtk-lasso test-dovtk-lasso.c `pkg-config --cflags --libs gtk+-2.0`/usr/bin/ld: /tmp/.private/user/ccpWSWRF.o: неопределённая ссылка на символ «atan2@@GLIBC_2.2.5»
/lib64/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Оффлайн yaleks

  • Мастер
  • ***
  • Сообщений: 6 222
Re: Как компелировать
« Ответ #1 : 07.11.2018 15:09:33 »
glibc-devel стоит?

Оффлайн him

  • Завсегдатай
  • *
  • Сообщений: 1 032
Re: Как компелировать
« Ответ #2 : 07.11.2018 15:11:53 »

Оффлайн Speccyfighter

  • Мастер
  • ***
  • Сообщений: 10 259

Оффлайн yaleks

  • Мастер
  • ***
  • Сообщений: 6 222

Оффлайн Skull

  • Глобальный модератор
  • *****
  • Сообщений: 19 908
    • Домашняя страница
    • Email
Re: Как компелировать
« Ответ #5 : 07.11.2018 19:33:57 »
Для DSO надо добавить линковщику -lm.
Андрей Черепанов (cas@)

Оффлайн him

  • Завсегдатай
  • *
  • Сообщений: 1 032
Re: Как компелировать
« Ответ #6 : 08.11.2018 08:42:18 »
$ gcc -Wall -pedantic -o test-dovtk-lasso test-dovtk-lasso.c `pkg-config --cflags --libs gtk+-2.0` -lm
In file included from test-dovtk-lasso.c:12:0:
dovtk-lasso.h:38:9: warning: struct has no members [-Wpedantic]
 typedef struct {
         ^
/tmp/.private/user/cczlIQnz.o: In function `draw_caliper':
test-dovtk-lasso.c:(.text+0x16f): undefined reference to `dovtk_lasso_set_color_label'
test-dovtk-lasso.c:(.text+0x251): undefined reference to `dovtk_lasso_set_color_label'
test-dovtk-lasso.c:(.text+0x45c): undefined reference to `dovtk_lasso_set_color_label'
/tmp/.private/user/cczlIQnz.o: In function `cb_button_press':
test-dovtk-lasso.c:(.text+0x944): undefined reference to `dovtk_lasso_get_label_for_pixel'
test-dovtk-lasso.c:(.text+0x9d3): undefined reference to `dovtk_lasso_update'
/tmp/.private/user/cczlIQnz.o: In function `cb_motion_notify':
test-dovtk-lasso.c:(.text+0xb18): undefined reference to `dovtk_lasso_update'
test-dovtk-lasso.c:(.text+0xb59): undefined reference to `dovtk_lasso_update'
/tmp/.private/user/cczlIQnz.o: In function `main':
test-dovtk-lasso.c:(.text+0xd03): undefined reference to `dovtk_lasso_create'
collect2: error: ld returned 1 exit status

$ grep -r 'draw_caliper' .
./test-dovtk-lasso.c:void draw_caliper(cairo_t *cr,
./test-dovtk-lasso.c:        draw_caliper(cr, DOVTK_LASSO_CONTEXT_PAINT, start_x, start_y, end_x, end_y);
./test-dovtk-lasso.c:        draw_caliper(cr,

https://github.com/stevengj/libctl/issues/1
https://www.linux.org.ru/forum/general/13253257

Кстати да - https://github.com/dov/dovtk-lasso/blob/master/SConstruct

надо при помощи  scons было собирать, а не "вручную".

Да, собралось.

$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o dovtk-lasso.o -c -Wall -g -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 dovtk-lasso.c
gcc -o test-dovtk-lasso.o -c -Wall -g -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 test-dovtk-lasso.c
gcc -o test-dovtk-lasso -pthread dovtk-lasso.o test-dovtk-lasso.o -lm -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 -lfreetype
scons: done building targets.

Ну а как надо было компелировать ? Что в make файл писать ?? Весть вывод scons  ?
Я просто планирую что то использовать, и тут получется что проблемы правильного кода лягут на мой кривой код и я этот клубок не распутаю.
« Последнее редактирование: 08.11.2018 09:36:32 от him »

Оффлайн Skull

  • Глобальный модератор
  • *****
  • Сообщений: 19 908
    • Домашняя страница
    • Email
Re: Как компелировать
« Ответ #7 : 08.11.2018 10:16:06 »
Страдать со SCons.
Андрей Черепанов (cas@)