jeudi 18 avril 2019

Undefined Reference errors when using dialog with ncurses

I'm trying to run this code after downloading and installing dialog but run into some undefined reference errors, what am I doing wrong?

I've installed from this link, run ./configure, make, sudo make install, sudo make install-full in the same order and it is successfully installed(no errors printed). In my /usr/local/include I can see dialog.h, dlg_colors.h, dlg_config.h and dlg_keys.h.

When I run g++ -ldialog -lncurses fdialog.cpp I get

 g++ -lncurses -ldialog fdialog.cpp 
/tmp/cc7mK1D2.o: In function `main':
fdialog.cpp:(.text+0x1d): undefined reference to `init_dialog'
fdialog.cpp:(.text+0x3a): undefined reference to `dialog_yesno'
fdialog.cpp:(.text+0x42): undefined reference to `end_dialog'
collect2: error: ld returned 1 exit status

Aucun commentaire:

Enregistrer un commentaire