Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1037053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:48:20+00:00 2026-05-16T14:48:20+00:00

actually i create a CMake script to localize the DevIL library using MSYS/MinGW on

  • 0

actually i create a CMake script to localize the DevIL library using MSYS/MinGW on win32 platform. I’ve extend the origin FindDevIL CMake script to regard the MinGW root when try to find DevIL:

project (DevILTest)
cmake_minimum_required(VERSION 2.6)

FIND_PACKAGE(OpenGL)
IF(OPENGL_FOUND)
  MESSAGE(STATUS "OpenGL render API found.")
  MESSAGE(STATUS "Detected OpenGL path is : ${OPENGL_LIBRARIES}")   
ENDIF(OPENGL_FOUND)

#Determine DevIL specific header file           
FIND_PATH(IL_INCLUDE_DIR il.h 
      PATH_SUFFIXES include/IL
      PATHS c:/mingw
      DOC "The path the the directory that contains il.h"
)
MESSAGE("Found DevIL includes at: ${IL_INCLUDE_DIR}")

#Determine DevIL library
FIND_LIBRARY(IL_LIBRARY NAMES DEVIL
     PATH_SUFFIXES lib 
     PATHS c:/mingw
     DOC "The file that corresponds to the base il library."
)
MESSAGE("Found DevIL library at: ${IL_LIBRARY}")

SET (Sources
winmain.cpp
)

SET(CMAKE_VERBOSE_MAKEFILE ON)
SET(IL_INCLUDE_DIR /c/binrev/development/mingw/include)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} 
             ${CMAKE_CURRENT_SOURCE_DIR}/src 
             ${IL_INCLUDE_DIR}
             /usr/include 
             /usr/local/include               
)

add_executable (DevILTest ${Sources})
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR})
TARGET_LINK_LIBRARIES(DevILTest ${OPENGL_LIBRARIES} ${IL_LIBRARY})

The DevIL .dll files are placed in bin subfolder, the DevIL.lib and DevIL.a files in the lib subfolder of MinGW root (c:/mingw). I use find_library() to check if a library exists.

-- OpenGL render API found.
-- Detected OpenGL path is : glu32;opengl32
-- Found DevIL includes at: C:/mingw/include/IL
-- Found DevIL library at: C:/mingw/bin/DevIL.dll

Find_libary() returns allways the path to the dll files – but I can’t link against this library using MinGW:

Linking CXX executable DevILTest.exe
/C/binrev/development/mingw/bin/g++.exe     "CMakeFiles/DevILTest.dir  /winmain.cpp.obj"   -o DevILTest.exe -Wl,--out-implib,libDevILTest.dll.a -Wl,--ma
32 -lopengl32 DevIL.dll -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
CMakeFiles/DevILTest.dir/winmain.cpp.obj:winmain.cpp:(.text+0xcc8): undefined reference to `_imp__ilOriginFunc@4'
CMakeFiles/DevILTest.dir/winmain.cpp.obj:winmain.cpp:(.text+0xce0): undefined reference to `_imp__ilEnable@4'
CMakeFiles/DevILTest.dir/winmain.cpp.obj:winmain.cpp:(.text+0xcf9): undefined reference to `_imp__ilSetInteger@8'

If i remove the dll files and run the cmake skript the DevIL.lib library is localized correctly and i go no linker failures:

-- Detected OpenGL path is : glu32;opengl32
-- Found DevIL includes at: C:/mingw/include/IL
-- Found DevIL library at: C:/mingw/lib/DevIL.lib

But when in this case the applicaton crashes on start up while missing the dll files. If i add them now back to mingw or application root the application runs, but fails again on cmake execution while localize the dll files instead of .lib …

Has anyone an idea how i could solve this issue?
I would be deeply gratefull for any hint.
Best regards,
Christian

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:48:21+00:00Added an answer on May 16, 2026 at 2:48 pm

    This problem is solved. I’ve to search for the complete name of the library, i.e. libDevIL.lib in my CMake script. In this case the library is found correctly:

    #Determine DevIL library
    FIND_LIBRARY(IL_LIBRARY NAMES libDEVIL.lib
         PATH_SUFFIXES lib 
         PATHS c:/mingw
         DOC "The file that corresponds to the base il library."
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 540k
  • Answers 540k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can try detecting the presence of the plugin with… May 17, 2026 at 2:32 am
  • Editorial Team
    Editorial Team added an answer Interesting question. If you can detect a validation error, then… May 17, 2026 at 2:32 am
  • Editorial Team
    Editorial Team added an answer Turbo Pascal could only generate 16-bit code, there was never… May 17, 2026 at 2:32 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm trying to create a cmake equivalent to the following make: demo: main.cpp gcc
gcc 4.4.2 / Visual Studio C++ 2008 I have been using cmake on linux,
I'm trying to create a facebook application that is flash (actually flex 4.1) based.
My Win32 app A1 (actually a collection of processes) is trying to use CreateDirectory
I am trying to create a button using CSS Gradients plus a icon that
I'm using Reportlab to create PDFs. I'm creating two PDFs which I want to
i am trying to do a simple form that adds a new comment using
We create all our site collections programatically with a custom site def/template. Everything works
I have a need to create a quick class with just 2 properties (left
Have anybody ever tried to create thumbnails/previews of MS Office files? I do not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.