icewm icon indicating copy to clipboard operation
icewm copied to clipboard

[Compile-related issues] Would it be possible to early-warn for missing "-lao not found" problem?

Open rubyFeedback opened this issue 6 years ago • 3 comments

On Linux trying to compile icewm-1.5.4, let me show the error message or build message first:

/Depot/Temp/rbt/icewm-1.5.4/src/mstring.cc: In static member function 'static MStringData* MStringData::create(const char*)': /Depot/Temp/rbt/icewm-1.5.4/src/mstring.cc:32:34: note: length computed here return create(str, int(strlen(str))); ~~~~~~^~~~~ In static member function 'static MStringData* MStringData::create(const char*, int)', inlined from 'void mstring::init(const char*, size_t)' at /Depot/Temp/rbt/icewm-1.5.4/src/mstring.cc:85:35, inlined from 'void mstring::init(const char*, size_t)' at /Depot/Temp/rbt/icewm-1.5.4/src/mstring.cc:83:6, inlined from 'mstring::mstring(const char*)' at /Depot/Temp/rbt/icewm-1.5.4/src/mstring.cc:44:9: /Depot/Temp/rbt/icewm-1.5.4/src/mstring.cc:26:12: warning: 'char* strncpy(char*, const char*, size_t)' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] strncpy(ud->fStr, str, size_t(length)); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Depot/Temp/rbt/icewm-1.5.4/src/mstring.cc: In constructor 'mstring::mstring(const char*)': /Depot/Temp/rbt/icewm-1.5.4/src/mstring.cc:44:27: note: length computed here init(str, str ? strlen(str) : 0); ~~~~~~^~~~~ [ 8%] Building CXX object src/CMakeFiles/icesound.dir/ref.cc.o [ 9%] Building CXX object src/CMakeFiles/icewmbg.dir/misc.cc.o In static member function 'static MStringData* MStringData::create(const char*, int)', inlined from 'void mstring::init(const char*, size_t)' at /Depot/Temp/rbt/icewm-1.5.4/src/mstring.cc:85:35, inlined from 'void mstring::init(const char*, size_t)' at /Depot/Temp/rbt/icewm-1.5.4/src/mstring.cc:83:6, inlined from 'mstring::mstring(long int)' at /Depot/Temp/rbt/icewm-1.5.4/src/mstring.cc:80:9: /Depot/Temp/rbt/icewm-1.5.4/src/mstring.cc:26:12: warning: 'char* strncpy(char*, const char*, size_t)' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] strncpy(ud->fStr, str, size_t(length)); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Depot/Temp/rbt/icewm-1.5.4/src/mstring.cc: In constructor 'mstring::mstring(long int)': /Depot/Temp/rbt/icewm-1.5.4/src/mstring.cc:80:9: note: length computed here init(num, strlen(num)); ~~~~^~~~~~~~~~~~~~~~~~ [ 9%] Linking CXX executable ../icesound [ 9%] Building CXX object src/CMakeFiles/icewmbg.dir/ycursor.cc.o /System/Index/bin/ld: cannot find -lao collect2: error: ld returned 1 exit status make[2]: *** [src/CMakeFiles/icesound.dir/build.make:204: icesound] Error 1 make[1]: *** [CMakeFiles/Makefile2:107: src/CMakeFiles/icesound.dir/all] Error 2 [ 9%] Building CXX object src/CMakeFiles/icewmbg.dir/ysocket.cc.o [ 9%] Building CXX object src/CMakeFiles/icewmbg.dir/ypaths.cc.o [ 10%] Building CXX object src/CMakeFiles/icewmbg.dir/ylocale.cc.o In file included from /Depot/Temp/rbt/icewm-1.5.4/src/ylocale.cc:12: /Depot/Temp/rbt/icewm-1.5.4/src/ylocale.h:19:2: error: #error libiconv not in use but included iconv.h is from libiconv #error libiconv not in use but included iconv.h is from libiconv ^~~~~ [ 10%] Building CXX object src/CMakeFiles/genpref.dir/ref.cc.o make[2]: *** [src/CMakeFiles/icewmbg.dir/build.make:258: src/CMakeFiles/icewmbg.dir/ylocale.cc.o] Error 1 make[2]: *** Waiting for unfinished jobs.... [ 10%] Linking CXX executable ../genpref [ 10%] Built target genpref make[1]: *** [CMakeFiles/Makefile2:144: src/CMakeFiles/icewmbg.dir/all] Error 2 make: *** [Makefile:130: all] Error 2

Not sure about the errors. I have libiconv compiled - does this mean that icewm can not work?

I put the glibc iconv.h in place, and recompiled icewm - it worked past that step but it still failed:

/System/Index/bin/ld: cannot find -lao collect2: error: ld returned 1 exit status make[2]: *** [src/CMakeFiles/icesound.dir/build.make:204: icesound] Error 1 make[1]: *** [CMakeFiles/Makefile2:107: src/CMakeFiles/icesound.dir/all] Error 2 make: *** [Makefile:130: all] Error 2

Not sure what the ao lib is.

I picked this one:

https://ftp.osuosl.org/pub/xiph/releases/ao/libao-1.2.0.tar.gz

And indeed, it worked \o/. So that is -lao I guess.

My suggestion though:

  • Would it be possible to add an early check whether libao is available or not, and if not, to notify that libao (when requested, aka default), is not available early on, rather than fail/stop during compilation? It's a tiny issue but still.

Thanks!

rubyFeedback avatar May 03 '19 13:05 rubyFeedback

You seem to build your system from parts by hand, which gives you an incomplete non-standard result. Also you don't give relevant information about your system to understand the reasons. You may be helped by using the os-depends.sh script from the website.

gijsbers avatar May 03 '19 18:05 gijsbers

cmake version basically relies on pkg-config here. If you have a broken installation of libao (i.e. pkg-config script for ao exists but does not output the lib directory flags properly) then sorry, PEBKAC.

Code7R avatar Jun 17 '19 20:06 Code7R

I really don't like closing issues on users. I would rather they close them themselves. @rubyFeedback, please close this issue if it is no longer a problem.

bbidulock avatar Jun 18 '19 05:06 bbidulock