GCC undefined references on build - go

I am trying to build an exe for windows amd64 using golang. Everything is running smoothly except on "go run" or "go build". The build process is breaking on gcc compile of the package from github.com/andlabs/ui. The trace goes as follows:
$ go build
# gitlab.com/asnossascenas/dbRegistration/ui
C:\Users\Pat\AppData\Local\Temp\go-
build167765418\gitlab.com\asnossascenas\dbRegistration\ui\_obj\table.cgo2.o:
In function `_cgo_1e2a701ee86d_Cfunc_uiNewTable':
/tmp/go-build\gitlab.com\asnossascenas\dbRegistration\ui\_obj/cgo-gcc-
prolog:66: undefined reference to `uiNewTable'
C:\Users\Pat\AppData\Local\Temp\go-
build167765418\gitlab.com\asnossascenas\dbRegistration\ui\_obj\table.cgo2.o:
In function `_cgo_1e2a701ee86d_Cfunc_uiNewTableModel':
/tmp/go-build\gitlab.com\asnossascenas\dbRegistration\ui\_obj/cgo-gcc-
prolog:83: undefined reference to `uiNewTableModel'
C:\Users\Pat\AppData\Local\Temp\go-
build167765418\gitlab.com\asnossascenas\dbRegistration\ui\_obj\table.cgo2.o:
In function `_cgo_1e2a701ee86d_Cfunc_uiTableAppendTextColumn':
/tmp/go-build\gitlab.com\asnossascenas\dbRegistration\ui\_obj/cgo-gcc-
prolog:103: undefined reference to `uiTableAppendTextColumn'
C:\Users\Pat\AppData\Local\Temp\go-
build167765418\gitlab.com\asnossascenas\dbRegistration\ui\_obj\table.cgo2.o:
In function `_cgo_1e2a701ee86d_Cfunc_uiTableGetSelection':
/tmp/go-build\gitlab.com\asnossascenas\dbRegistration\ui\_obj/cgo-gcc-
prolog:120: undefined reference to `uiTableGetSelection'
C:\Users\Pat\AppData\Local\Temp\go-
build167765418\gitlab.com\asnossascenas\dbRegistration\ui\_obj\table.cgo2.o:
In function `_cgo_1e2a701ee86d_Cfunc_uiTableIterAdvance':
/tmp/go-build\gitlab.com\asnossascenas\dbRegistration\ui\_obj/cgo-gcc-
prolog:138: undefined reference to `uiTableIterAdvance'
C:\Users\Pat\AppData\Local\Temp\go-
build167765418\gitlab.com\asnossascenas\dbRegistration\ui\_obj\table.cgo2.o:
In function `_cgo_1e2a701ee86d_Cfunc_uiTableIterCurrent':
/tmp/go-build\gitlab.com\asnossascenas\dbRegistration\ui\_obj/cgo-gcc-
prolog:168: undefined reference to `uiTableIterCurrent'
C:\Users\Pat\AppData\Local\Temp\go-
build167765418\gitlab.com\asnossascenas\dbRegistration\ui\_obj\table.cgo2.o:
In function `realuiTableOnSelectionChanged':
C:/GoPath/src/gitlab.com/asnossascenas/dbRegistration/ui/table.go:12:
undefined reference to `uiTableOnSelectionChanged'
C:\Users\Pat\AppData\Local\Temp\go-
build167765418\gitlab.com\asnossascenas\dbRegistration\ui\_obj\table.cgo2.o:
In function `_cgo_1e2a701ee86d_Cfunc_uiFreeTableModel':
/tmp/go-build\gitlab.com\asnossascenas\dbRegistration\ui\_obj/cgo-gcc-
prolog:49: undefined reference to `uiFreeTableModel'
C:\Users\Pat\AppData\Local\Temp\go-
build167765418\gitlab.com\asnossascenas\dbRegistration\ui\_obj\table.cgo2.o:
In function `_cgo_1e2a701ee86d_Cfunc_uiTableIterComplete':
/tmp/go-build\gitlab.com\asnossascenas\dbRegistration\ui\_obj/cgo-gcc-
prolog:152: undefined reference to `uiTableIterComplete'
C:\Users\Pat\AppData\Local\Temp\go-
build167765418\gitlab.com\asnossascenas\dbRegistration\ui\_obj\table.cgo2.o:
In function `_cgo_1e2a701ee86d_Cfunc_uiTableModelRowChanged':
/tmp/go-build\gitlab.com\asnossascenas\dbRegistration\ui\_obj/cgo-gcc-
prolog:184: undefined reference to `uiTableModelRowChanged'
C:\Users\Pat\AppData\Local\Temp\go-
build167765418\gitlab.com\asnossascenas\dbRegistration\ui\_obj\table.cgo2.o:
In function `_cgo_1e2a701ee86d_Cfunc_uiTableModelRowDeleted':
/tmp/go-build\gitlab.com\asnossascenas\dbRegistration\ui\_obj/cgo-gcc-
prolog:198: undefined reference to `uiTableModelRowDeleted'
C:\Users\Pat\AppData\Local\Temp\go-
build167765418\gitlab.com\asnossascenas\dbRegistration\ui\_obj\table.cgo2.o:
In function `_cgo_1e2a701ee86d_Cfunc_uiTableModelRowInserted':
/tmp/go-build\gitlab.com\asnossascenas\dbRegistration\ui\_obj/cgo-gcc-
prolog:212: undefined reference to `uiTableModelRowInserted'
C:\Users\Pat\AppData\Local\Temp\gobuild167765418\gitlab.com
\asnossascenas\dbRegistration\ui\_obj\tablemodelhandler.cgo2.o: In function
`_cgo_1e2a701ee86d_Cfunc_uiTableModelStrdup':
/tmp/go-build\gitlab.com\asnossascenas\dbRegistration\ui\_obj/cgo-gcc-
prolog:68: undefined reference to `uiTableModelStrdup'o `uiTableModelStrdup'
function `msgbox':
C:/GoPath/src/gitlab.com/asnossascenas/
dbRegistration/ui/libui_windows_amd64.a(stddialogs.cpp.obj): In function
`msgbox':E:/github.com/andlabs/libui/windows/stddialogs.cpp:113: undefined
reference to `__imp_TaskDialog'
collect2.exe: error: ld returned 1 exit status
I initially tried to crosscompile from linux to windows having roughly the same problem so I guess it's a matter of either the flags I should use to build it or maybe I am missing something dependency related...
I tried using CGO_ENABLED=1 and pretty much every other combination of flags possible on linux to crosscompile, sometimes triggering the error
gcc: error: unrecognized command line option ‘-mthreads’
eventually I decided I should move to Windows and compile natively, which doesn't seem to be working.
I am willing to provide any more information you might need to help me figure this out.

According to the the installation instructions for the ui package you will need to install MingW and set some some environment variables to get it to build:
set CGO_ENABLED=1
set CC=C:\PROGRA~1\mingw-w64\x86_64-7.2.0-win32-seh-rt_v5-rev1\mingw64\bin\gcc.exe
set CXX=C:\PROGRA~1\mingw-w64\x86_64-7.2.0-win32-seh-rt_v5-rev1\mingw64\bin\g++.exe
go build -ldflags -H=windowsgui

Related

/usr/bin/ld: cannot find -lnetcdf?

First of all, this is my first question on here. If I make mistake, I'm sorry about that. By the way I'm a newbie in Fortran. I want to compile the "MMIF" model and the model has a compiler "makefile". I edited my "makefile" but I have an error message. When I used the make command, I'm getting this error:
...
/usr/bin/ld: cannot find -lnetcdf
collect2: error: ld returned 1 exit status
makefile:62: recipe for target 'mmif' failed
make: *** [mmif] Error 1
When I checked the location, I realised libnetcdf.a is missing. I don't know if it is needed in order to run the "makefile". Can you help me with this situation?
...
/usr/lib/x86_64-linux-gnu/libnetcdff.a
/usr/lib/x86_64-linux-gnu/libnetcdff.so
/usr/lib/x86_64-linux-gnu/libnetcdff.so.6
/usr/lib/x86_64-linux-gnu/libnetcdff.so.6.1.1
/usr/lib/x86_64-linux-gnu/libnetcdf.settings
/usr/lib/x86_64-linux-gnu/libnetcdf.so
/usr/lib/x86_64-linux-gnu/libnetcdf.so.13
...
Update 1
Thanks for helping and guiding me. I changed -lnetcdf to -lnetcdff. It works but I have a another problem now. I'm getting so many "undefined reference to..". Now, I'm trying to resolve these problems.
Error Code
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_put_att_text_':
(.text+0xb3): undefined reference to `nc_put_att_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_put_att_text_a_':
(.text+0x193): undefined reference to `nc_put_att_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_put_att_int1_':
(.text+0x277): undefined reference to `nc_put_att_schar'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_put_att_int2_':
(.text+0x357): undefined reference to `nc_put_att_short'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_put_att_int_':
(.text+0x437): undefined reference to `nc_put_att_int'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_put_att_real_':
(.text+0x517): undefined reference to `nc_put_att_float'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_put_att_double_':
(.text+0x5f7): undefined reference to `nc_put_att_double'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_get_att_text_':
(.text+0x745): undefined reference to `nc_get_att_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_get_att_text_a_':
(.text+0x846): undefined reference to `nc_get_att_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_get_att_int1_':
(.text+0x916): undefined reference to `nc_get_att_schar'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_get_att_int2_':
(.text+0x9e6): undefined reference to `nc_get_att_short'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_get_att_int_':
(.text+0xab6): undefined reference to `nc_get_att_int'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_get_att_real_':
(.text+0xb86): undefined reference to `nc_get_att_float'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_attio.o): In function `nf_get_att_double_':
(.text+0xc56): undefined reference to `nc_get_att_double'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_create_':
(.text+0xa1): undefined reference to `nc_create'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf__create_':
(.text+0x19a): undefined reference to `nc__create'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf__create_mp_':
(.text+0x292): undefined reference to `nc__create_mp'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_open_':
(.text+0x371): undefined reference to `nc_open'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf__open_':
(.text+0x45d): undefined reference to `nc__open'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf__open_mp_':
(.text+0x557): undefined reference to `nc__open_mp'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_open_mem_':
(.text+0x63c): undefined reference to `nc_open_mem'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_inq_path_':
(.text+0x78d): undefined reference to `nc_inq_path'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_set_fill_':
(.text+0x8ba): undefined reference to `nc_set_fill'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_set_default_format_':
(.text+0x910): undefined reference to `nc_set_default_format'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_delete_':
(.text+0xa3a): undefined reference to `nc_delete'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_delete_mp_':
(.text+0xb02): undefined reference to `nc_delete_mp'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_inq_base_pe_':
(.text+0xb60): undefined reference to `nc_inq_base_pe'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_redef_':
(.text+0x943): undefined reference to `nc_redef'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_enddef_':
(.text+0x953): undefined reference to `nc_enddef'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf__enddef_':
(.text+0x96f): undefined reference to `nc__enddef'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_sync_':
(.text+0x983): undefined reference to `nc_sync'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_abort_':
(.text+0x993): undefined reference to `nc_abort'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_close_':
(.text+0x9a3): undefined reference to `nc_close'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_control.o): In function `nf_set_base_pe_':
(.text+0xb35): undefined reference to `nc_set_base_pe'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_dim.o): In function `nf_def_dim_':
(.text+0xb7): undefined reference to `nc_def_dim'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_dim.o): In function `nf_inq_dim_':
(.text+0x24c): undefined reference to `nc_inq_dim'
(.text+0x2a6): undefined reference to `nc_inq_dim'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_dim.o): In function `nf_inq_dimid_':
(.text+0x45d): undefined reference to `nc_inq_dimid'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_dim.o): In function `nf_inq_dimlen_':
(.text+0x4c9): undefined reference to `nc_inq_dimlen'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_dim.o): In function `nf_inq_dimname_':
(.text+0x63f): undefined reference to `nc_inq_dimname'
(.text+0x691): undefined reference to `nc_inq_dimname'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_dim.o): In function `nf_rename_dim_':
(.text+0x82e): undefined reference to `nc_rename_dim'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_def_var_':
(.text+0x111): undefined reference to `nc_def_var'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_inq_varndims_':
(.text+0x1a5): undefined reference to `nc_inq_varndims'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_inq_var_':
(.text+0x2f8): undefined reference to `nc_inq_varndims'
(.text+0x363): undefined reference to `nc_inq_var'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_inq_vardimid_':
(.text+0x550): undefined reference to `nc_inq_varndims'
(.text+0x59a): undefined reference to `nc_inq_vardimid'
(.text+0x611): undefined reference to `nc_inq_vardimid'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_inq_varid_':
(.text+0x6cf): undefined reference to `nc_inq_varid'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_inq_varname_':
(.text+0x7e9): undefined reference to `nc_inq_varname'
(.text+0x831): undefined reference to `nc_inq_varname'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_inq_vartype_':
(.text+0x955): undefined reference to `nc_inq_vartype'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_inq_varnatts_':
(.text+0x9a5): undefined reference to `nc_inq_varnatts'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_rename_var_':
(.text+0xa6e): undefined reference to `nc_rename_var'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_genvar.o): In function `nf_copy_var_':
(.text+0xaaa): undefined reference to `nc_copy_var'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_text_':
(.text+0x3d): undefined reference to `nc_inq_varndims'
(.text+0x139): undefined reference to `nc_put_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_text_a_':
(.text+0x1cd): undefined reference to `nc_inq_varndims'
(.text+0x2c9): undefined reference to `nc_put_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_int1_':
(.text+0x35d): undefined reference to `nc_inq_varndims'
(.text+0x459): undefined reference to `nc_put_vara_schar'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_int2_':
(.text+0x4ed): undefined reference to `nc_inq_varndims'
(.text+0x5e9): undefined reference to `nc_put_vara_short'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_int_':
(.text+0x67d): undefined reference to `nc_inq_varndims'
(.text+0x779): undefined reference to `nc_put_vara_int'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_real_':
(.text+0x80d): undefined reference to `nc_inq_varndims'
(.text+0x909): undefined reference to `nc_put_vara_float'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_double_':
(.text+0x99d): undefined reference to `nc_inq_varndims'
(.text+0xa99): undefined reference to `nc_put_vara_double'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_':
(.text+0xb2d): undefined reference to `nc_inq_varndims'
(.text+0xc29): undefined reference to `nc_put_vara'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_text_':
(.text+0xd31): undefined reference to `nc_inq_varndims'
(.text+0xe3a): undefined reference to `nc_get_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_text_a_':
(.text+0xefd): undefined reference to `nc_inq_varndims'
(.text+0xff9): undefined reference to `nc_get_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_int1_':
(.text+0x108d): undefined reference to `nc_inq_varndims'
(.text+0x1189): undefined reference to `nc_get_vara_schar'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_int2_':
(.text+0x121d): undefined reference to `nc_inq_varndims'
(.text+0x1319): undefined reference to `nc_get_vara_short'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_int_':
(.text+0x13ad): undefined reference to `nc_inq_varndims'
(.text+0x14a9): undefined reference to `nc_get_vara_int'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_real_':
(.text+0x153d): undefined reference to `nc_inq_varndims'
(.text+0x1639): undefined reference to `nc_get_vara_float'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_double_':
(.text+0x16cd): undefined reference to `nc_inq_varndims'
(.text+0x17c9): undefined reference to `nc_get_vara_double'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_':
(.text+0x185d): undefined reference to `nc_inq_varndims'
(.text+0x1959): undefined reference to `nc_get_vara'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_text_':
(.text+0x7e): undefined reference to `nc_put_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_text_a_':
(.text+0x20e): undefined reference to `nc_put_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_int1_':
(.text+0x39e): undefined reference to `nc_put_vara_schar'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_int2_':
(.text+0x52e): undefined reference to `nc_put_vara_short'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_int_':
(.text+0x6be): undefined reference to `nc_put_vara_int'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_real_':
(.text+0x84e): undefined reference to `nc_put_vara_float'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_double_':
(.text+0x9de): undefined reference to `nc_put_vara_double'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_put_vara_':
(.text+0xb6e): undefined reference to `nc_put_vara'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_text_':
(.text+0xd72): undefined reference to `nc_get_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_text_a_':
(.text+0xf3e): undefined reference to `nc_get_vara_text'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_int1_':
(.text+0x10ce): undefined reference to `nc_get_vara_schar'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_int2_':
(.text+0x125e): undefined reference to `nc_get_vara_short'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_int_':
(.text+0x13ee): undefined reference to `nc_get_vara_int'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_real_':
(.text+0x157e): undefined reference to `nc_get_vara_float'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_double_':
(.text+0x170e): undefined reference to `nc_get_vara_double'
/usr/lib/x86_64-linux-gnu/libnetcdff.a(nf_varaio.o): In function `nf_get_vara_':
(.text+0x189e): undefined reference to `nc_get_vara'
collect2: error: ld returned 1 exit status
makefile:62: recipe for target 'mmif' failed
make: *** [mmif] Error 1
makefile
#
# Makefile for MMIF VERSION 3.4.1 2019-03-11
#
# Edit this file to un-comment the section for your compiler.
# You will also need to edit the line that specifies where to find the
# NetCDF libraries, which must be compiled by the same compiler.
# The directory "netcdf.4.1.1-mingw" is used to commpile under MS Windows.
# It was compiled using MinGW version 20110802, see http://www.mingw.org,
# and the script compile_netcdf_mingw.sh.
#
# PGI started linking with the OpenMP library by default in their 11.0 release,
# so that users would be able to use CPU binding even with serial code.
# Adding "-mp=nonuma -nomp" to FFLAGS fixes "can't find libnuma.so" problems.
# PGI Fortran:
# FC = pgf90
# FFLAGS = -g -fast -Mlfs # -Mlfs is default on for x86_64
# FFLAGS += -Mbounds # for bounds checking/debugging
# FFLAGS += -Bstatic_pgi # to use static PGI libraries
# FFLAGS += -Bstatic # to use static netCDF libraries
# FFLAGS += -mp=nonuma -nomp # fix for "can't find libnuma.so"
# NETCDF = /usr/local/src/netcdf-4.1.1.pgi
# GNU gfortran (Windows or Linux, just set NETCDF below correctly)
FC = gfortran
FFLAGS = -g -Wall
FFLAGS += -fbounds-check # for bounds checking/debugging
FFLAGS += -static # to use static libraries
NETCDF = /usr
# Intel Fortran:
#FC = ifort
#FFLAGS = -O2 -align dcommons -ipo
#FFLAGS += -static # to use static libraries
#NETCDF = /path/to/netcdf-4.1.1.ifort
# NETCDF values that are the same for all compilers
INCL = -I$(NETCDF)/include
LIBS = -L/usr/lib/x86_64-linux-gnu -lnetcdff
PROGRAM = mmif
TODAY = 2019-03-11
VERSION = 3.4.1
NEWTAG = 3.4.1 2019-03-11
OLDTAG = 3.4.1 2019-03-01
MODULES = met_fields.f90 functions.f90 module_llxy.f90 wrf_netcdf.f90 \
parse_control.f90
SOURCES = aggregate.f90 avg_zface.f90 cloud_cover.f90 interpolate.f90 \
landuse.f90 mmif.f90 output_aercoare.f90 output_aermet.f90 \
output_calmet.f90 output_onsite.f90 output_scichem.f90 \
pasquill_gifford.f90 pbl_height.f90 read_mm5.f90 read_wrf.f90 \
sfc_layer.f90 timesubs.f90
OBJECTS = $(SOURCES:.f90=.o)
MODOBJS = $(MODULES:.f90=.o)
MODMODS = $(MODULES:.f90=.mod)
$(PROGRAM): $(MODOBJS) $(OBJECTS)
$(FC) $(FFLAGS) $(MODOBJS) $(OBJECTS) $(LIBS) -o $#
%.o : %.f90
$(FC) $(FFLAGS) $(INCL) -c $< -o $#
install: $(PROGRAM)
cp $(PROGRAM) /usr/local/bin
update_version:
sed -i "s|VERSION $(OLDTAG)|VERSION $(NEWTAG)|g" \
*.f90 README.txt makefile makefile.windows mmif_change_log.txt
distro:
mmif --sample > mmif.inp
unix2dos *.f90 *.sh makefile.windows old_compile.bat README*.txt mmif.inp
zip -j MMIFv$(VERSION)_$(TODAY).zip \
mmif.exe mmif mmif.inp *.f90 *.sh makefile \
makefile.windows old_compile.bat README*.txt \
MMIFv$(VERSION)_Users_Manual.pdf \
mmif_change_log.txt test_problems/*/*.inp
dos2unix *.f90
test_pkg:
zip -r MMIFv$(VERSION)_test_problems.zip \
test_problems -x \*/wrf/\* \*/mm5/\*
test_pkg_mm5+wrf:
zip -r MMIF_test_problems_mm5+wrf.zip \
test_problems/wrf \
test_problems/mm5
clean:
rm $(MODMODS) $(MODOBJS) $(OBJECTS) $(PROGRAM)
Library
-------
This netCDF 4.6.0 has been built with the following features:
--cc -> /usr/bin/cc
--cflags -> -I/usr/include -I/usr/include/hdf5/serial
--libs -> -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/hdf5/serial -lnetcdf -lhdf5_hl -lhdf5 -lpthread -lsz -lz -ldl -lm -lcurl
--has-c++ -> no
--cxx ->
--has-c++4 -> no
--cxx4 ->
--has-fortran-> yes
--fc -> gfortran
--fflags -> -I/usr/include
--flibs -> -L/usr/lib -lnetcdff -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -lnetcdf -lnetcdf
--has-f90 -> no
--has-f03 -> yes
--has-dap -> yes
--has-dap2 -> yes
--has-dap4 -> yes
--has-nc2 -> yes
--has-nc4 -> yes
--has-hdf5 -> yes
--has-hdf4 -> no
--has-logging-> no
--has-pnetcdf-> no
--has-szlib -> no
--has-cdf5 -> no
--has-parallel-> no
--prefix -> /usr
--includedir-> /usr/include
--libdir -> /usr/lib/x86_64-linux-gnu
--version -> netCDF 4.6.0

