I tried to write a demo program of drm, but I encountered undefined reference to problems:
xjt#u16:~/SF6_RV1126/drmDemo/build$ make -j8
Scanning dependencies of target drmDemo
[ 50%] Building C object bin/CMakeFiles/drmDemo.dir/main.c.o
[100%] Linking C executable drmDemo
/home/xjt/SF6_RV1126/RV1126/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: CMakeFiles/drmDemo.dir/main.c.o: in function `modeset_create_fb':
main.c:(.text+0x6c): undefined reference to `drmIoctl'
/home/xjt/SF6_RV1126/RV1126/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: main.c:(.text+0xe0): undefined reference to `drmModeAddFB'
/home/xjt/SF6_RV1126/RV1126/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: main.c:(.text+0x100): undefined reference to `drmIoctl'
/home/xjt/SF6_RV1126/RV1126/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: CMakeFiles/drmDemo.dir/main.c.o: in function `modeset_destroy_fb':
main.c:(.text+0x194): undefined reference to `drmModeRmFB'
/home/xjt/SF6_RV1126/RV1126/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: main.c:(.text+0x1d4): undefined reference to `drmIoctl'
/home/xjt/SF6_RV1126/RV1126/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: CMakeFiles/drmDemo.dir/main.c.o: in function `main':
main.c:(.text+0x214): undefined reference to `drmModeGetResources'
/home/xjt/SF6_RV1126/RV1126/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: main.c:(.text+0x248): undefined reference to `drmModeGetConnector'
/home/xjt/SF6_RV1126/RV1126/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: main.c:(.text+0x2d4): undefined reference to `drmModeSetCrtc'
/home/xjt/SF6_RV1126/RV1126/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: main.c:(.text+0x2f0): undefined reference to `drmModeFreeConnector'
/home/xjt/SF6_RV1126/RV1126/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: main.c:(.text+0x2f8): undefined reference to `drmModeFreeResources'
collect2: error: ld returned 1 exit status
bin/CMakeFiles/drmDemo.dir/build.make:94: recipe for target 'bin/drmDemo' failed
make[2]: *** [bin/drmDemo] Error 1
CMakeFiles/Makefile2:85: recipe for target 'bin/CMakeFiles/drmDemo.dir/all' failed
make[1]: *** [bin/CMakeFiles/drmDemo.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
my cc tool chain is arm-linux-gnueabihf- whic is produced from Buildroot. And I use CMake to build my program. Here is my project tree:
.
├── CMakeLists.txt # 1
├── src
│ ├── main.c
│ └── CMakeLists.txt # 2
└── build
in CML1:
PROJECT(RV1126)
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
SET(CMAKE_C_COMPILER "/home/xjt/SF6_RV1126/RV1126/buildroot/output/rockchip_rv1126_rv1109_dcir/host/bin/arm-linux-gnueabihf-gcc")
ADD_SUBDIRECTORY(src bin)
in CML2:
SET(
SRC_LIST
main.c
)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR/bin})
ADD_EXECUTABLE(drmDemo ${SRC_LIST})
I guess it's a linking problem, how should I modify CMake to link to libdrm?
As #Tsyvarev said, after ADD_EXECUTABLE() add LINK_LIBRARIES("....../lib/libdrm.so ") and TARGET_LINK_LIBRARIES(demo libdrm.so). Thanks again #Tsyvarev.
I am new to fortran and cmake, so I'm sure there is a simple fix I am missing!
error message:
100%] Linking Fortran executable dynamicmpm
CMakeFiles/dynamicmpm.dir/Solver.FOR.o: In function `modsolver_mp_createprofiledss_':
Solver.FOR:(.text+0x1143): undefined reference to `dss_create_'
Solver.FOR:(.text+0x11a8): undefined reference to `dss_define_structure_'
Solver.FOR:(.text+0x1471): undefined reference to `dss_reorder_'
CMakeFiles/dynamicmpm.dir/Solver.FOR.o: In function `modsolver_mp_solveequations_':
Solver.FOR:(.text+0x35ec): undefined reference to `dss_factor_real_d__'
Solver.FOR:(.text+0x361d): undefined reference to `dss_solve_real_d_'
CMakeFiles/dynamicmpm.dir/Solver.FOR.o: In function `modsolver_mp_destroyequations_':
Solver.FOR:(.text+0x4495): undefined reference to `dss_delete_'
CMakeFiles/dynamicmpm.dir/Solver.FOR.o: In function `modsolver_mp_initialisereducedsolution_':
Solver.FOR:(.text+0x5a58): undefined reference to `dss_create_'
Solver.FOR:(.text+0x5abd): undefined reference to `dss_define_structure_'
Solver.FOR:(.text+0x606d): undefined reference to `dss_reorder_'
I included use mkl_dss at the top of the Solver.FOR file
inside the cmakefile:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(MPM)
enable_language (Fortran)
set(CMAKE_Fortran_COMPILER_ID "GNU")
add_compile_options(-nologo -O2 -ldl -assume buffered_io -fpp -Dinternal_release
-reentrancy threaded -free -warn all -real_size 64 -Qauto -fp:strict
-fp:constant -libs:static -threads -Qmkl:sequential -Qm64
-fmax-identifier-length=63 -ffree-form -ffree-line-length-none -fdefault-real-8)
set(SRCS MOHRStrainSoftening.FOR getversion.for GlobalConstants.FOR mkl_dss.f90 String.for
Feedback.for FileIO.for MatrixMath.FOR timing.for ISORT.FOR GeoMath.FOR Counters.FOR
ElemCalcTETRA.FOR ReadCalculationData.FOR ElemCalcQUAD.FOR InitialiseKernel.FOR
ElemCalcTRI.FOR ReadMaterialData.FOR ElemCalc.FOR Particle.FOR MeshInfo.FOR
ElemConnections.FOR RotBoundCond.FOR ReadGeometryData.FOR InitialiseElementType.for
Solver.FOR MPMData.FOR WriteMPMData.FOR WriteVTKASCII.FOR TwoLayerFormulation.FOR
MPMDYNUnsatConsolidation.FOR WriteVTKBinary.FOR MPMStrainSmoothing.FOR WriteVTKOutput.FOR
MPMDYNConsolidation.FOR MPMStresses.FOR MPMDynContact.FOR MPMDynViscousBoundary.FOR
WriteTestData.FOR Liquid.FOR WriteVTK2Layer.FOR ReadMPMData.FOR RigidBody.f WriteNodalData.FOR
MPMMeshAdjustment.FOR MPMEmptyElements.FOR WriteResultData.FOR MPMConvPhase.FOR
ErrorHandler.for AdjustParticleDiscretisation.FOR MPMExcavation.FOR MPMInit.FOR MPMDYNBTSig.FOR
LagrangianPhase.FOR MPMDYNStresses.FOR MPMDYNConvPhase.FOR MPMQuasiStaticImplicit.FOR
MPMDynamicExplicit.FOR Kernel.for GetStrain.FOR Anura3D.for FORMDE.FOR BuildLoad.FOR
BuildDElastic.FOR MOHR.FOR BuildBJacDet.FOR PRNSTR.FOR GetPrinStress.FOR)
add_executable(dynamicmpm ${SRCS})
I'm sure I am just not linking it properly but I can't seem to find the mistake. I include mkl_dss.f90 in SRCS and have the appropriate use statement in SOLVER.FOR
I am including a link to my previous SO post in case that might be useful:
Executable file does not exist after compiling Fortran code
I am getting following error while openCV environment setup on my ubuntu 18.04. I have execute some commands which are related to libraries which is require then I have executed following one and shows error
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D WITH_TBB=ON \
-D WITH_V4L=ON \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..
and then following error occurs. Please check this and give solution if you have. Thanks in advance.
[ 30%] Built target opencv_photo
[ 30%] Built target opencv_plot
[ 31%] Built target opencv_imgcodecs
[ 32%] Built target opencv_reg
[ 32%] Built target opencv_xphoto
[ 32%] Built target opencv_video
[ 32%] Built target opencv_freetype
[ 35%] Built target opencv_dnn
[ 35%] Built target opencv_hfs
[ 35%] Built target opencv_fuzzy
[ 36%] Built target opencv_img_hash
[ 36%] Built target opencv_xobjdetect
[ 36%] Built target opencv_shape
[ 37%] Built target opencv_videoio
[ 38%] Built target opencv_face
[ 38%] Built target opencv_superres
[ 38%] Built target opencv_highgui
[ 38%] Built target example_hdf_read_write_attributes
[ 38%] Built target example_hdf_create_groups
[ 38%] Built target example_hdf_create_read_write_datasets
[ 39%] Built target opencv_ts
Scanning dependencies of target example_reg_map_test
Scanning dependencies of target example_surface_matching_ppf_load_match
[ 39%] Linking CXX executable ../../bin/example_phase_unwrapping_unwrap
[ 39%] Linking CXX executable ../../bin/example_plot_plot_demo
[ 39%] Building CXX object modules/reg/CMakeFiles/example_reg_map_test.dir/samples/map_test.cpp.o
[ 39%] Building CXX object modules/surface_matching/CMakeFiles/example_surface_matching_ppf_load_match.dir/samples/ppf_load_match.cpp.o
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadRGBAStrip#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadDirectory#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFWriteEncodedStrip#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFIsTiled#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFWriteScanline#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `_TIFFfree#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFGetField#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFNumberOfStrips#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFScanlineSize#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFWriteDirectory#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadEncodedTile#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadRGBATile#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFClose#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFClientOpen#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFRGBAImageOK#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFOpen#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadEncodedStrip#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFSetField#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFSetWarningHandler#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFSetErrorHandler#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `_TIFFmalloc#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadScanline#LIBTIFF_4.0'
collect2: error: ld returned 1 exit status
modules/phase_unwrapping/CMakeFiles/example_phase_unwrapping_unwrap.dir/build.make:100: recipe for target 'bin/example_phase_unwrapping_unwrap' failed
make[2]: *** [bin/example_phase_unwrapping_unwrap] Error 1
CMakeFiles/Makefile2:4625: recipe for target 'modules/phase_unwrapping/CMakeFiles/example_phase_unwrapping_unwrap.dir/all' failed
make[1]: *** [modules/phase_unwrapping/CMakeFiles/example_phase_unwrapping_unwrap.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadRGBAStrip#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadDirectory#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFWriteEncodedStrip#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFIsTiled#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFWriteScanline#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `_TIFFfree#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFGetField#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFNumberOfStrips#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFScanlineSize#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFWriteDirectory#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadEncodedTile#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadRGBATile#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFClose#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFClientOpen#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFRGBAImageOK#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFOpen#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadEncodedStrip#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFSetField#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFSetWarningHandler#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFSetErrorHandler#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `_TIFFmalloc#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadScanline#LIBTIFF_4.0'
collect2: error: ld returned 1 exit status
modules/plot/CMakeFiles/example_plot_plot_demo.dir/build.make:100: recipe for target 'bin/example_plot_plot_demo' failed
make[2]: *** [bin/example_plot_plot_demo] Error 1
CMakeFiles/Makefile2:5165: recipe for target 'modules/plot/CMakeFiles/example_plot_plot_demo.dir/all' failed
make[1]: *** [modules/plot/CMakeFiles/example_plot_plot_demo.dir/all] Error 2
[ 39%] Linking CXX executable ../../bin/example_surface_matching_ppf_load_match
[ 39%] Built target example_surface_matching_ppf_load_match
[ 39%] Linking CXX executable ../../bin/example_reg_map_test
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadRGBAStrip#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadDirectory#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFWriteEncodedStrip#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFIsTiled#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFWriteScanline#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `_TIFFfree#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFGetField#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFNumberOfStrips#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFScanlineSize#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFWriteDirectory#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadEncodedTile#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadRGBATile#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFClose#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFClientOpen#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFRGBAImageOK#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFOpen#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadEncodedStrip#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFSetField#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFSetWarningHandler#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFSetErrorHandler#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `_TIFFmalloc#LIBTIFF_4.0'
../../lib/libopencv_imgcodecs.so.3.4.1: undefined reference to `TIFFReadScanline#LIBTIFF_4.0'
collect2: error: ld returned 1 exit status
modules/reg/CMakeFiles/example_reg_map_test.dir/build.make:100: recipe for target 'bin/example_reg_map_test' failed
make[2]: *** [bin/example_reg_map_test] Error 1
CMakeFiles/Makefile2:5650: recipe for target 'modules/reg/CMakeFiles/example_reg_map_test.dir/all' failed
make[1]: *** [modules/reg/CMakeFiles/example_reg_map_test.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
It's opencv version and installation problem in ubuntu. Now i have followed following instruction and it's works perfectly.
https://www.learnopencv.com/install-opencv3-on-ubuntu
i'm trying to get started with a max-sat solver named: MAX_HS.
The documentation is only a readme file, is not so much but it's clear what you have to do:
https://github.com/fbacchus/MaxHS
I've installed CPLEX library from IBM and configured the file as indicated in the documentation, but when I compile i'm getting an error, this is my terminal log:
\\install -d /usr/local/include/maxhs
install -d /usr/local/include/minisat
for dir in maxhs/core maxhs/ifaces maxhs/ds maxhs/utils; do \
install -d /usr/local/include/$dir ; \
done
for dir in minisat/mtl minisat/utils minisat/core minisat/simp; do \
install -d /usr/local/include/$dir ; \
done
for h in minisat/mtl/Alg.h minisat/mtl/Map.h minisat/mtl/Alloc.h minisat/mtl/Vec.h minisat/mtl/Rnd.h minisat/mtl/Sort.h minisat/mtl/IntMap.h minisat/mtl/Queue.h minisat/mtl/IntTypes.h minisat/mtl/Heap.h minisat/mtl/XAlloc.h minisat/core/SolverTypes.h minisat/core/Dimacs.h minisat/core/Solver.h minisat/utils/System.h minisat/utils/ParseUtils.h
minisat/utils/Options.h minisat/simp/SimpSolver.h ;
do \
install -m 644 $h /usr/local/include/$h ; \
done
for h in maxhs/core/Bvars.h maxhs/core/Dimacs.h maxhs/core/MaxSolverTypes.h maxhs/core/Assumptions.h maxhs/core/Wcnf.h maxhs/core/MaxSolver.h maxhs/ifaces/miniSatSolver.h maxhs/ifaces/GreedySolver.h maxhs/ifaces/Cplex.h maxhs/ifaces/greedySatSolver.h maxhs/ifaces/muser.h maxhs/ifaces/SatSolver.h maxhs/ds/Packed.h maxhs/utils/io.h maxhs/utils/Params.h maxhs/utils/hash.h ;
do \
install -m 644 $h /usr/local/include/$h ; \
done
install -d /usr/local/lib
install -m 644 build/release/lib/libmaxhs.a /usr/local/lib
Linking Binary: build/release/bin/maxhs
/opt/ibm/ILOG/CPLEX_Studio128/cplex/lib/x86-64_linux/static_pic/libcplex.a(mkl_memory_patched.o): In function `mkl_serv_set_memory_limit':
mkl_memory.c:(.text+0x5a9): undefined reference to `dlopen'
mkl_memory.c:(.text+0x5ca): undefined reference to `dlsym'
mkl_memory.c:(.text+0x618): undefined reference to `dlsym'
mkl_memory.c:(.text+0x62e): undefined reference to `dlsym'
mkl_memory.c:(.text+0x644): undefined reference to `dlsym'
mkl_memory.c:(.text+0x739): undefined reference to `dlerror'
mkl_memory.c:(.text+0x78c): undefined reference to `dlopen'
mkl_memory.c:(.text+0x840): undefined reference to `dlopen'
mkl_memory.c:(.text+0x856): undefined reference to `dlerror'
mkl_memory.c:(.text+0x91a): undefined reference to `dlopen'
mkl_memory.c:(.text+0x922): undefined reference to `dlerror'
mkl_memory.c:(.text+0x937): undefined reference to `dlsym'
mkl_memory.c:(.text+0x95a): undefined reference to `dlopen'
mkl_memory.c:(.text+0x962): undefined reference to `dlerror'
mkl_memory.c:(.text+0x972): undefined reference to `dlsym'
mkl_memory.c:(.text+0x98d): undefined reference to `dlerror'
...
...
...
64_linux/static_pic/libcplex.a(mkl_semaphore.o): In function `_Init_MKL_Loader':
mkl_semaphore.c:(.text+0x4ed): undefined reference to `dladdr'
/opt/ibm/ILOG/CPLEX_Studio128/cplex/lib/x86-64_linux/static_pic/libcplex.a(libc_is_static_interface.o): In function `mkl_serv_libc_is_static':
libc_is_static_interface.c:(.text+0x10): undefined reference to `dladdr'
/opt/ibm/ILOG/CPLEX_Studio128/cplex/lib/x86-64_linux/static_pic/libcplex.a(load_library_HOST.o): In function `mkl_ueaa_prv_load_backend_lib':
load_library.c:(.text+0x1cd): undefined reference to `dlopen'
load_library.c:(.text+0x1ef): undefined reference to `dlvsym'
load_library.c:(.text+0x218): undefined reference to `dlvsym'
load_library.c:(.text+0x241): undefined reference to `dlvsym'
load_library.c:(.text+0x26a): undefined reference to `dlvsym'
load_library.c:(.text+0x293): undefined reference to `dlvsym'
/opt/ibm/ILOG/CPLEX_Studio128/cplex/lib/x86-64_linux/static_pic/libcplex.a(load_library_HOST.o):load_library.c:(.text+0x2bc): more undefined references to `dlvsym' follow
/opt/ibm/ILOG/CPLEX_Studio128/cplex/lib/x86-64_linux/static_pic/libcplex.a(mkl_aa_fw_load_orsl_lite_lib_HOST.o): In function `mkl_aa_fw_load_orsl_lite_lib':
mkl_aa_fw_load_orsl_lite_lib.c:(.text+0xb9): undefined reference to `dlopen'
mkl_aa_fw_load_orsl_lite_lib.c:(.text+0xd4): undefined reference to `dlsym'
mkl_aa_fw_load_orsl_lite_lib.c:(.text+0xf2): undefined reference to `dlsym'
mkl_aa_fw_load_orsl_lite_lib.c:(.text+0x110): undefined reference to `dlsym'
mkl_aa_fw_load_orsl_lite_lib.c:(.text+0x12e): undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
Makefile:155: recipe for target 'build/release/bin/maxhs' failed
make: *** [build/release/bin/maxhs] Error 1
Really don't know what can cause the error as the library are the official licensed IBM cplex library and the only setup is the one who assign the right path to the IBM library. I guess i've done correctly this step as when the path was wrong and no IBM library was found i was getting another error.
Any ideas?
Thank you!
With CPLEX 12.8 you have to link with the dynamic linker library. You can see this in the example makefiles shipped with CPLEX. Looking at the Makefile in the MaxHS git repository, you could try changing the following line (this has not been tested):
MAXHS_LDFLAGS = -Wall -lz -L$(CPLEXLIBDIR) -lcplex -lpthread
to:
MAXHS_LDFLAGS = -Wall -lz -L$(CPLEXLIBDIR) -lcplex -lpthread -ldl
If that works, you should consider creating an issue for the maintainers of MaxHS.
Alternately, you could install an older version of CPLEX (e.g., 12.7.1).
I am getting error while compiling qvfb for x11.
1> Now where is this png_create_write_struct is declared that i am getting error related to it ?
2> Does qvbf compilation for x11 looks for libpng in host file system or it looks for libpng inside QT_source_code ?
3> Please suggest How to resolve this error to compile successfully ?
#/qt-everywhere-opensource-src-4.8.5/tools/qvfb$ make
e-opensource-src-4.8.5/lib -L/usr/X11R6/lib -lQtGui -lQtCore -lGL -lpthread -lXext -lX11 -lm
.obj/release-shared/qanimationwriter.o: In function `QAnimationWriter::QAnimationWriter(QString const&, char const*)':
qanimationwriter.cpp:(.text+0xbf): undefined reference to `png_create_write_struct'
qanimationwriter.cpp:(.text+0xca): undefined reference to `png_create_info_struct'
qanimationwriter.cpp:(.text+0xe0): undefined reference to `png_set_compression_level'
qanimationwriter.cpp:(.text+0xff): undefined reference to `png_set_write_fn'
.obj/release-shared/qanimationwriter.o: In function `QAnimationWriterMNG::write(png_struct_def*, unsigned char*, unsigned int)':
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG5writeEP14png_struct_defPhj[QAnimationWriterMNG::write(png_struct_def*, unsigned char*, unsigned int)]+0xb): undefined reference to `png_get_io_ptr'
.obj/release-shared/qanimationwriter.o: In function `QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)':
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0x65): undefined reference to `png_write_chunk'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0x78): undefined reference to `png_set_sig_bytes'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0xda): undefined reference to `png_set_IHDR'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0xec): undefined reference to `png_write_info'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0x107): undefined reference to `png_set_bgr'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0x154): undefined reference to `png_write_image'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0x172): undefined reference to `png_write_end'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0x184): undefined reference to `png_destroy_write_struct'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0x1a8): undefined reference to `png_create_write_struct'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0x1b3): undefined reference to `png_create_info_struct'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0x1c9): undefined reference to `png_set_compression_level'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0x1e8): undefined reference to `png_set_write_fn'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG12composeImageERK6QImageRK6QPoint[QAnimationWriterMNG::composeImage(QImage const&, QPoint const&)]+0x21f): undefined reference to `png_set_filler'
.obj/release-shared/qanimationwriter.o: In function `QAnimationWriterMNG::~QAnimationWriterMNG()':
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNGD0Ev[_ZN19QAnimationWriterMNGD5Ev]+0x9e): undefined reference to `png_write_chunk'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNGD0Ev[_ZN19QAnimationWriterMNGD5Ev]+0xb0): undefined reference to `png_destroy_write_struct'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNGD0Ev[_ZN19QAnimationWriterMNGD5Ev]+0x176): undefined reference to `png_write_chunk'
.obj/release-shared/qanimationwriter.o: In function `QAnimationWriterMNG::setImage(QImage const&)':
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNG8setImageERK6QImage[QAnimationWriterMNG::setImage(QImage const&)]+0xc3): undefined reference to `png_write_chunk'
.obj/release-shared/qanimationwriter.o: In function `QAnimationWriterMNG::~QAnimationWriterMNG()':
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNGD2Ev[_ZN19QAnimationWriterMNGD5Ev]+0x9e): undefined reference to `png_write_chunk'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNGD2Ev[_ZN19QAnimationWriterMNGD5Ev]+0xb0): undefined reference to `png_destroy_write_struct'
qanimationwriter.cpp:(.text._ZN19QAnimationWriterMNGD2Ev[_ZN19QAnimationWriterMNGD5Ev]+0x16e): undefined reference to `png_write_chunk'
collect2: ld returned 1 exit status
make: *** [../../bin/qvfb] Error 1
locate command for libpng returns :--
#locate libpng
/lib/i386-linux-gnu/libpng12.so.0
/lib/i386-linux-gnu/libpng12.so.0.46.0
/usr/share/doc/libpng12-0
/usr/share/doc/libpng12-0/ANNOUNCE
/usr/share/doc/libpng12-0/KNOWNBUG
/usr/share/doc/libpng12-0/README.Debian
/usr/share/doc/libpng12-0/README.gz
/usr/share/doc/libpng12-0/TODO
/usr/share/doc/libpng12-0/changelog.Debian.gz
/usr/share/doc/libpng12-0/copyright
/usr/share/doc/libpng12-0/libpng-1.2.46.txt.gz
/usr/share/doc-base/libpng12
/var/lib/doc-base/documents/libpng12
/var/lib/dpkg/info/libpng12-0:i386.list
/var/lib/dpkg/info/libpng12-0:i386.md5sums
/var/lib/dpkg/info/libpng12-0:i386.postinst
/var/lib/dpkg/info/libpng12-0:i386.postrm
/var/lib/dpkg/info/libpng12-0:i386.shlibs
Now if my library is here /lib/i386-linux-gnu/libpng12.so.0 after running nm command :---
$ nm -D /lib/i386-linux-gnu/libpng12.so.0
00000000 A PNG12_0
w _Jv_RegisterClasses
w __cxa_finalize
U __fprintf_chk
w __gmon_start__
U __longjmp_chk
U __memcpy_chk
U __snprintf_chk
U __stack_chk_fail
U _setjmp
U abort
U crc32
U deflate
U deflateEnd
U deflateInit2_
U deflateReset
U fflush
U fputc
U fread
U free
U fwrite
U gmtime
U inflate
U inflateEnd
U inflateInit_
U inflateReset
U malloc
U memcmp
U memcpy
U memset
00004700 T png_access_version_number
00018540 T png_build_grayscale_palette
000039b0 T png_check_sig
0001de60 T png_chunk_error
0001def0 T png_chunk_warning
00014160 T png_convert_from_struct_tm
000141a0 T png_convert_from_time_t
00004470 T png_convert_to_rfc1123
00003c80 T png_create_info_struct
00011120 T png_create_read_struct
00010ca0 T png_create_read_struct_2
00015840 T png_create_write_struct
000154c0 T png_create_write_struct_2
00003cf0 T png_data_freer
000043b0 T png_destroy_info_struct
000130f0 T png_destroy_read_struct
00014930 T png_destroy_write_struct
0001db30 T png_error
0001d8f0 T png_free
00003d80 T png_free_data
0001d8b0 T png_free_default
00006e80 T png_get_IHDR
000071a0 T png_get_PLTE
00007410 T png_get_asm_flagmask
00007400 T png_get_asm_flags
00006a90 T png_get_bKGD
000067f0 T png_get_bit_depth
00006ad0 T png_get_cHRM
00006bf0 T png_get_cHRM_fixed
00006a50 T png_get_channels
00006810 T png_get_color_type
000073e0 T png_get_compression_buffer_size
00006870 T png_get_compression_type
000045c0 T png_get_copyright
0001dfb0 T png_get_error_ptr
00006830 T png_get_filter_type
00006cd0 T png_get_gAMA
00006d10 T png_get_gAMA_fixed
00006e40 T png_get_hIST
00004600 T png_get_header_ver
00004620 T png_get_header_version
00006d90 T png_get_iCCP
000067d0 T png_get_image_height
000067b0 T png_get_image_width
000076e0 T png_get_int_32
00006850 T png_get_interlace_type
00004430 T png_get_io_ptr
000045e0 T png_get_libpng_ver
0001da30 T png_get_mem_ptr
00007430 T png_get_mmx_bitdepth_threshold
00007420 T png_get_mmx_flagmask
00007440 T png_get_mmx_rowbytes_threshold
00006fa0 T png_get_oFFs
00007010 T png_get_pCAL
00007130 T png_get_pHYs
00006930 T png_get_pixel_aspect_ratio
000068f0 T png_get_pixels_per_meter
000204b0 T png_get_progressive_ptr
000073a0 T png_get_rgb_to_gray_status
00006770 T png_get_rowbytes
00006790 T png_get_rows
000071f0 T png_get_sBIT
000070e0 T png_get_sCAL
00006e10 T png_get_sPLT
00006d50 T png_get_sRGB
00006a70 T png_get_signature
000072a0 T png_get_tIME
000072e0 T png_get_tRNS
00007230 T png_get_text
00007710 T png_get_uint_16
00007630 T png_get_uint_31
000076b0 T png_get_uint_32
00007370 T png_get_unknown_chunks
000073c0 T png_get_user_chunk_ptr
00007470 T png_get_user_height_max
0000c720 T png_get_user_transform_ptr
00007450 T png_get_user_width_max
00006750 T png_get_valid
00006990 T png_get_x_offset_microns
000069f0 T png_get_x_offset_pixels
00006890 T png_get_x_pixels_per_meter
000069c0 T png_get_y_offset_microns
00006a20 T png_get_y_offset_pixels
000068c0 T png_get_y_pixels_per_meter
00004640 T png_handle_as_unknown
00003c50 T png_info_init
00003b70 T png_info_init_3
00004450 T png_init_io
00020a90 R png_libpng_ver
0001d7b0 T png_malloc
0001d770 T png_malloc_default
0001d940 T png_malloc_warn
0001d9a0 T png_memcpy_check
0001d9d0 T png_memset_check
00004710 T png_mmx_support
000209e0 R png_pass_dsp_mask
00020a50 R png_pass_inc
000209fc R png_pass_mask
00020a6c R png_pass_start
00020a18 R png_pass_yinc
00020a34 R png_pass_ystart
00006400 T png_permit_empty_plte
00006430 T png_permit_mng_features
00020370 T png_process_data
00020400 T png_progressive_combine_row
00012cd0 T png_read_destroy
000126a0 T png_read_end
00012600 T png_read_image
00011690 T png_read_info
00013250 T png_read_png
00011ea0 T png_read_row
00012510 T png_read_rows
00011e00 T png_read_update_info
000046c0 T png_reset_zstream
0000cb70 T png_save_int_32
0000cba0 T png_save_uint_16
0000cb40 T png_save_uint_32
00005320 T png_set_IHDR
00005750 T png_set_PLTE
0000c110 T png_set_add_alpha
00006700 T png_set_asm_flags
00004d60 T png_set_bKGD
00015d70 T png_set_background
0000bfb0 T png_set_bgr
00004da0 T png_set_cHRM
00004f20 T png_set_cHRM_fixed
00006660 T png_set_compression_buffer_size
00015890 T png_set_compression_level
000158b0 T png_set_compression_mem_level
00015990 T png_set_compression_method
000158d0 T png_set_compression_strategy
000158f0 T png_set_compression_window_bits
00015c20 T png_set_crc_action
00015e70 T png_set_dither
0001df80 T png_set_error_fn
00016a40 T png_set_expand
00016a80 T png_set_expand_gray_1_2_4_to_8
0000c0a0 T png_set_filler
00014a60 T png_set_filter
00014d00 T png_set_filter_heuristics
00014580 T png_set_flush
000050a0 T png_set_gAMA
00005180 T png_set_gAMA_fixed
000169c0 T png_set_gamma
00016aa0 T png_set_gray_1_2_4_to_8
00016ae0 T png_set_gray_to_rgb
00005240 T png_set_hIST
000059c0 T png_set_iCCP
0000c070 T png_set_interlace_handling
000066e0 T png_set_invalid
0000c180 T png_set_invert_alpha
0000c1a0 T png_set_invert_mono
00006450 T png_set_keep_unknown_chunks
0001da00 T png_set_mem_fn
00006720 T png_set_mmx_thresholds
00005470 T png_set_oFFs
000054a0 T png_set_pCAL
00005720 T png_set_pHYs
0000bff0 T png_set_packing
0000c020 T png_set_packswap
00016a60 T png_set_palette_to_rgb
00020450 T png_set_progressive_read_fn
00013620 T png_set_read_fn
00013230 T png_set_read_status_fn
000065c0 T png_set_read_user_chunk_fn
00016d80 T png_set_read_user_transform_fn
00016c70 T png_set_rgb_to_gray
00016b00 T png_set_rgb_to_gray_fixed
000065e0 T png_set_rows
00005830 T png_set_sBIT
000056c0 T png_set_sCAL
00005fb0 T png_set_sPLT
00005860 T png_set_sRGB
00005880 T png_set_sRGB_gAMA_and_cHRM
0000c040 T png_set_shift
00003880 T png_set_sig_bytes
00015e30 T png_set_strip_16
00015e50 T png_set_strip_alpha
0001dfd0 T png_set_strip_error_numbers
0000bfd0 T png_set_swap
0000c160 T png_set_swap_alpha
00005df0 T png_set_tIME
00005e30 T png_set_tRNS
00016ac0 T png_set_tRNS_to_alpha
00005d90 T png_set_text
000063c0 T png_set_unknown_chunk_location
000061e0 T png_set_unknown_chunks
00006730 T png_set_user_limits
0000c6f0 T png_set_user_transform_info
000137c0 T png_set_write_fn
000159f0 T png_set_write_status_fn
00015a10 T png_set_write_user_transform_fn
000038f0 T png_sig_cmp
00011e70 T png_start_read_image
0001dcf0 T png_warning
0000cee0 T png_write_chunk
0000cd10 T png_write_chunk_data
0000ce60 T png_write_chunk_end
0000cc60 T png_write_chunk_start
000146d0 T png_write_destroy
00013f60 T png_write_end
000145a0 T png_write_flush
000144b0 T png_write_image
00013b20 T png_write_info
00013860 T png_write_info_before_PLTE
00015a30 T png_write_png
000141d0 T png_write_row
00014530 T png_write_rows
U pow
U stderr
U strlen
U strtod
I searched for png.h file :---
# locate png.h
/home/dinesh/qt_source/qt_source_x11/qt-everywhere-opensource-src-4.8.5/src/3rdparty/libpng/png.h
/usr/lib/syslinux/com32/include/png.h
Now lib png source is inside QT_source also :---
/qt-everywhere-opensource-src-4.8.5/src/3rdparty/libpng$ ls
ANNOUNCE pngconf.h pnglibconf.h pngrtran.c pngwrite.c
CHANGES pngdebug.h pngmem.c pngrutil.c pngwtran.c
INSTALL pngerror.c pngpread.c pngset.c pngwutil.c
libpng-manual.txt pngget.c pngpriv.h pngstruct.h README
LICENSE png.h pngread.c pngtrans.c
png.c pnginfo.h pngrio.c pngwio.c
==================================== EDIT ==========================
I performed these steps, both failed :---
1> I followed following link http://www.brunolinux.com/02-The_Terminal/ldconfig.html and
added following line to ld.so.conf file /lib/i386-linux-gnu/ . Then i run the ldconfig command.
I directly copied the command line result of make & added -lpng to it & run it
qt-everywhere-opensource-src-4.8.5/tools/qvfb$ g++ -Wl,-rpath-link,/home/dinesh/qt_source/qt_source_x11/qt-everywhere-opensource-src-4.8.5/lib -Wl,-O1 -Wl,-rpath,/opt/Qt5.1.1/4.8.5_X11/gcc/lib -Wl,-rpath,/opt/Qt5.1.1/4.8.5_X11/gcc/lib -o ../../bin/qvfb .obj/release-shared/qvfb.o .obj/release-shared/qvfbview.o .obj/release-shared/qvfbratedlg.o .obj/release-shared/main.o .obj/release-shared/qanimationwriter.o .obj/release-shared/qvfbprotocol.o .obj/release-shared/qvfbshmem.o .obj/release-shared/qvfbmmap.o .obj/release-shared/qlock.o .obj/release-shared/qwslock.o .obj/release-shared/qwssignalhandler.o .obj/release-shared/deviceskin.o .obj/release-shared/qvfbx11view.o .obj/release-shared/x11keyfaker.o .obj/release-shared/moc_qvfb.o .obj/release-shared/moc_qvfbview.o .obj/release-shared/moc_qvfbratedlg.o .obj/release-shared/moc_gammaview.o .obj/release-shared/moc_qvfbprotocol.o .obj/release-shared/moc_qvfbshmem.o .obj/release-shared/moc_qvfbmmap.o .obj/release-shared/moc_deviceskin.o .obj/release-shared/moc_qvfbx11view.o .obj/release-shared/moc_x11keyfaker.o .obj/release-shared/qrc_ClamshellPhone.o .obj/release-shared/qrc_SmartPhone2.o .obj/release-shared/qrc_SmartPhone.o .obj/release-shared/qrc_SmartPhoneWithButtons.o .obj/release-shared/qrc_TouchscreenPhone.o .obj/release-shared/qrc_PortableMedia.o .obj/release-shared/qrc_S60-QVGA-Candybar.o .obj/release-shared/qrc_S60-nHD-Touchscreen.o .obj/release-shared/qrc_qvfb.o -lpng -L/home/dinesh/qt_source/qt_source_x11/qt-everywhere-opensource-src-4.8.5/lib -L/usr/X11R6/lib -lXtst -lQtOpenGL -L/home/dinesh/qt_source/qt_source_x11/qt-everywhere-opensource-src-4.8.5/lib -L/usr/X11R6/lib -lQtGui -lQtCore -lGL -lpthread -lXext -lX11 -lm
/usr/bin/ld: cannot find -lpng
collect2: ld returned 1 exit status
make: *** [../../bin/qvfb] Error 1
2> Above step did not worked so i performed below step.
I modified the qvfb.pro file of QT & added the option at the end LIBS += -lpng
qt-everywhere-opensource-src-4.8.5/tools/qvfb$ sudo make
/home/dinesh/qt_source/qt_source_x11/qt-everywhere-opensource-src-4.8.5/bin/qmake -spec ../../mkspecs/linux-g++ -o Makefile qvfb.pro
g++ -Wl,-rpath-link,/home/dinesh/qt_source/qt_source_x11/qt-everywhere-opensource-src-4.8.5/lib -Wl,-O1 -Wl,-rpath,/opt/Qt5.1.1/4.8.5_X11/gcc/lib -Wl,-rpath,/opt/Qt5.1.1/4.8.5_X11/gcc/lib -o ../../bin/qvfb .obj/release-shared/qvfb.o .obj/release-shared/qvfbview.o .obj/release-shared/qvfbratedlg.o .obj/release-shared/main.o .obj/release-shared/qanimationwriter.o .obj/release-shared/qvfbprotocol.o .obj/release-shared/qvfbshmem.o .obj/release-shared/qvfbmmap.o .obj/release-shared/qlock.o .obj/release-shared/qwslock.o .obj/release-shared/qwssignalhandler.o .obj/release-shared/deviceskin.o .obj/release-shared/qvfbx11view.o .obj/release-shared/x11keyfaker.o .obj/release-shared/moc_qvfb.o .obj/release-shared/moc_qvfbview.o .obj/release-shared/moc_qvfbratedlg.o .obj/release-shared/moc_gammaview.o .obj/release-shared/moc_qvfbprotocol.o .obj/release-shared/moc_qvfbshmem.o .obj/release-shared/moc_qvfbmmap.o .obj/release-shared/moc_deviceskin.o .obj/release-shared/moc_qvfbx11view.o .obj/release-shared/moc_x11keyfaker.o .obj/release-shared/qrc_ClamshellPhone.o .obj/release-shared/qrc_SmartPhone2.o .obj/release-shared/qrc_SmartPhone.o .obj/release-shared/qrc_SmartPhoneWithButtons.o .obj/release-shared/qrc_TouchscreenPhone.o .obj/release-shared/qrc_PortableMedia.o .obj/release-shared/qrc_S60-QVGA-Candybar.o .obj/release-shared/qrc_S60-nHD-Touchscreen.o .obj/release-shared/qrc_qvfb.o -L/home/dinesh/qt_source/qt_source_x11/qt-everywhere-opensource-src-4.8.5/lib -L/usr/X11R6/lib -lXtst -lpng -lQtOpenGL -L/home/dinesh/qt_source/qt_source_x11/qt-everywhere-opensource-src-4.8.5/lib -L/usr/X11R6/lib -lQtGui -lQtCore -lGL -lpthread -lXext -lX11 -lm
/usr/bin/ld: cannot find -lpng
collect2: ld returned 1 exit status
make: *** [../../bin/qvfb] Error 1
============================= EDIT =================
Thanks everyone its working.
creating softlink works :--
ln -s /lib/i386-linux-gnu/libpng12.so.0 /lib/i386-linux-gnu/libpng.so
this worked :---
-L/lib/i386-linux-gnu -lpng
Also you can directly modify your qvfb.pro file, instead of putting in directly in command line :---
LIBS = -L/lib/i386-linux-gnu -lpng
I had the same problem. If you look at the compilation line to link qvfb that causes the error, you'll see that it just misses -lpng to indicate to link with libpng. It's just a workaround, but once you've run 'make' once, you can simply copy and past the faulty compilation line and add -lpng at the end. It worked for me.