Issues

Issue #81 closed

Trying to compile libgd 2.1.0 on Windows | Cmake Error

Anonymous created an issue

Hello guys,

I'm trying to compile libgd 2.1.0 but when i execute cmake with the following command :

C:\Users\xxxx\Desktop\Compilation GD 2.1.0\libgd-2.1.0>cmake -G"MinGW Makefile
" -DCMAKE_LIBRARY_PATH=c:\MinGW\lib -DCMAKE_INCLUDE_PATH=c:\MinGW\include .\src

I'm face this error :

CMake Error at CMakeLists.txt:83 (target_link_libraries):
  target_link_libraries called with incorrect number of arguments


CMake Error at CMakeLists.txt:84 (target_link_libraries):
  target_link_libraries called with incorrect number of arguments


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.8)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!

Need some help ...

Comments (20)

  1. Anonymous
    C:\Users\xxxx>cmake --version
    cmake version 2.8.11
    

    I'm using CMake 2.8.11. The latest version so...

  2. Anonymous

    I tried to move the line but i don't think that's the real problem. It's a CMake Warning (dev) so not blocking.

    The real problem is the both CMake Error (blocking) above this warning.

    Here a cmake --trace for more information

    C:\Users\xxxx\Desktop\Compilation GD 2.1.0\libgd-2.1.0>cmake -G"MinGW Makefiles " -DCMAKE_LIBRARY_PATH=c:\MinGW\lib -DCMAKE_INCLUDE_PATH=c:\MinGW\include .\src --trace
    
    C:/Users/xxxx/Desktop/Compilation GD 2.1.0/libgd-2.1.0/src/CMakeLists.txt(83):
     target_link_libraries(${GD_LIB} ${ZLIB_LIBRARIES} ${FREETYPE_LIBRARIES} ${PNG_LIBRARIES} ${LIQ_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${XPM_LIBRARIES} ${FONTCONFIG_LIBRARY} ${VPX_LIBRARIES} )
    CMake Error at CMakeLists.txt:83 (target_link_libraries):
      target_link_libraries called with incorrect number of arguments
    
    
    C:/Users/xxxx/Desktop/Compilation GD 2.1.0/libgd-2.1.0/src/CMakeLists.txt(84):
     target_link_libraries(${GD_LIB_STATIC} ${ZLIB_LIBRARIES} ${FREETYPE_LIBRARIES} ${PNG_LIBRARIES} ${LIQ_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${XPM_LIBRARIES} ${FONTCONFIG_LIBRARY} ${VPX_LIBRARIES} )
    CMake Error at CMakeLists.txt:84 (target_link_libraries):
      target_link_libraries called with incorrect number of arguments
    

    Regards,

  3. Anonymous
    • changed status to open

    I tried to move the line but i don't think that's the real problem. It's a CMake Warning (dev) so not blocking.

    The real problem is the both CMake Error (blocking) above this warning.

    Here a cmake --trace for more information

    C:\Users\xxxx\Desktop\Compilation GD 2.1.0\libgd-2.1.0>cmake -G"MinGW Makefiles " -DCMAKE_LIBRARY_PATH=c:\MinGW\lib -DCMAKE_INCLUDE_PATH=c:\MinGW\include .\src --trace
    
    C:/Users/xxxx/Desktop/Compilation GD 2.1.0/libgd-2.1.0/src/CMakeLists.txt(83):
     target_link_libraries(${GD_LIB} ${ZLIB_LIBRARIES} ${FREETYPE_LIBRARIES} ${PNG_LIBRARIES} ${LIQ_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${XPM_LIBRARIES} ${FONTCONFIG_LIBRARY} ${VPX_LIBRARIES} )
    CMake Error at CMakeLists.txt:83 (target_link_libraries):
      target_link_libraries called with incorrect number of arguments
    
    
    C:/Users/xxxx/Desktop/Compilation GD 2.1.0/libgd-2.1.0/src/CMakeLists.txt(84):
     target_link_libraries(${GD_LIB_STATIC} ${ZLIB_LIBRARIES} ${FREETYPE_LIBRARIES} ${PNG_LIBRARIES} ${LIQ_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${XPM_LIBRARIES} ${FONTCONFIG_LIBRARY} ${VPX_LIBRARIES} )
    CMake Error at CMakeLists.txt:84 (target_link_libraries):
      target_link_libraries called with incorrect number of arguments
    

    Regards,

  4. Pierre Joye

    c:\MinGW\ as usual \lib and \include, also I'm not sure if it wants \ or / as path separator. Can you try / please? You can install them (with the -devel) files using the usual mingw command line install tools.

  5. Sergei Pestov

    Hello!

    I've got exactly the same error as kwentakill. The environment is the following:

    • Windows 7 64-bit Home Extended
    • C:\MinGW\
    • cmake version 2.8.11.2

    seems like something wrong with target_link_libraries invocation

    Cheers

  6. Anonymous

    Hello guys,

    Holidays are over =) Any news about this issue ? Someone can help ?

    Regards,

  7. jlgerst

    Looks like you're telling cmake to use ./src as the top level dir.

    But, there is another problem (at least for me). src/gd.h isn't being automatically created from src/gd.h.in ... my clever workaround is to rename it. This worked for me (note the .. at the end of the cmake line):

    C:\libgd-2.1.0>ren src\gd.h.in gd.h
    C:\libgd-2.1.0>md build
    C:\libgd-2.1.0>cd build
    C:\libgd-2.1.0\build>cmake -G"MinGW Makefiles" -DCMAKE_LIBRARY_PATH=C:\MinGW\lib -DCMAKE_INCLUDE_PATH=C:\MinGW\include ..
    
    C:\libgd-2.1.0\build>mingw32-make
    
    C:\libgd-2.1.0\build>mingw32-make install
    
  8. Nathanael Jones

    @jigerst, could you share (a) your version of msys/mingw32, and (b) your tooling versions? Nobody on my team has had any success getting cmake to function on Windows.

  9. libgd repo owner

    OK, I will look into it. Surely a small thing as I always use CMake on win.

    As of mingw, pls do not mix mingw build and vc, even for the deps :)

  10. Nathanael Jones

    You can find a file 'thumbs.bat' in 2.1.1+. This file should be capable of downloading and compiling all dependencies, as well as libgd itself. If you're running into trouble with cmake or autotools, give thumbs.bat a try.

  11. Log in to comment