"undefined reference to `gtk_label_set_xalign'" when compiling a Vala application

I am writing a Vala application and I use labels in it. Here is the constructor (I guess that is the place which causes the error):
titleLabel = new Gtk.Label("");
titleLabel.set_markup(wrapInTags(post.title));
titleLabel.set_line_wrap(true);
titleLabel.wrap_mode = Pango.WrapMode.WORD_CHAR;
titleLabel.set_justify(Gtk.Justification.LEFT);
//titleLabel.set_max_width_chars(40);
titleLabel.set_xalign(0);
And when I compile it, this happens:
CMakeFiles/photostream.dir/Widgets/PostBox.c.o: In function `photo_stream_widgets_post_box_construct':
PostBox.c:(.text+0x2111): undefined reference to `gtk_label_set_xalign'
CMakeFiles/photostream.dir/Widgets/CommentsBox.c.o: In function `photo_stream_widgets_comment_box_construct':
CommentsBox.c:(.text+0x1045): undefined reference to `gtk_label_set_xalign'
CMakeFiles/photostream.dir/Widgets/NewsBox.c.o: In function `photo_stream_widgets_news_box_construct':
NewsBox.c:(.text+0x1af8): undefined reference to `gtk_label_set_xalign'
CMakeFiles/photostream.dir/Windows/BulkDownloadWindow.c.o: In function `photo_stream_bulk_download_window_construct':
BulkDownloadWindow.c:(.text+0x14b1): undefined reference to `gtk_label_set_xalign'
collect2: error: ld returned 1 exit status
I tried to replace last string with titleLabel.xalign = 0, but the result is still the same.
How can I solve it?
It seems I found the answer, according to this: https://developer.gnome.org/gtk3/stable/GtkLabel.html the gtk_label_set_xalign() method is available since GTK+ 3.16 and I was using 3.14.

