Hello,

starting with version in 2016.0
src/hugin_base/hugin_utils/utils.cpp has started calling
XOpenDisplay() for 
on 

#ifdef _WIN32
...
#elif defined __APPLE__
#else
XOpenDisplay()
#endif

However -lX11 is missing from the linker line:
---------------------------
[ 20%] Linking CXX shared library libhuginbase.so
cd /tmp/HUGIN/hugin-2016.0.0/obj-x86_64-linux-gnu/src/hugin_base && 
/usr/bin/cmake -E cmake_link_script CMakeFiles/huginbase.dir/link.txt 
--verbose=1
/usr/lib/ccache/c++  -fPIC -g -O2 -fstack-protector-strong -Wformat 
-Werror=format-security -Wall -Wdate-time -D_FORTIFY_SOURCE=2  --std=c++11  
-Wl,-z,relro -Wl,--as-needed -Wl,-z,defs -fopenmp -shared 
-Wl,-soname,libhuginbase.so.0.0 -o libhuginbase.so.0.0 
CMakeFiles/huginbase.dir/algorithms/nona/NonaFileStitcher.cpp.o 
CMakeFiles/huginbase.dir/algorithms/basic/CalculateCPStatistics.cpp.o 
CMakeFiles/huginbase.dir/algorithms/basic/CalculateMeanExposure.cpp.o 
CMakeFiles/huginbase.dir/algorithms/basic/CalculateOptimalScale.cpp.o 
CMakeFiles/huginbase.dir/algorithms/basic/CalculateOptimalROI.cpp.o 
CMakeFiles/huginbase.dir/algorithms/basic/RotatePanorama.cpp.o 
CMakeFiles/huginbase.dir/algorithms/basic/TranslatePanorama.cpp.o 
CMakeFiles/huginbase.dir/algorithms/basic/StraightenPanorama.cpp.o 
CMakeFiles/huginbase.dir/algorithms/basic/CalculateOverlap.cpp.o 
CMakeFiles/huginbase.dir/algorithms/basic/LayerStacks.cpp.o 
CMakeFiles/huginbase.dir/algorithms/nona/CalculateFOV.cpp.o 
CMakeFiles/huginbase.dir/algorithms/nona/CenterHorizontally.cpp.o 
CMakeFiles/huginbase.dir/algorithms/nona/FitPanorama.cpp.o 
CMakeFiles/huginbase.dir/algorithms/nona/ComputeImageROI.cpp.o 
CMakeFiles/huginbase.dir/algorithms/optimizer/ImageGraph.cpp.o 
CMakeFiles/huginbase.dir/algorithms/optimizer/PhotometricOptimizer.cpp.o 
CMakeFiles/huginbase.dir/algorithms/optimizer/PTOptimizer.cpp.o 
CMakeFiles/huginbase.dir/algorithms/point_sampler/PointSampler.cpp.o 
CMakeFiles/huginbase.dir/algorithms/control_points/CleanCP.cpp.o 
CMakeFiles/huginbase.dir/appbase/ProgressDisplay.cpp.o 
CMakeFiles/huginbase.dir/huginapp/CachedImageRemapper.cpp.o 
CMakeFiles/huginbase.dir/huginapp/ImageCache.cpp.o 
CMakeFiles/huginbase.dir/hugin_math/eig_jacobi.cpp.o 
CMakeFiles/huginbase.dir/hugin_math/graph.cpp.o 
CMakeFiles/huginbase.dir/hugin_math/Matrix3.cpp.o 
CMakeFiles/huginbase.dir/hugin_math/Vector3.cpp.o 
CMakeFiles/huginbase.dir/hugin_utils/alphanum.cpp.o 
CMakeFiles/huginbase.dir/hugin_utils/utils.cpp.o 
CMakeFiles/huginbase.dir/hugin_utils/platform.cpp.o 
CMakeFiles/huginbase.dir/lensdb/LensDB.cpp.o 
CMakeFiles/huginbase.dir/nona/SpaceTransform.cpp.o 
CMakeFiles/huginbase.dir/nona/Stitcher1.cpp.o 
CMakeFiles/huginbase.dir/nona/Stitcher2.cpp.o 
CMakeFiles/huginbase.dir/nona/Stitcher3.cpp.o 
CMakeFiles/huginbase.dir/nona/Stitcher4.cpp.o 
CMakeFiles/huginbase.dir/nona/Stitcher.cpp.o 
CMakeFiles/huginbase.dir/nona/StitcherOptions.cpp.o 
CMakeFiles/huginbase.dir/panodata/ControlPoint.cpp.o 
CMakeFiles/huginbase.dir/panodata/Lens.cpp.o 
CMakeFiles/huginbase.dir/panodata/Mask.cpp.o 
CMakeFiles/huginbase.dir/panodata/Panorama.cpp.o 
CMakeFiles/huginbase.dir/panodata/PanoramaOptions.cpp.o 
CMakeFiles/huginbase.dir/panodata/PanoramaVariable.cpp.o 
CMakeFiles/huginbase.dir/panodata/PTScriptParsing.cpp.o 
CMakeFiles/huginbase.dir/panodata/SrcPanoImage.cpp.o 
CMakeFiles/huginbase.dir/panodata/ImageVariableGroup.cpp.o 
CMakeFiles/huginbase.dir/panodata/StandardImageVariableGroups.cpp.o 
CMakeFiles/huginbase.dir/panodata/Exiv2Helper.cpp.o 
CMakeFiles/huginbase.dir/panotools/PanoToolsInterface.cpp.o 
CMakeFiles/huginbase.dir/panotools/PanoToolsOptimizerWrapper.cpp.o 
CMakeFiles/huginbase.dir/panotools/PanoToolsUtils.cpp.o 
CMakeFiles/huginbase.dir/panotools/PanoToolsTransformGPU.cpp.o 
CMakeFiles/huginbase.dir/vigra_ext/emor.cpp.o 
CMakeFiles/huginbase.dir/vigra_ext/ImageTransformsGPU.cpp.o -lboost_filesystem 
-lboost_system -lpthread ../foreign/levmar/libhuginlevmar.a -lvigraimpex 
-lboost_filesystem -lboost_system -lexiv2 -lpano13 -ltiff -lGLU -lGL -lGLEW 
-lpthread -lsqlite3 -llcms2 -lboost_filesystem -lboost_system -lvigraimpex 
-lexiv2 -lpano13 -ltiff -lGLU -lGL -lGLEW -lsqlite3 -llcms2 
-Wl,-rpath,:::::::::::::: 
CMakeFiles/huginbase.dir/hugin_utils/utils.cpp.o: In function 
`hugin_utils::CreateContext(int*, char**)':
/tmp/HUGIN/hugin-2016.0.0/src/hugin_base/hugin_utils/utils.cpp:609: undefined 
reference to `XOpenDisplay'
/tmp/HUGIN/hugin-2016.0.0/src/hugin_base/hugin_utils/utils.cpp:634: undefined 
reference to `XCreateColormap'
/tmp/HUGIN/hugin-2016.0.0/src/hugin_base/hugin_utils/utils.cpp:638: undefined 
reference to `XCreateWindow'
CMakeFiles/huginbase.dir/hugin_utils/utils.cpp.o: In function 
`hugin_utils::DestroyContext()':
/tmp/HUGIN/hugin-2016.0.0/src/hugin_base/hugin_utils/utils.cpp:665: undefined 
reference to `XFree'
/tmp/HUGIN/hugin-2016.0.0/src/hugin_base/hugin_utils/utils.cpp:661: undefined 
reference to `XFreeColormap'
/tmp/HUGIN/hugin-2016.0.0/src/hugin_base/hugin_utils/utils.cpp:657: undefined 
reference to `XDestroyWindow'
/tmp/HUGIN/hugin-2016.0.0/src/hugin_base/hugin_utils/utils.cpp:669: undefined 
reference to `XCloseDisplay'
/tmp/HUGIN/hugin-2016.0.0/src/hugin_base/hugin_utils/utils.cpp:669: undefined 
reference to `XCloseDisplay'
collect2: error: ld returned 1 exit status
src/hugin_base/CMakeFiles/huginbase.dir/build.make:1500: recipe for target 
'src/hugin_base/libhuginbase.so.0.0' failed
make[4]: *** [src/hugin_base/libhuginbase.so.0.0] Error 1
make[4]: Leaving directory '/tmp/HUGIN/hugin-2016.0.0/obj-x86_64-linux-gnu'
CMakeFiles/Makefile2:334: recipe for target 
'src/hugin_base/CMakeFiles/huginbase.dir/all' failed
make[3]: *** [src/hugin_base/CMakeFiles/huginbase.dir/all] Error 2
---------------------------

