Parsing command line arguments using Glib



Hi,

I am trying to use GOption feature in my program to pass command line 
arguments. However, when I try to use GOption functions I am getting the 
following error.

g++  -g -O2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include     -o param  
param-scanner.o param.o param-driver.o param-parser.o
param.o: In function `main':./param.cc:17: undefined reference to 
`g_option_context_new'
:./param.cc:18: undefined reference to `g_option_context_add_main_entries'
:./param.cc:19: undefined reference to `g_option_context_parse'
:./param.cc:20: undefined reference to `g_option_context_free'
:./param.cc:22: undefined reference to `g_print'
collect2: ld returned 1 exit status

I found that GOption is only available in Glib>=2.6 and I checked it in 
configure.ac and and found it is available. However, it is only failing to 
locate above functions. Other GOption types referred correctly.(ex: 
gboolean,GOptionEntry,GOptionContext)

Please let me know your thoughts on this?

Thanks & Regards,

Randima




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]