MPLAB vs MPLABX loader file

MPLAB uses procdefs.ld as a loader configuration file:
/*************************************************************************
* Processor-specific object file. Contains SFR definitions.
*************************************************************************/
INPUT("processor.o")
/*************************************************************************
* For interrupt vector handling
*************************************************************************/
PROVIDE(_vector_spacing = 0x00000001);
_ebase_address = 0x9D00F000;
/*************************************************************************
* Memory Address Equates
*************************************************************************/
_RESET_ADDR = 0x9D00E000;
_BEV_EXCPT_ADDR = 0x9D00E380;
_DBG_EXCPT_ADDR = 0x9D00E480;
_DBG_CODE_ADDR = 0xBFC02000;
_GEN_EXCPT_ADDR = _ebase_address + 0x180;
/*************************************************************************
* Memory Regions
*
* Memory regions without attributes cannot be used for orphaned sections.
* Only sections specifically assigned to these regions can be allocated
* into these regions.
*************************************************************************/
MEMORY
{
kseg0_program_mem (rx) : ORIGIN = 0x9D011000, LENGTH = 0x7A000 /* main */
kseg0_boot_mem : ORIGIN = 0x9D00E490, LENGTH = 0x7F0 /* startup code */
exception_mem : ORIGIN = 0x9D00F000, LENGTH = 0x1000
kseg1_boot_mem : ORIGIN = 0x9D00E000, LENGTH = 0x490
debug_exec_mem : ORIGIN = 0xBFC02000, LENGTH = 0xFF0
config3 : ORIGIN = 0xBFC02FF0, LENGTH = 0x4
config2 : ORIGIN = 0xBFC02FF4, LENGTH = 0x4
config1 : ORIGIN = 0xBFC02FF8, LENGTH = 0x4
config0 : ORIGIN = 0xBFC02FFC, LENGTH = 0x4
kseg1_data_mem (w!x) : ORIGIN = 0xA0000000, LENGTH = 0x20000
sfrs : ORIGIN = 0xBF800000, LENGTH = 0x100000
}
But when I try to use the same file in MPLABX I get multiple errors:
"C:\Program Files (x86)\Microchip\MPLAB C32 Suite\bin\pic32-gcc.exe" -mprocessor=32MX695F512L -o dist/default/production/NuWavDSDjr.X.production.elf build/default/production/_ext/2049610667/init.o build/default/production/_ext/2049610667/ir_rx.o build/default/production/_ext/2049610667/timer.o build/default/production/_ext/2049610667/uart.o build/default/production/_ext/2049610667/BLinterface.o build/default/production/_ext/2049610667/uart2.o build/default/production/_ext/65885567/FSIO.o build/default/production/_ext/1295770447/Delay.o build/default/production/_ext/1295770447/Helpers.o build/default/production/_ext/1295770447/Reboot.o build/default/production/_ext/1295770447/Tick.o build/default/production/_ext/1295770447/SPIEEPROM.o build/default/production/_ext/1295770447/SPIFlash.o build/default/production/_ext/1295770447/SPIRAM.o build/default/production/_ext/713068069/usb_host.o build/default/production/_ext/1726182412/usb_host_msd.o build/default/production/_ext/1726182412/usb_host_msd_scsi.o build/default/production/_ext/1472/USB.o build/default/production/_ext/1472/main.o build/default/production/_ext/1472/settings.o build/default/production/_ext/1472/exceptions.o build/default/production/_ext/1472/trigger.o build/default/production/_ext/1472/boot_load_hex.o build/default/production/_ext/1472/usb_config.o build/default/production/_ext/1472/a2dPP.o build/default/production/_ext/1472/logoPP.o build/default/production/_ext/1504692182/PowerPlay_Infrared.o build/default/production/_ext/1504692182/PowerPlay_Main.o build/default/production/_ext/1504692182/PowerPlay_Unit.o build/default/production/_ext/1472/SSD1309.o build/default/production/_ext/1472/mpc4802.o build/default/production/_ext/1472/AmpCtl.o build/default/production/_ext/1472/Xmos.o build/default/production/_ext/1472/Led.o build/default/production/_ext/1472/Relay.o build/default/production/_ext/1472/XMOS_flash.o build/default/production/_ext/1472/MENU.o build/default/production/_ext/1472/CPLD.o build/default/production/_ext/1472/XMOS_pgm.o build/default/production/_ext/1472/Knob.o build/default/production/_ext/1472/FPGA.o build/default/production/_ext/1472/DSD_DAC.o build/default/production/_ext/1472/queue.o build/default/production/_ext/1472/Si5338.o build/default/production/_ext/1472/i2c.o ..\..\Microchip\Crypto\AES_PIC32MX.a -Wl,--defsym=__MPLAB_BUILD=1,--script="..\procdefs.ld",--defsym=_min_heap_size=16000,--defsym=_min_stack_size=2048,-L"..",-L".",-Map="dist/default/production/NuWavDSDjr.X.production.map"
C:/Program Files (x86)/Microchip/MPLAB C32 Suite/bin/../lib/gcc/pic32mx/3.4.4/../../../../pic32mx/lib/crt0.o: In function `_no_nmi':
crt0.S:(.startup+0x20): undefined reference to `_stack'
crt0.S:(.startup+0x24): undefined reference to `_stack'
crt0.S:(.startup+0x28): undefined reference to `_gp'
crt0.S:(.startup+0x2c): undefined reference to `_gp'
crt0.S:(.startup+0x5c): undefined reference to `_bss_begin'
crt0.S:(.startup+0x60): undefined reference to `_bss_begin'
crt0.S:(.startup+0x64): undefined reference to `_bss_end'
crt0.S:(.startup+0x68): undefined reference to `_bss_end'
C:/Program Files (x86)/Microchip/MPLAB C32 Suite/bin/../lib/gcc/pic32mx/3.4.4/../../../../pic32mx/lib/crt0.o: In function `_bss_check':
crt0.S:(.startup+0x94): undefined reference to `_data_image_begin'
crt0.S:(.startup+0x98): undefined reference to `_data_image_begin'
crt0.S:(.startup+0x9c): undefined reference to `_data_begin'
crt0.S:(.startup+0xa0): undefined reference to `_data_begin'
crt0.S:(.startup+0xa4): undefined reference to `_data_end'
crt0.S:(.startup+0xa8): undefined reference to `_data_end'
C:/Program Files (x86)/Microchip/MPLAB C32 Suite/bin/../lib/gcc/pic32mx/3.4.4/../../../../pic32mx/lib/crt0.o: In function `_init_check':
crt0.S:(.startup+0xd0): undefined reference to `_ramfunc_length'
crt0.S:(.startup+0xd4): undefined reference to `_ramfunc_length'
crt0.S:(.startup+0xe0): undefined reference to `_ramfunc_image_begin'
crt0.S:(.startup+0xe4): undefined reference to `_ramfunc_image_begin'
crt0.S:(.startup+0xe8): undefined reference to `_ramfunc_begin'
crt0.S:(.startup+0xec): undefined reference to `_ramfunc_begin'
crt0.S:(.startup+0xf0): undefined reference to `_ramfunc_end'
crt0.S:(.startup+0xf4): undefined reference to `_ramfunc_end'
C:/Program Files (x86)/Microchip/MPLAB C32 Suite/bin/../lib/gcc/pic32mx/3.4.4/../../../../pic32mx/lib/crt0.o: In function `_ramfunc_check':
crt0.S:(.startup+0x114): undefined reference to `_bmxdkpba_address'
crt0.S:(.startup+0x118): undefined reference to `_bmxdkpba_address'
crt0.S:(.startup+0x128): undefined reference to `_bmxdudba_address'
crt0.S:(.startup+0x12c): undefined reference to `_bmxdudba_address'
crt0.S:(.startup+0x13c): undefined reference to `_bmxdupba_address'
crt0.S:(.startup+0x140): undefined reference to `_bmxdupba_address'
C:\Program Files (x86)\Microchip\MPLAB C32 Suite\bin\..\lib\gcc\pic32mx\3.4.4\..\..\..\..\pic32mx\bin\ld.exe: small-data section exceeds 64KB; lower small-data size limit (see option -G)
build/default/production/_ext/2049610667/ir_rx.o: In function `IR_RX_Init':
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:116: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:117: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:118: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:119: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:120: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:121: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:122: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:123: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:124: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:125: relocation truncated to fit: R_MIPS_GPREL16 against `no symbol'
C:\projects\073 NuWavDSDjr-FPGAtest\NuWavDSDjr\NuWavDSDjr.X/../../Common/ir_rx.c:141: additional relocation overflows omitted from the output
C:/Program Files (x86)/Microchip/MPLAB C32 Suite/bin/../lib/gcc/pic32mx/3.4.4/../../../../pic32mx/lib\libc.a(sbrk.o): In function `_stub_sbd_memlayout':
/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._stub_sbd_memlayout+0x4): undefined reference to `_heap'
/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._stub_sbd_memlayout+0x10): undefined reference to `_heap'
C:/Program Files (x86)/Microchip/MPLAB C32 Suite/bin/../lib/gcc/pic32mx/3.4.4/../../../../pic32mx/lib\libc.a(sbrk.o): In function `_sbrk_init':
/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._sbrk_init+0x38): undefined reference to `_end'
/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._sbrk_init+0xf4): undefined reference to `_end'
/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._sbrk_init+0x3c): undefined reference to `_end'
/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._sbrk_init+0xbc): undefined reference to `_end'
/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._sbrk_init+0xc4): undefined reference to `_end'
C:/Program Files (x86)/Microchip/MPLAB C32 Suite/bin/../lib/gcc/pic32mx/3.4.4/../../../../pic32mx/lib\libc.a(sbrk.o):/home/c11067/work/c32/builds/pic32-microchip-release-1.11B-20100802-20100803/pic32-libs/c/stubs/sbrk.c:(.text._sbrk_init+0x108): more undefined references to `_end' follow
make[2]: *** [dist/default/production/NuWavDSDjr.X.production.hex] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
nbproject/Makefile-default.mk:648: recipe for target 'dist/default/production/NuWavDSDjr.X.production.hex' failed
make[2]: Leaving directory 'C:/projects/073 NuWavDSDjr-FPGAtest/NuWavDSDjr/NuWavDSDjr.X'
nbproject/Makefile-default.mk:78: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/projects/073 NuWavDSDjr-FPGAtest/NuWavDSDjr/NuWavDSDjr.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
BUILD FAILED (exit value 2, total time: 25s)
How do I define a loader configuration file for MPLABX? What changes need to be made for mplabx?
I would suggest changing to xc32 v1.40, the current version, C32 is quite old.
On my box in dir "C:\Program Files (x86)\Microchip\xc32\v1.40\examples\xc32_examples\custom_ld_file"
is an example project with a custom .ld file example with comments that may help.
If you are unable/not willing to change to xc32 I suggest you stay with MpLAB IDE and C32 that works.
The include paths are quite different for X.

