Almamu / linux-wallpaperengine

Wallpaper Engine backgrounds for Linux!
GNU General Public License v3.0
1.67k stars 61 forks source link

Unable to Linking CXX executable wallengine. #60

Closed Freddyv2356 closed 2 years ago

Freddyv2356 commented 2 years ago

When i try to run "make" command and with full dependencies installed it's run half way until Linking CXX and there is issues with FreeImage that it's can't reference to these. And I'm new to linux so i don't know what to modify or change it. As the error shown is this: /usr/bin/ld: CMakeFiles/wallengine.dir/main.cpp.o: in functionmain': main.cpp:(.text+0x55c): undefined reference to FreeImage_Initialise' /usr/bin/ld: main.cpp:(.text+0xcb7): undefined reference toFreeImage_DeInitialise' /usr/bin/ld: CMakeFiles/wallengine.dir/src/WallpaperEngine/Assets/CTexture.cpp.o: in function WallpaperEngine::Assets::CTexture::CTexture(void*)': CTexture.cpp:(.text+0x4a6): undefined reference toFreeImage_OpenMemory' /usr/bin/ld: CTexture.cpp:(.text+0x4cb): undefined reference to FreeImage_LoadFromMemory' /usr/bin/ld: CTexture.cpp:(.text+0x4db): undefined reference toFreeImage_FlipVertical' /usr/bin/ld: CTexture.cpp:(.text+0x4e7): undefined reference to FreeImage_ConvertTo32Bits' /usr/bin/ld: CTexture.cpp:(.text+0x4f7): undefined reference toFreeImage_GetBits' /usr/bin/ld: CTexture.cpp:(.text+0x507): undefined reference to FreeImage_GetWidth' /usr/bin/ld: CTexture.cpp:(.text+0x516): undefined reference toFreeImage_GetHeight' /usr/bin/ld: CTexture.cpp:(.text+0x63d): undefined reference to FreeImage_Unload' /usr/bin/ld: CTexture.cpp:(.text+0x649): undefined reference toFreeImage_Unload' /usr/bin/ld: CTexture.cpp:(.text+0x655): undefined reference to FreeImage_CloseMemory' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/wallengine.dir/build.make:1056: wallengine] Error 1 make[1]: *** [CMakeFiles/Makefile2:156: CMakeFiles/wallengine.dir/all] Error 2 make: *** [Makefile:149: all] Error 2 Or as the image shown here image

So how to fix this even though i think it's have to do something with modifying with the main.cpp.o and main.cpp. Thanks.

Almamu commented 2 years ago

Hello @Freddyv2356 You shouldn't need to make any changes to the source code for it to compile. Take in mind that you need the development versions of the dependencies as these are needed in compilation time (and the compiled versions too so the code can run). What distro are you using?

Freddyv2356 commented 2 years ago

It's linux ubuntu and of course I think that I installed most of it are -dev version.

Almamu commented 2 years ago

Hi @Freddyv2356 Have you installed libfreeimage-dev? That package should provide the functions that your compiler is complaining about. (you can check if it's installed running dpkg -l | grep freeimage)

Freddyv2356 commented 2 years ago

image It's also installed too.

Blakeinstein commented 2 years ago
/usr/bin/ld: CMakeFiles/wallengine.dir/main.cpp.o: in function `main':
main.cpp:(.text+0x54b): undefined reference to `FreeImage_Initialise'
/usr/bin/ld: main.cpp:(.text+0xcb5): undefined reference to `FreeImage_DeInitialise'
/usr/bin/ld: CMakeFiles/wallengine.dir/src/WallpaperEngine/Assets/CTexture.cpp.o: in function `WallpaperEngine::Assets::CTexture::CTexture(void*)':
CTexture.cpp:(.text+0x4a1): undefined reference to `FreeImage_OpenMemory'
/usr/bin/ld: CTexture.cpp:(.text+0x4c6): undefined reference to `FreeImage_LoadFromMemory'
/usr/bin/ld: CTexture.cpp:(.text+0x4d6): undefined reference to `FreeImage_FlipVertical'
/usr/bin/ld: CTexture.cpp:(.text+0x4e2): undefined reference to `FreeImage_ConvertTo32Bits'
/usr/bin/ld: CTexture.cpp:(.text+0x4f2): undefined reference to `FreeImage_GetBits'
/usr/bin/ld: CTexture.cpp:(.text+0x502): undefined reference to `FreeImage_GetWidth'
/usr/bin/ld: CTexture.cpp:(.text+0x511): undefined reference to `FreeImage_GetHeight'
/usr/bin/ld: CTexture.cpp:(.text+0x638): undefined reference to `FreeImage_Unload'
/usr/bin/ld: CTexture.cpp:(.text+0x644): undefined reference to `FreeImage_Unload'
/usr/bin/ld: CTexture.cpp:(.text+0x650): undefined reference to `FreeImage_CloseMemory'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/wallengine.dir/build.make:1110: wallengine] Error 1
make[1]: *** [CMakeFiles/Makefile2:135: CMakeFiles/wallengine.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Getting the same on arch, aur only has freeimage

Almamu commented 2 years ago

@Blakeinstein freeimage is part of the default repos, not part of the AUR. I'm running that exact same version you linked and I'm having no issues.

@Freddyv2356 can you both re-run the cmake step and share the output of it? It should be complaining if FreeImage is not being detected properly (or reporting where it was found if it's installed).

ghost commented 2 years ago

I deleted all files under build and re-cmake. just solved the problem