I am using Dev-Cpp Version 4.9.9.2 with Windows Vista Home Premium.
I have question when linking the files with using g_timeout_add_seconds() that is belonged to the library libglib-2.0. After linking, the following error is shown
cannot find -libglib-2.0
ld returned 1 exit status
C:\temp\JRPanel_v11\Makefile.win [Build Error][JRPanel.exe] Error 1
I checked that "-libglib-2.0"(this option is provided by the Dev-Cpp installer) is added in the linker option and libglib-2.0.dll is existed in the folder of Dev-Cpp\lib.
Can anyone help me to solve this problem? Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can use the GNU nm.exe utility to inspect the symbols defined by a particular library.
Just to be sure you have linked the intended library, why don't you just try the explicit link option rather than relying on implicit library searches?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
screensaver.o(.text+0x1a8): In function ss_setup':
C:/temp/JRPanel_v11/screensaver.c:100: undefined reference tog_timeout_add_seconds'
iweather.o(.text+0xa8b): In function init_iweather':
C:/temp/JRPanel_v11/iweather.c:267: undefined reference tog_timeout_add_seconds'
rss.o(.text+0x395): In function init_rss':
C:/temp/JRPanel_v11/rss.c:164: undefined reference tog_timeout_add_seconds'
rss.o(.text+0x3b1):C:/temp/JRPanel_v11/rss.c:166: undefined reference to g_timeout_add_seconds'
pictureframe.o(.text+0x3c2): In functioninit_pictureFrame':
C:/temp/JRPanel_v11/pictureframe.c:190: undefined reference to `g_timeout_add_seconds'
collect2: ld returned 1 exit status
make.exe: *** [JRPanel.exe] Error 1
Execution terminated
It seems the linker can't find the reference `g_timeout_add_seconds' but I wondered glib and libglib are included, what's missing?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I believe that -llibglib-2.0 will cause the linker to look for a file liblibglib-2.0.a which is unlikely. The GNU linker assumes the lib prefix, so you should omit it. The earlier -lglib-2.0 will suffice, and will cause libglib-2.0.a to be linked if it exists in either if ; the project folder (C:\temp\JRPanel_v11), or "C:/Dev-Cpp/lib".
So is that is what the file is called and where it is? The most likely cause is teh file does not exists, has a different name, or is in a different folder. You can add more library folders with the -L option (or add them to the projects's Libraries directory list in the options dialog). Alternatively you can link the library by fully specifying its path and name (using the add object file or library button).
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks, I checked -llibglib-2.0 and -lglib-2.0 have the same meaning in the linker option, and one of these was deleted. I have 2 different version of libglib-2.0.dll.a but the compile result with using different version will have different errors.
iweather.o(.text+0x4c4): In function `weather_retrieve':
C:/temp/JRPanel_v11/iweather.c:91: undefined reference to g_spawn_command_line_sync'
clock_cfg.o(.text+0x6d): In functionrun_application':
C:/temp/JRPanel_v11/clock_cfg.c:41: undefined reference to g_spawn_command_line_sync'
rss.o(.text+0x47): In functionrss_refresh_data':
C:/temp/JRPanel_v11/rss.c:39: undefined reference to g_spawn_command_line_sync'
file_browser.o(.text+0x4e): In functionfile_browser':
C:/temp/JRPanel_v11/file_browser.c:26: undefined reference to `g_spawn_command_line_sync'
collect2: ld returned 1 exit status
C:/Dev-Cpp/lib/libglib-2.0.dll.a(.text+0x0):crtstuff.c: multiple definition of _onexit'
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../crt2.o(.text+0x270):crt1.c: first defined here
C:/Dev-Cpp/lib/libglib-2.0.dll.a(.text+0x30):crtstuff.c: multiple definition ofatexit'
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../crt2.o(.text+0x260):crt1.c: first defined here
C:/Dev-Cpp/lib/libglib-2.0.dll.a(.text+0x180):crtstuff.c: multiple definition of __do_sjlj_init'
C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/crtbegin.o(.text+0x0):crtstuff.c: first defined here
screensaver.o(.text+0x6b): In functionthread_screensaver':
C:/temp/JRPanel_v11/screensaver.c:55: undefined reference to _imp__g_threads_got_initialized'
screensaver.o(.text+0x75):C:/temp/JRPanel_v11/screensaver.c:55: undefined reference to_impg_thread_functions_for_glib_use'
screensaver.o(.text+0xb3):C:/temp/JRPanel_v11/screensaver.c:65: undefined reference to _imp__g_threads_got_initialized'
screensaver.o(.text+0xbd):C:/temp/JRPanel_v11/screensaver.c:65: undefined reference to_impg_thread_functions_for_glib_use'
screensaver.o(.text+0xe0):C:/temp/JRPanel_v11/screensaver.c:72: undefined reference to _imp__g_threads_got_initialized'
screensaver.o(.text+0xea):C:/temp/JRPanel_v11/screensaver.c:72: undefined reference to_impg_thread_functions_for_glib_use'
screensaver.o(.text+0x106):C:/temp/JRPanel_v11/screensaver.c:76: undefined reference to _imp__g_threads_got_initialized'
screensaver.o(.text+0x110):C:/temp/JRPanel_v11/screensaver.c:76: undefined reference to_impg_thread_functions_for_glib_use'
screensaver.o(.text+0x165): In function ss_setup':
C:/temp/JRPanel_v11/screensaver.c:97: undefined reference to_impg_threads_got_initialized'
screensaver.o(.text+0x16f):C:/temp/JRPanel_v11/screensaver.c:97: undefined reference to _imp__g_thread_functions_for_glib_use'
screensaver.o(.text+0x1c5):C:/temp/JRPanel_v11/screensaver.c:105: undefined reference to_impg_threads_got_initialized'
screensaver.o(.text+0x1cf):C:/temp/JRPanel_v11/screensaver.c:105: undefined reference to _imp__g_thread_functions_for_glib_use'
screensaver.o(.text+0x1ea): In functioninit_screensaver':
C:/temp/JRPanel_v11/screensaver.c:111: undefined reference to _imp__g_thread_functions_for_glib_use'
screensaver.o(.text+0x1f8):C:/temp/JRPanel_v11/screensaver.c:114: undefined reference to_impg_threads_got_initialized'
screensaver.o(.text+0x202):C:/temp/JRPanel_v11/screensaver.c:114: undefined reference to _imp__g_thread_functions_for_glib_use'
screensaver.o(.text+0x233):C:/temp/JRPanel_v11/screensaver.c:118: undefined reference to_impg_threads_got_initialized'
screensaver.o(.text+0x23d):C:/temp/JRPanel_v11/screensaver.c:118: undefined reference to _imp__g_thread_functions_for_glib_use'
C:/temp/JRPanel_v11/alarm.c:616: undefined reference to_impg_threads_got_initialized'
alarm.o(.text+0x12cd):C:/temp/JRPanel_v11/alarm.c:616: undefined reference to _imp__g_thread_functions_for_glib_use'
alarm.o(.text+0x13aa):C:/temp/JRPanel_v11/alarm.c:636: undefined reference to_impg_threads_got_initialized'
alarm.o(.text+0x13b4):C:/temp/JRPanel_v11/alarm.c:636: undefined reference to _imp__g_thread_functions_for_glib_use'
alarm.o(.text+0x13d7):C:/temp/JRPanel_v11/alarm.c:641: undefined reference to_impg_threads_got_initialized'
alarm.o(.text+0x13e1):C:/temp/JRPanel_v11/alarm.c:641: undefined reference to _imp__g_thread_functions_for_glib_use'
alarm.o(.text+0x13f6):C:/temp/JRPanel_v11/alarm.c:647: undefined reference to_impg_threads_got_initialized'
alarm.o(.text+0x1400):C:/temp/JRPanel_v11/alarm.c:647: undefined reference to _imp__g_thread_functions_for_glib_use'
alarm.o(.text+0x141e):C:/temp/JRPanel_v11/alarm.c:651: undefined reference to_impg_threads_got_initialized'
alarm.o(.text+0x1428):C:/temp/JRPanel_v11/alarm.c:651: undefined reference to _imp__g_thread_functions_for_glib_use'
alarm.o(.text+0x14cc):C:/temp/JRPanel_v11/alarm.c:675: undefined reference to_impg_threads_got_initialized'
alarm.o(.text+0x14d6):C:/temp/JRPanel_v11/alarm.c:675: undefined reference to _imp__g_thread_functions_for_glib_use'
alarm.o(.text+0x14f1): In functionalarm_snooze':
C:/temp/JRPanel_v11/alarm.c:682: undefined reference to _imp__g_threads_got_initialized'
alarm.o(.text+0x14fb):C:/temp/JRPanel_v11/alarm.c:682: undefined reference to_impg_thread_functions_for_glib_use'
alarm.o(.text+0x1518):C:/temp/JRPanel_v11/alarm.c:686: undefined reference to `_impg_threads_got_initialized'
alarm.o(.text+0x1522):C:/temp/JRPanel_v11/alarm.c:686: undefined reference to _imp__g_thread_functions_for_glib_use'
alarm.o(.text+0x1542): In functionalarm_off':
C:/temp/JRPanel_v11/alarm.c:695: undefined reference to _imp__g_threads_got_initialized'
alarm.o(.text+0x154c):C:/temp/JRPanel_v11/alarm.c:695: undefined reference to_impg_thread_functions_for_glib_use'
alarm.o(.text+0x1573):C:/temp/JRPanel_v11/alarm.c:700: undefined reference to _imp__g_threads_got_initialized'
alarm.o(.text+0x157d):C:/temp/JRPanel_v11/alarm.c:700: undefined reference to_impg_thread_functions_for_glib_use'
C:\Dev-Cpp\Bin..\lib\gcc\mingw32\3.4.2........\mingw32\bin\ld.exe: BFD 2.15.91 20040904 assertion fail ../../src/bfd/cofflink.c:2269
C:\Dev-Cpp\Bin..\lib\gcc\mingw32\3.4.2........\mingw32\bin\ld.exe: C:/Dev-Cpp/lib/libglib-2.0.dll.a(dkxs00080.o): illegal symbol index -96877815 in relocs
C:\Dev-Cpp\Bin..\lib\gcc\mingw32\3.4.2........\mingw32\bin\ld.exe: final link failed: Invalid operation
collect2: ld returned 1 exit status
make.exe: *** [JRPanel.exe] Error 1
Execution terminated
I don't know which other version I should use and I'm afraid that I can't find a suitable version for my program.
Jackie
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everyone,
I am using Dev-Cpp Version 4.9.9.2 with Windows Vista Home Premium.
I have question when linking the files with using g_timeout_add_seconds() that is belonged to the library libglib-2.0. After linking, the following error is shown
cannot find -libglib-2.0
ld returned 1 exit status
C:\temp\JRPanel_v11\Makefile.win [Build Error] [JRPanel.exe] Error 1
I checked that "-libglib-2.0"(this option is provided by the Dev-Cpp installer) is added in the linker option and libglib-2.0.dll is existed in the folder of Dev-Cpp\lib.
Can anyone help me to solve this problem? Thanks!
If the export library is called libglib-2.0.dll.a, then the linker option must be -lglib-2.0.dll
You can use the GNU nm.exe utility to inspect the symbols defined by a particular library.
Just to be sure you have linked the intended library, why don't you just try the explicit link option rather than relying on implicit library searches?
AMENDMENT
compile log:
Compiler: Default compiler
Building Makefile: "C:\temp\JRPanel_v11\Makefile.win"
Executing make...
make.exe -f "C:\temp\JRPanel_v11\Makefile.win" all
gcc.exe -DDEBUG main.o gui.o screensaver.o clock.o jrpanel.o iradio.o iweather.o clock_cfg.o keyboard.o wifi.o listbox.o wifi_status.o rss.o pictureframe.o alarm.o clock_s.o file_browser.o -o "JRPanel.exe" -L"C:/Dev-Cpp/lib" -mwindows -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -libglib-2.0 -llibglade-2.0 -lgthread-2.0 -g3
C:\Dev-Cpp\Bin..\lib\gcc\mingw32\3.4.2........\mingw32\bin\ld.exe: cannot find -libglib-2.0
collect2: ld returned 1 exit status
make.exe: *** [JRPanel.exe] Error 1
Execution terminated
COMPLEMENTARY
I guess "-libglib-2.0" was wrong to fill as the link option, then I changed to "-llibglib-2.0" but another error is shown
Compiler: Default compiler
Building Makefile: "C:\temp\JRPanel_v11\Makefile.win"
Executing make clean
rm -f main.o gui.o screensaver.o clock.o jrpanel.o iradio.o iweather.o clock_cfg.o keyboard.o wifi.o listbox.o wifi_status.o rss.o pictureframe.o alarm.o clock_s.o file_browser.o JRPanel.exe
gcc.exe -DDEBUG -c main.c -o main.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c gui.c -o gui.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c screensaver.c -o screensaver.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c clock.c -o clock.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c jrpanel.c -o jrpanel.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c iradio.c -o iradio.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c iweather.c -o iweather.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c clock_cfg.c -o clock_cfg.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c keyboard.c -o keyboard.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c wifi.c -o wifi.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c listbox.c -o listbox.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c wifi_status.c -o wifi_status.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c rss.c -o rss.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c pictureframe.c -o pictureframe.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c alarm.c -o alarm.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c clock_s.c -o clock_s.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG -c file_browser.c -o file_browser.o -I"C:/Dev-Cpp/include" -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include..\lib\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include..\lib\glib-2.0\include" -I"C:\Dev-Cpp\include\libglade-2.0" -mms-bitfields -g3
gcc.exe -DDEBUG main.o gui.o screensaver.o clock.o jrpanel.o iradio.o iweather.o clock_cfg.o keyboard.o wifi.o listbox.o wifi_status.o rss.o pictureframe.o alarm.o clock_s.o file_browser.o -o "JRPanel.exe" -L"C:/Dev-Cpp/lib" -mwindows -lgtk-win32-2.0 -lgdk-win32-2.0 -lgthread-2.0 -llibglade-2.0 -latk-1.0 -lpango-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lglib-2.0 -lgobject-2.0 -lgmodule-2.0 -llibglib-2.0 -g3
screensaver.o(.text+0x1a8): In function
ss_setup': C:/temp/JRPanel_v11/screensaver.c:100: undefined reference to
g_timeout_add_seconds'iweather.o(.text+0xa8b): In function
init_iweather': C:/temp/JRPanel_v11/iweather.c:267: undefined reference to
g_timeout_add_seconds'rss.o(.text+0x395): In function
init_rss': C:/temp/JRPanel_v11/rss.c:164: undefined reference to
g_timeout_add_seconds'rss.o(.text+0x3b1):C:/temp/JRPanel_v11/rss.c:166: undefined reference to
g_timeout_add_seconds' pictureframe.o(.text+0x3c2): In function
init_pictureFrame':C:/temp/JRPanel_v11/pictureframe.c:190: undefined reference to `g_timeout_add_seconds'
collect2: ld returned 1 exit status
make.exe: *** [JRPanel.exe] Error 1
Execution terminated
It seems the linker can't find the reference `g_timeout_add_seconds' but I wondered glib and libglib are included, what's missing?
I believe that -llibglib-2.0 will cause the linker to look for a file liblibglib-2.0.a which is unlikely. The GNU linker assumes the lib prefix, so you should omit it. The earlier -lglib-2.0 will suffice, and will cause libglib-2.0.a to be linked if it exists in either if ; the project folder (C:\temp\JRPanel_v11), or "C:/Dev-Cpp/lib".
So is that is what the file is called and where it is? The most likely cause is teh file does not exists, has a different name, or is in a different folder. You can add more library folders with the -L option (or add them to the projects's Libraries directory list in the options dialog). Alternatively you can link the library by fully specifying its path and name (using the add object file or library button).
Clifford
Hi Clifford or other people,
Thanks, I checked -llibglib-2.0 and -lglib-2.0 have the same meaning in the linker option, and one of these was deleted. I have 2 different version of libglib-2.0.dll.a but the compile result with using different version will have different errors.
If using glib 2.14, the compile log is
Compiler: Default compiler
Building Makefile: "C:\temp\JRPanel_v11\Makefile.win"
Executing make...
make.exe -f "C:\temp\JRPanel_v11\Makefile.win" all
gcc.exe -DDEBUG main.o gui.o screensaver.o clock.o jrpanel.o iradio.o iweather.o clock_cfg.o keyboard.o wifi.o listbox.o wifi_status.o rss.o pictureframe.o alarm.o clock_s.o file_browser.o -o "JRPanel.exe" -L"C:/Dev-Cpp/lib" -mwindows -lgtk-win32-2.0 -lgdk-win32-2.0 -lgthread-2.0 -llibglade-2.0 -latk-1.0 -lpango-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -g3
iweather.o(.text+0x4c4): In function `weather_retrieve':
C:/temp/JRPanel_v11/iweather.c:91: undefined reference to
g_spawn_command_line_sync' clock_cfg.o(.text+0x6d): In function
run_application':C:/temp/JRPanel_v11/clock_cfg.c:41: undefined reference to
g_spawn_command_line_sync' rss.o(.text+0x47): In function
rss_refresh_data':C:/temp/JRPanel_v11/rss.c:39: undefined reference to
g_spawn_command_line_sync' file_browser.o(.text+0x4e): In function
file_browser':C:/temp/JRPanel_v11/file_browser.c:26: undefined reference to `g_spawn_command_line_sync'
collect2: ld returned 1 exit status
make.exe: *** [JRPanel.exe] Error 1
Execution terminated
If using glib 2.18, the compile log is
Compiler: Default compiler
Building Makefile: "C:\temp\JRPanel_v11\Makefile.win"
Executing make...
make.exe -f "C:\temp\JRPanel_v11\Makefile.win" all
gcc.exe -DDEBUG main.o gui.o screensaver.o clock.o jrpanel.o iradio.o iweather.o clock_cfg.o keyboard.o wifi.o listbox.o wifi_status.o rss.o pictureframe.o alarm.o clock_s.o file_browser.o -o "JRPanel.exe" -L"C:/Dev-Cpp/lib" -mwindows -lgtk-win32-2.0 -lgdk-win32-2.0 -lgthread-2.0 -llibglade-2.0 -latk-1.0 -lpango-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -g3
C:/Dev-Cpp/lib/libglib-2.0.dll.a(.text+0x0):crtstuff.c: multiple definition of
_onexit' C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../crt2.o(.text+0x270):crt1.c: first defined here C:/Dev-Cpp/lib/libglib-2.0.dll.a(.text+0x30):crtstuff.c: multiple definition of
atexit'C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/../../../crt2.o(.text+0x260):crt1.c: first defined here
C:/Dev-Cpp/lib/libglib-2.0.dll.a(.text+0x180):crtstuff.c: multiple definition of
__do_sjlj_init' C:/Dev-Cpp/Bin/../lib/gcc/mingw32/3.4.2/crtbegin.o(.text+0x0):crtstuff.c: first defined here screensaver.o(.text+0x6b): In function
thread_screensaver':C:/temp/JRPanel_v11/screensaver.c:55: undefined reference to
_imp__g_threads_got_initialized' screensaver.o(.text+0x75):C:/temp/JRPanel_v11/screensaver.c:55: undefined reference to
_impg_thread_functions_for_glib_use'screensaver.o(.text+0xb3):C:/temp/JRPanel_v11/screensaver.c:65: undefined reference to
_imp__g_threads_got_initialized' screensaver.o(.text+0xbd):C:/temp/JRPanel_v11/screensaver.c:65: undefined reference to
_impg_thread_functions_for_glib_use'screensaver.o(.text+0xe0):C:/temp/JRPanel_v11/screensaver.c:72: undefined reference to
_imp__g_threads_got_initialized' screensaver.o(.text+0xea):C:/temp/JRPanel_v11/screensaver.c:72: undefined reference to
_impg_thread_functions_for_glib_use'screensaver.o(.text+0x106):C:/temp/JRPanel_v11/screensaver.c:76: undefined reference to
_imp__g_threads_got_initialized' screensaver.o(.text+0x110):C:/temp/JRPanel_v11/screensaver.c:76: undefined reference to
_impg_thread_functions_for_glib_use'screensaver.o(.text+0x165): In function
ss_setup': C:/temp/JRPanel_v11/screensaver.c:97: undefined reference to
_impg_threads_got_initialized'screensaver.o(.text+0x16f):C:/temp/JRPanel_v11/screensaver.c:97: undefined reference to
_imp__g_thread_functions_for_glib_use' screensaver.o(.text+0x1c5):C:/temp/JRPanel_v11/screensaver.c:105: undefined reference to
_impg_threads_got_initialized'screensaver.o(.text+0x1cf):C:/temp/JRPanel_v11/screensaver.c:105: undefined reference to
_imp__g_thread_functions_for_glib_use' screensaver.o(.text+0x1ea): In function
init_screensaver':C:/temp/JRPanel_v11/screensaver.c:111: undefined reference to
_imp__g_thread_functions_for_glib_use' screensaver.o(.text+0x1f8):C:/temp/JRPanel_v11/screensaver.c:114: undefined reference to
_impg_threads_got_initialized'screensaver.o(.text+0x202):C:/temp/JRPanel_v11/screensaver.c:114: undefined reference to
_imp__g_thread_functions_for_glib_use' screensaver.o(.text+0x233):C:/temp/JRPanel_v11/screensaver.c:118: undefined reference to
_impg_threads_got_initialized'screensaver.o(.text+0x23d):C:/temp/JRPanel_v11/screensaver.c:118: undefined reference to
_imp__g_thread_functions_for_glib_use' C:/temp/JRPanel_v11/alarm.c:616: undefined reference to
_impg_threads_got_initialized'alarm.o(.text+0x12cd):C:/temp/JRPanel_v11/alarm.c:616: undefined reference to
_imp__g_thread_functions_for_glib_use' alarm.o(.text+0x13aa):C:/temp/JRPanel_v11/alarm.c:636: undefined reference to
_impg_threads_got_initialized'alarm.o(.text+0x13b4):C:/temp/JRPanel_v11/alarm.c:636: undefined reference to
_imp__g_thread_functions_for_glib_use' alarm.o(.text+0x13d7):C:/temp/JRPanel_v11/alarm.c:641: undefined reference to
_impg_threads_got_initialized'alarm.o(.text+0x13e1):C:/temp/JRPanel_v11/alarm.c:641: undefined reference to
_imp__g_thread_functions_for_glib_use' alarm.o(.text+0x13f6):C:/temp/JRPanel_v11/alarm.c:647: undefined reference to
_impg_threads_got_initialized'alarm.o(.text+0x1400):C:/temp/JRPanel_v11/alarm.c:647: undefined reference to
_imp__g_thread_functions_for_glib_use' alarm.o(.text+0x141e):C:/temp/JRPanel_v11/alarm.c:651: undefined reference to
_impg_threads_got_initialized'alarm.o(.text+0x1428):C:/temp/JRPanel_v11/alarm.c:651: undefined reference to
_imp__g_thread_functions_for_glib_use' alarm.o(.text+0x14cc):C:/temp/JRPanel_v11/alarm.c:675: undefined reference to
_impg_threads_got_initialized'alarm.o(.text+0x14d6):C:/temp/JRPanel_v11/alarm.c:675: undefined reference to
_imp__g_thread_functions_for_glib_use' alarm.o(.text+0x14f1): In function
alarm_snooze':C:/temp/JRPanel_v11/alarm.c:682: undefined reference to
_imp__g_threads_got_initialized' alarm.o(.text+0x14fb):C:/temp/JRPanel_v11/alarm.c:682: undefined reference to
_impg_thread_functions_for_glib_use'alarm.o(.text+0x1518):C:/temp/JRPanel_v11/alarm.c:686: undefined reference to `_impg_threads_got_initialized'
alarm.o(.text+0x1522):C:/temp/JRPanel_v11/alarm.c:686: undefined reference to
_imp__g_thread_functions_for_glib_use' alarm.o(.text+0x1542): In function
alarm_off':C:/temp/JRPanel_v11/alarm.c:695: undefined reference to
_imp__g_threads_got_initialized' alarm.o(.text+0x154c):C:/temp/JRPanel_v11/alarm.c:695: undefined reference to
_impg_thread_functions_for_glib_use'alarm.o(.text+0x1573):C:/temp/JRPanel_v11/alarm.c:700: undefined reference to
_imp__g_threads_got_initialized' alarm.o(.text+0x157d):C:/temp/JRPanel_v11/alarm.c:700: undefined reference to
_impg_thread_functions_for_glib_use'C:\Dev-Cpp\Bin..\lib\gcc\mingw32\3.4.2........\mingw32\bin\ld.exe: BFD 2.15.91 20040904 assertion fail ../../src/bfd/cofflink.c:2269
C:\Dev-Cpp\Bin..\lib\gcc\mingw32\3.4.2........\mingw32\bin\ld.exe: C:/Dev-Cpp/lib/libglib-2.0.dll.a(dkxs00080.o): illegal symbol index -96877815 in relocs
C:\Dev-Cpp\Bin..\lib\gcc\mingw32\3.4.2........\mingw32\bin\ld.exe: final link failed: Invalid operation
collect2: ld returned 1 exit status
make.exe: *** [JRPanel.exe] Error 1
Execution terminated
I don't know which other version I should use and I'm afraid that I can't find a suitable version for my program.
Jackie