compiling ffmpeg on msys2 and mingw32-- error creating ffmpeg_g.exe

I have compiled ffmpeg from source using MSYS2 and MinGW. The library files were created successfully during the compilation and when make utility proceeds to build ffmpeg_g, I am getting lot of undefined references.Kindly tell me why the compilation fails....
Thanks in advance
The following library files were generated successfully
libavcodec.a
libavdvice.a
libavfilter.a
libavformat.a
libavutil.a
libpostproc.a
libswresample.a
libswscale.a
Command passed for compiling ffmpeg_g.exe output taken by using -d option with mke
g++ -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,--nxcompat -Wl,--dynamicbase -Wl,--as-needed -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample -o ffmpeg_g.exe ffmpeg_opt.o ffmpeg_filter.o ffmpeg.o cmdutils.o -lavdevice -lavfilter -lavformat -lavcodec -lpostproc -lswresample -lswscale -lavutil -lavicap32 -lpsapi -lole32 -lstrmiids -luuid -lws2_32 -lx264 -lvpx -lvpx -lvpx -lvpx -lvorbisenc -lvorbis -logg -lopenjpeg -lmp3lame -lfdk-aac -lfaac -lbluray -L/mingw32/lib -lass -lm -lharfbuzz -lfontconfig -lexpat -lfreetype -lexpat -lenca -lm -lfribidi -lglib-2.0 -lintl -lws2_32 -lole32 -lwinmm -lshlwapi -lintl -lfreetype -lz -lbz2 -lm -lbz2 -lz -lpsapi -ladvapi32 -lshell32
The output from gcc is given below
ffmpeg_opt.o: In function new_output_stream:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:1036: undefined reference to avcodec_get_context_defaults3
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:1089: undefined reference to av_get_exact_bits_per_sample
ffmpeg_opt.o: In function find_codec_or_die:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:514: undefined reference to avcodec_find_encoder_by_name
ffmpeg_opt.o: In function choose_encoder:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:965: undefined reference to avcodec_find_encoder
ffmpeg_opt.o: In function find_codec_or_die:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:518: undefined reference to avcodec_find_encoder
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:514: undefined reference to avcodec_find_decoder_by_name
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:518: undefined reference to avcodec_find_decoder
ffmpeg_opt.o: In function add_input_streams:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:596: undefined reference to av_codec_get_lowres
ffmpeg_opt.o: In function choose_decoder:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:546: undefined reference to avcodec_find_decoder
ffmpeg_opt.o: In function add_input_streams:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:546: undefined reference to avcodec_find_decoder
ffmpeg_opt.o: In function open_input_file:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:872: undefined reference to avcodec_get_class
ffmpeg_opt.o: In function add_input_streams:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:631: undefined reference to avcodec_find_decoder
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/ffmpeg_opt.c:595: undefined reference to avcodec_find_decoder
lot of undefined references followed by
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/libavcodec/mlpdsp.c:64: undefined reference to ff_mlpdsp_init_x86
libavcodec/libavcodec.a(mpegaudiodsp.o): In function ff_mpadsp_init:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/libavcodec/mpegaudiodsp.c:46: undefined reference to ff_mpadsp_init_x86
libavcodec/libavcodec.a(cavsdsp.o): In function ff_cavsdsp_init:
E:\software\pkg\ffmpeg-2.1.3.tar\ffmpeg-2.1.3\ffmpeg-2.1.3/libavcodec/cavsdsp.c:565: undefined reference to ff_cavsdsp_init_x86
collect2.exe: error: ld returned 1 exit status
Make output
LD ffmpeg_g.exe
Reaping losing child 01584DA0 PID 29691080
Makefile:105: recipe for target ffmpeg_g.exe failed
Removing child 01584DA0 PID 29691080 from chain.