I have come up with attached preliminary patch, however there seems to
be a small problem left, the patch adds -lX11 twice to the resulting
linker line:

/usr/lib/ccache/c++  -fPIC -g -O2 -fstack-protector-strong -Wformat 
-Werror=format-security -Wall -Wdate-time -D_FORTIFY_SOURCE=2  --std=c++11  
-Wl,-z,relro -Wl,--as-needed -Wl,-z,defs -fopenmp -shared 
-Wl,-soname,libhuginbase.so.0.0 -o libhuginbase.so.0.0  [object.files.o] 
-lboost_filesystem -lboost_system -lpthread -lX11 
../foreign/levmar/libhuginlevmar.a -lvigraimpex -lboost_filesystem 
-lboost_system -lexiv2 -lpano13 -ltiff -lGLU -lGL -lGLEW -lpthread -lsqlite3 
-llcms2 -lboost_filesystem -lboost_system -lX11 -lvigraimpex -lexiv2 -lpano13 
-ltiff -lGLU -lGL -lGLEW -lsqlite3 -llcms2 -Wl,-rpath,:::::::::::::: 

cu Andreas

-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'

-- 
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
--- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to hugin-ptx+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/hugin-ptx/20160123173143.GA27490%40argenau.bebt.de.
For more options, visit https://groups.google.com/d/optout.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -232,6 +232,10 @@ IF(NOT HUGIN_SHARED OR NOT WIN32)
   ADD_DEFINITIONS(-DGLEW_STATIC)
 ENDIF()
 
+IF(NOT APPLE AND NOT WIN32)
+FIND_PACKAGE(X11 REQUIRED)
+set(Hugin_X11_Dep_Lib ${X11_X11_LIB})
+ENDIF()
 ##
 ## Panotools
 ##
--- a/src/hugin_base/CMakeLists.txt
+++ b/src/hugin_base/CMakeLists.txt
@@ -128,7 +128,8 @@ vigra_ext/ReduceOpenEXR.h
 
 IF (${HUGIN_SHARED_LIBS})
   add_library(huginbase SHARED ${HUGIN_BASE_SRC} ${HUGIN_BASE_HEADER})
-  target_link_libraries(huginbase ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+  target_link_libraries(huginbase ${Boost_LIBRARIES}
+	  ${CMAKE_THREAD_LIBS_INIT} ${Hugin_X11_Dep_Lib})
   set_target_properties(huginbase PROPERTIES VERSION ${HUGIN_LIB_VERSION})
   IF(WIN32)
     install(TARGETS huginbase RUNTIME DESTINATION ${BINDIR})

Reply via email to