Selective undefined references when compiling under Qt/Win
Posted: 2010-08-24T16:57:18-07:00
I beg my pardon for flood of questions. Probably someone got this before?
Compiling under Qt for Windows results in errors. Looks like everything is fine except the composite function or composite operator. I have pasted compiler output below. The same code compiles fine on Mac. I have compiled the latest version of ImageMagick under CygWin and it works fine. Libraries and headers are found. Any hints? It is strange it barks only on the compose while I have many more IM operations in the code above that.
Thank you!
Max
Running build steps for project DStation...
Starting: "c:/qt/2010.04/qt/bin/qmake.exe" C:/src/DStation/DStation/DStation/DStation.pro -r -spec win32-g++
The process "c:/qt/2010.04/qt/bin/qmake.exe" exited normally.
Starting: "C:/Qt/2010.04/mingw/bin/mingw32-make.exe" -w
mingw32-make: Entering directory `C:/-Astro/DStation/DStation-build-desktop'
C:/Qt/2010.04/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/-Astro/DStation/DStation-build-desktop'
c:\Qt\2010.04\qt\bin\uic.exe ..\..\..\src\DStation\DStation\DStation\dstation.ui -o ui_dstation.h
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\Qt\2010.04\qt\include\QtCore" -I"..\..\..\Qt\2010.04\qt\include\QtGui" -I"..\..\..\Qt\2010.04\qt\include" -I"..\..\..\cygwin\usr\local\include\ImageMagick" -I"..\..\..\Qt\2010.04\qt\include\ActiveQt" -I"debug" -I"." -I"..\..\..\src\DStation\DStation\DStation" -I"." -I"..\..\..\Qt\2010.04\qt\mkspecs\win32-g++" -o debug\main.o ..\..\..\src\DStation\DStation\DStation\main.cpp
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\Qt\2010.04\qt\include\QtCore" -I"..\..\..\Qt\2010.04\qt\include\QtGui" -I"..\..\..\Qt\2010.04\qt\include" -I"..\..\..\cygwin\usr\local\include\ImageMagick" -I"..\..\..\Qt\2010.04\qt\include\ActiveQt" -I"debug" -I"." -I"..\..\..\src\DStation\DStation\DStation" -I"." -I"..\..\..\Qt\2010.04\qt\mkspecs\win32-g++" -o debug\dstation.o ..\..\..\src\DStation\DStation\DStation\dstation.cpp
C:\Qt\2010.04\qt\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\Qt\2010.04\qt\include\QtCore" -I"..\..\..\Qt\2010.04\qt\include\QtGui" -I"..\..\..\Qt\2010.04\qt\include" -I"..\..\..\cygwin\usr\local\include\ImageMagick" -I"..\..\..\Qt\2010.04\qt\include\ActiveQt" -I"debug" -I"." -I"..\..\..\src\DStation\DStation\DStation" -I"." -I"..\..\..\Qt\2010.04\qt\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\..\..\src\DStation\DStation\DStation\dstation.h -o debug\moc_dstation.cpp
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\Qt\2010.04\qt\include\QtCore" -I"..\..\..\Qt\2010.04\qt\include\QtGui" -I"..\..\..\Qt\2010.04\qt\include" -I"..\..\..\cygwin\usr\local\include\ImageMagick" -I"..\..\..\Qt\2010.04\qt\include\ActiveQt" -I"debug" -I"." -I"..\..\..\src\DStation\DStation\DStation" -I"." -I"..\..\..\Qt\2010.04\qt\mkspecs\win32-g++" -o debug\moc_dstation.o debug\moc_dstation.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\DStation.exe debug/main.o debug/dstation.o debug/moc_dstation.o -L"c:\Qt\2010.04\qt\lib" -lmingw32 -lqtmaind -LC:\cygwin\usr\local\lib -lMagick++ -lQtGuid4 -lQtCored4
mingw32-make[1]: Leaving directory `C:/-Astro/DStation/DStation-build-desktop'
mingw32-make: Leaving directory `C:/-Astro/DStation/DStation-build-desktop'
debug/dstation.o:C:\-Astro\DStation\DStation-build-desktop/../../../src/DStation/DStation/DStation/dstation.cpp:280: undefined reference to `Magick::Image::composite(Magick::Image const&, long, long, MagickCore::CompositeOperator)'
debug/dstation.o:C:\-Astro\DStation\DStation-build-desktop/../../../src/DStation/DStation/DStation/dstation.cpp:306: undefined reference to `Magick::Image::composite(Magick::Image const&, long, long, MagickCore::CompositeOperator)'
debug/dstation.o:C:\-Astro\DStation\DStation-build-desktop/../../../src/DStation/DStation/DStation/dstation.cpp:372: undefined reference to `Magick::Image::composite(Magick::Image const&, long, long, MagickCore::CompositeOperator)'
debug/dstation.o:C:\-Astro\DStation\DStation-build-desktop/../../../src/DStation/DStation/DStation/dstation.cpp:373: undefined reference to `Magick::Image::composite(Magick::Image const&, long, long, MagickCore::CompositeOperator)'
debug/dstation.o:C:\-Astro\DStation\DStation-build-desktop/../../../src/DStation/DStation/DStation/dstation.cpp:381: undefined reference to `Magick::Image::composite(Magick::Image const&, long, long, MagickCore::CompositeOperator)'
debug/dstation.o:C:\-Astro\DStation\DStation-build-desktop/../../../src/DStation/DStation/DStation/dstation.cpp:382: more undefined references to `Magick::Image::composite(Magick::Image const&, long, long, MagickCore::CompositeOperator)' follow
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\DStation.exe] Error 1
mingw32-make: *** [debug] Error 2
The process "C:/Qt/2010.04/mingw/bin/mingw32-make.exe" exited with code %2.
Error while building project DStation (target: Desktop)
When executing build step 'Make'
Compiling under Qt for Windows results in errors. Looks like everything is fine except the composite function or composite operator. I have pasted compiler output below. The same code compiles fine on Mac. I have compiled the latest version of ImageMagick under CygWin and it works fine. Libraries and headers are found. Any hints? It is strange it barks only on the compose while I have many more IM operations in the code above that.
Thank you!
Max
Running build steps for project DStation...
Starting: "c:/qt/2010.04/qt/bin/qmake.exe" C:/src/DStation/DStation/DStation/DStation.pro -r -spec win32-g++
The process "c:/qt/2010.04/qt/bin/qmake.exe" exited normally.
Starting: "C:/Qt/2010.04/mingw/bin/mingw32-make.exe" -w
mingw32-make: Entering directory `C:/-Astro/DStation/DStation-build-desktop'
C:/Qt/2010.04/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/-Astro/DStation/DStation-build-desktop'
c:\Qt\2010.04\qt\bin\uic.exe ..\..\..\src\DStation\DStation\DStation\dstation.ui -o ui_dstation.h
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\Qt\2010.04\qt\include\QtCore" -I"..\..\..\Qt\2010.04\qt\include\QtGui" -I"..\..\..\Qt\2010.04\qt\include" -I"..\..\..\cygwin\usr\local\include\ImageMagick" -I"..\..\..\Qt\2010.04\qt\include\ActiveQt" -I"debug" -I"." -I"..\..\..\src\DStation\DStation\DStation" -I"." -I"..\..\..\Qt\2010.04\qt\mkspecs\win32-g++" -o debug\main.o ..\..\..\src\DStation\DStation\DStation\main.cpp
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\Qt\2010.04\qt\include\QtCore" -I"..\..\..\Qt\2010.04\qt\include\QtGui" -I"..\..\..\Qt\2010.04\qt\include" -I"..\..\..\cygwin\usr\local\include\ImageMagick" -I"..\..\..\Qt\2010.04\qt\include\ActiveQt" -I"debug" -I"." -I"..\..\..\src\DStation\DStation\DStation" -I"." -I"..\..\..\Qt\2010.04\qt\mkspecs\win32-g++" -o debug\dstation.o ..\..\..\src\DStation\DStation\DStation\dstation.cpp
C:\Qt\2010.04\qt\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\Qt\2010.04\qt\include\QtCore" -I"..\..\..\Qt\2010.04\qt\include\QtGui" -I"..\..\..\Qt\2010.04\qt\include" -I"..\..\..\cygwin\usr\local\include\ImageMagick" -I"..\..\..\Qt\2010.04\qt\include\ActiveQt" -I"debug" -I"." -I"..\..\..\src\DStation\DStation\DStation" -I"." -I"..\..\..\Qt\2010.04\qt\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\..\..\src\DStation\DStation\DStation\dstation.h -o debug\moc_dstation.cpp
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\Qt\2010.04\qt\include\QtCore" -I"..\..\..\Qt\2010.04\qt\include\QtGui" -I"..\..\..\Qt\2010.04\qt\include" -I"..\..\..\cygwin\usr\local\include\ImageMagick" -I"..\..\..\Qt\2010.04\qt\include\ActiveQt" -I"debug" -I"." -I"..\..\..\src\DStation\DStation\DStation" -I"." -I"..\..\..\Qt\2010.04\qt\mkspecs\win32-g++" -o debug\moc_dstation.o debug\moc_dstation.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\DStation.exe debug/main.o debug/dstation.o debug/moc_dstation.o -L"c:\Qt\2010.04\qt\lib" -lmingw32 -lqtmaind -LC:\cygwin\usr\local\lib -lMagick++ -lQtGuid4 -lQtCored4
mingw32-make[1]: Leaving directory `C:/-Astro/DStation/DStation-build-desktop'
mingw32-make: Leaving directory `C:/-Astro/DStation/DStation-build-desktop'
debug/dstation.o:C:\-Astro\DStation\DStation-build-desktop/../../../src/DStation/DStation/DStation/dstation.cpp:280: undefined reference to `Magick::Image::composite(Magick::Image const&, long, long, MagickCore::CompositeOperator)'
debug/dstation.o:C:\-Astro\DStation\DStation-build-desktop/../../../src/DStation/DStation/DStation/dstation.cpp:306: undefined reference to `Magick::Image::composite(Magick::Image const&, long, long, MagickCore::CompositeOperator)'
debug/dstation.o:C:\-Astro\DStation\DStation-build-desktop/../../../src/DStation/DStation/DStation/dstation.cpp:372: undefined reference to `Magick::Image::composite(Magick::Image const&, long, long, MagickCore::CompositeOperator)'
debug/dstation.o:C:\-Astro\DStation\DStation-build-desktop/../../../src/DStation/DStation/DStation/dstation.cpp:373: undefined reference to `Magick::Image::composite(Magick::Image const&, long, long, MagickCore::CompositeOperator)'
debug/dstation.o:C:\-Astro\DStation\DStation-build-desktop/../../../src/DStation/DStation/DStation/dstation.cpp:381: undefined reference to `Magick::Image::composite(Magick::Image const&, long, long, MagickCore::CompositeOperator)'
debug/dstation.o:C:\-Astro\DStation\DStation-build-desktop/../../../src/DStation/DStation/DStation/dstation.cpp:382: more undefined references to `Magick::Image::composite(Magick::Image const&, long, long, MagickCore::CompositeOperator)' follow
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\DStation.exe] Error 1
mingw32-make: *** [debug] Error 2
The process "C:/Qt/2010.04/mingw/bin/mingw32-make.exe" exited with code %2.
Error while building project DStation (target: Desktop)
When executing build step 'Make'