Compiling libshout using QT/qmake

I'm trying to link my QT application to a DLL (libshout), while building for Windows.
I've added the appropriate lines to my .pro file:
LIBS += -L/local/lib -lmp3lame
LIBS += -L/local/lib -lshout
LIBS += -L/local/lib -logg
LIBS += -L/local/lib -lvorbis
LIBS += -lwsock32
I've also successfully built and installed libshout to /local/lib (I'm using mingw and the gcc-dw2 compiler).
However, qmake fails to link successfully. I've pasted the gcc/make output below. I'm not even sure it's trying to link to the right library (isn't .a/.la a static library?).
I've been tearing my hair out for 3 days over this one so any help appreciated :)
g++-dw2 -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPP
ORT -DQT_DLL -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CO
RE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'../../Qt/4.6.3/include/QtCore' -I
'../../Qt/4.6.3/include/QtNetwork' -I'../../Qt/4.6.3/include/QtGui' -I'../../Qt/
4.6.3/include/QtWebKit' -I'../../Qt/4.6.3/include' -I'../../Qt/4.6.3/include/Act
iveQt' -I'release' -I'../../Qt/4.6.3/mkspecs/win32-g++' -o release/qrc_resources
.o release/qrc_resources.cpp
g++-dw2 -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo
-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o build/release/MyApp.exe ob
ject_script.MyApp.Release -L'c:/Qt/4.6.3/lib' -lmingw32 -lqtmain -L/local/lib -
lmp3lame -L/local/lib -lshout -lwsock32 -lQtWebKit4 -lQtGui4 -lQtNetwork4 -lQtCo
re4
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `free_codec':
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:188: undefined reference to `ogg_
stream_clear'
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `close_ogg':
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:144: undefined reference to `ogg_
sync_clear'
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `send_ogg':
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:90: undefined reference to `ogg_s
ync_buffer'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:92: undefined reference to `ogg_s
ync_wrote'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:94: undefined reference to `ogg_s
ync_pageout'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:95: undefined reference to `ogg_p
age_bos'
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `open_codec':
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:154: undefined reference to `ogg_
page_serialno'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:154: undefined reference to `ogg_
stream_init'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:155: undefined reference to `ogg_
stream_pagein'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:160: undefined reference to `ogg_
stream_clear'
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `send_ogg':
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:117: undefined reference to `ogg_
page_serialno'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:119: undefined reference to `ogg_
stream_pagein'
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:94: undefined reference to `ogg_s
ync_pageout'
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `shout_open_ogg':
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:74: undefined reference to `ogg_s
ync_init'
C:/msys/1.0/local/lib/libshout.a(vorbis.o): In function `free_vorbis_data':
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:103: undefined reference to `v
orbis_info_clear'
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:104: undefined reference to `v
orbis_comment_clear'
C:/msys/1.0/local/lib/libshout.a(vorbis.o): In function `read_vorbis_page':
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:83: undefined reference to `vo
rbis_synthesis_headerin'
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:82: undefined reference to `og
g_stream_packetout'
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:91: undefined reference to `og
g_stream_packetout'
C:/msys/1.0/local/lib/libshout.a(vorbis.o): In function `vorbis_blocksize':
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:110: undefined reference to `v
orbis_packet_blocksize'
C:/msys/1.0/local/lib/libshout.a(vorbis.o): In function `shout_open_vorbis':
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:57: undefined reference to `vo
rbis_info_init'
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:58: undefined reference to `vo
rbis_comment_init'
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:60: undefined reference to `og
g_stream_packetout'
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:62: undefined reference to `vo
rbis_synthesis_headerin'
collect2: ld returned 1 exit status
make[1]: *** [build/release/Myapp.exe] Error 1
make[1]: Leaving directory `/c/myapp_app/src'
make: *** [release] Error 2
My first guess would be that libogg and libvorbis aren't installed in /local/lib, did you check that they are there?

Resources