# When running make I get an error

**URL:** https://discourse.cmake.org/t/when-running-make-i-get-an-error/4673
**Category:** Usage
**Created:** [December 15, 2021, 3:08pm UTC](https://discourse.cmake.org/t/when-running-make-i-get-an-error/4673 "2021-12-15T15:08:09Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![greendragon](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/g/ce73a5/32.png) [@greendragon](https://discourse.cmake.org/u/greendragon)
#### Post date: [December 15, 2021, 3:08pm UTC](https://discourse.cmake.org/t/when-running-make-i-get-an-error/4673/1 "2021-12-15T15:08:09Z")

</div>

No rule to make target ‘/usr/lib/x86\_64-linux-gnu/libSDL2\_image.so’, needed by ‘SDL2Test’. Stop.

CMakeFiles/Makefile2:72: recipe for target ‘CMakeFiles/SDL2Test.dir/all’ failed

make[1]: \*\*\* [CMakeFiles/SDL2Test.dir/all] Error 2

Makefile:83: recipe for target ‘all’ failed

make: \*\*\* [all] Error 2

The code is from the internet: Trenki’s blog, I want to learn how to make CMakeLists.txt  
This is the github repository:  
[GitHub - trenki2/SDL2Test: Show how to use SDL2 with CMake](https://github.com/trenki2/SDL2Test.git).  
Thanks.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 15, 2021, 3:09pm UTC](https://discourse.cmake.org/t/when-running-make-i-get-an-error/4673/2 "2021-12-15T15:09:40Z")

</div>

It looks like your build had found `libSDL2_image.so` at one point, but it has since been removed. Did you remove the `-dev` package for it after the initial configure?

---

<div class="post-metadata">

### Author: ![greendragon](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/g/ce73a5/32.png) [@greendragon](https://discourse.cmake.org/u/greendragon)
#### Post date: [December 15, 2021, 3:15pm UTC](https://discourse.cmake.org/t/when-running-make-i-get-an-error/4673/3 "2021-12-15T15:15:02Z")

</div>

That was the fastest answer I ever received.  
When I first ran the application I saw the black screen like it is supposed to show, for a second, but then it closed and never appeared again. I didn’t remove anything.  
Thanks.

I ran this line: sudo apt-get install libsdl2-image-dev

which I found online.

Do I have to run it every time?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 15, 2021, 3:19pm UTC](https://discourse.cmake.org/t/when-running-make-i-get-an-error/4673/4 "2021-12-15T15:19:34Z")

</div>

You shouldn’t have to. It’s not clear how the project found the file and then it disappeared when it the build ran.

---

<div class="post-metadata">

### Author: ![greendragon](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/g/ce73a5/32.png) [@greendragon](https://discourse.cmake.org/u/greendragon)
#### Post date: [December 15, 2021, 3:27pm UTC](https://discourse.cmake.org/t/when-running-make-i-get-an-error/4673/5 "2021-12-15T15:27:13Z")

</div>

I used to get a different error, the **cmake …** wasn’t working, I wrote here then I found that line on the internet, then I saw your answer, which I can’t find now - but my cmake had begun to work.  
So should I keep that line that I found, or should I use something else?

cmake - followed by 2 dots, not three

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 15, 2021, 3:34pm UTC](https://discourse.cmake.org/t/when-running-make-i-get-an-error/4673/6 "2021-12-15T15:34:33Z")

</div>

> [@greendragon](#):
>
> cmake - followed by 2 dots, not three

“Two dots” means “parent directory”. “Three dots” is a path named “…” which probably doesn’t exist.

---

<div class="post-metadata">

### Author: ![greendragon](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/g/ce73a5/32.png) [@greendragon](https://discourse.cmake.org/u/greendragon)
#### Post date: [December 15, 2021, 4:15pm UTC](https://discourse.cmake.org/t/when-running-make-i-get-an-error/4673/7 "2021-12-15T16:15:31Z")

</div>

I mean I wrote cmake followed by two dots, I didn’t write 3 dots like the computer writes.That is not the mistake I am making.

---

<div class="post-metadata">

### Author: ![greendragon](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/g/ce73a5/32.png) [@greendragon](https://discourse.cmake.org/u/greendragon)
#### Post date: [December 15, 2021, 4:20pm UTC](https://discourse.cmake.org/t/when-running-make-i-get-an-error/4673/8 "2021-12-15T16:20:11Z")

</div>

Ok, first I was told to use

You need `libsdl-image-dev` , `SDL2_image-devel` , or similar installed (depending on the distro you’re using) to have the SDL2\_image headers.

I used sudo apt-get install libsdl2-image-dev, I know very little but I think they are similar. Are they?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 15, 2021, 4:24pm UTC](https://discourse.cmake.org/t/when-running-make-i-get-an-error/4673/9 "2021-12-15T16:24:17Z")

</div>

Package names differ from distro to distro. Without knowing it’s hard to give specific advice, but giving advice along the lines of “it looks something like this” can avoid a Q/A cycle.

At this point, it’s not really clear what the status of your situation is to me though, so more details as to any problems would help.

---

<div class="post-metadata">

### Author: ![greendragon](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/g/ce73a5/32.png) [@greendragon](https://discourse.cmake.org/u/greendragon)
#### Post date: [December 15, 2021, 4:56pm UTC](https://discourse.cmake.org/t/when-running-make-i-get-an-error/4673/10 "2021-12-15T16:56:37Z")

</div>

Well the context is that I am at an online C++ school, where I am learning C++. I did the final project in Visual C++ and I have to upload it to the school’s VM Linux environment.  
They gave us the Trenki’s blog link to see how this environment compatibility should be done for those who choose to use SDL2\_image in the project. I will make the CMakeLists.txt myself, but first I want to run this.  
I know nothing about the distributor or distribution etc.

Here is the cmake error I used to get:

When I run the project at cmake … I get the following error:

The C compiler identification is GNU 5.5.0

– The CXX compiler identification is GNU 7.5.0

– Check for working C compiler: /usr/bin/cc

– Check for working C compiler: /usr/bin/cc – works

– Detecting C compiler ABI info

– Detecting C compiler ABI info - done

– Detecting C compile features

– Detecting C compile features - done

– Check for working CXX compiler: /usr/bin/g+±7

– Check for working CXX compiler: /usr/bin/g+±7 – works

– Detecting CXX compiler ABI info

– Detecting CXX compiler ABI info - done

– Detecting CXX compile features

– Detecting CXX compile features - done

– Looking for pthread.h

– Looking for pthread.h - found

– Looking for pthread\_create

– Looking for pthread\_create - not found

– Looking for pthread\_create in pthreads

– Looking for pthread\_create in pthreads - not found

– Looking for pthread\_create in pthread

– Looking for pthread\_create in pthread - found

– Found Threads: TRUE

– Found SDL2: /usr/lib/x86\_64-linux-gnu/libSDL2.so;-lpthread

CMake Error at /usr/local/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):

Could NOT find SDL2\_image (missing: SDL2\_IMAGE\_LIBRARIES

SDL2\_IMAGE\_INCLUDE\_DIRS)

Call Stack (most recent call first):

/usr/local/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (\_FPHSA\_FAILURE\_MESSAGE)

cmake/FindSDL2\_image.cmake:93 (FIND\_PACKAGE\_HANDLE\_STANDARD\_ARGS)

CMakeLists.txt:8 (find\_package)

– Configuring incomplete, errors occurred!

See also “/home/workspace/SDL2Test/build/CMakeFiles/CMakeOutput.log”.

See also “/home/workspace/SDL2Test/build/CMakeFiles/CMakeError.log”.

Any help would be much appreciated.  
Thanks.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 15, 2021, 7:21pm UTC](https://discourse.cmake.org/t/when-running-make-i-get-an-error/4673/11 "2021-12-15T19:21:07Z")

</div>

Ah, ok. So you’ll need to get the `libsdl2-image-dev` package as needed in the Linux environment. If you get a fresh one each time, you’ll need to download it again.
