Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux build error due to link.txt reference to "-lXft" #9

Open
unityconstruct opened this issue May 27, 2023 · 0 comments
Open

linux build error due to link.txt reference to "-lXft" #9

unityconstruct opened this issue May 27, 2023 · 0 comments

Comments

@unityconstruct
Copy link

unityconstruct commented May 27, 2023

hey brother, been lurking on your progress over the years. Mega EMU fan and (not so) slowly procuring their post-90s lineup.
[Proteus2000, MP-7(x2), XL-7, PX-7, MK-6, PK-6(no boot), E6400Ultra, E4XT Ultra, ESI-4000(x2), ESI-32]
I pull prodatum down periodically when I'm in my archiving mood & saw your recent "resurrection" ( which deserves some discrete real estate on the UI IMHO ).. I digress.....

On linux mint and build failure encountered. I resolved by removing the offending switch in the link.txt
"-lxFT"

os-release

cat /etc/os-release 
NAME="Linux Mint"
VERSION="19.1 (Tessa)"
ID=linuxmint
ID_LIKE=ubuntu
PRETTY_NAME="Linux Mint 19.1"
VERSION_ID="19.1"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.linuxmint.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=tessa
UBUNTU_CODENAME=bionic

SUCCESSFUL COMMAND

cmake -S . -B build

output

prodatum name   : [prodatum]
prodatum version: [2.1.2]
-- PortMidi Library name: 
-- Build type: Release
-- Library Type: 
-- Compiler flags: 
-- Compile definitions: PMALSA
-- Compile options: 
-- Compiler cxx debug flags: -g
-- Compiler cxx release flags: -O3 -DNDEBUG
-- Compiler cxx min size flags: -Os -DNDEBUG
-- Compiler cxx flags: 
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- Looking for png.h
-- Looking for png.h - found

-- Configuration Summary for FLTK 1.4.0 generated by CMake 3.26.4 --

-- The following OPTIONAL packages have been found:

 * JPEG
 * ZLIB
 * PNG

-- The following REQUIRED packages have been found:

 * Threads
 * ALSA

-- The following OPTIONAL packages have not been found:

 * Doxygen

-- Static libraries will be built in /home/uc/data/git-cpp/haxorax/prodatum/build/lib/fltk/lib
-- Shared libraries will not be built (set OPTION_BUILD_SHARED_LIBS=ON to build)
-- Example programs will not be built (set FLTK_BUILD_EXAMPLES=ON to build)
-- Image Libraries: JPEG = System
--                  PNG  = System
--                  ZLIB = System
-- Use Wayland:     No
-- Use Pango:       No
-- Use Xft:         No
-- Cairo support:   No

-- End of Configuration Summary --

-- Configuring done (0.3s)
-- Generating done (0.1s)
-- Build files have been written to: /home/uc/data/git-cpp/haxorax/prodatum/build

FAILED COMMAND

uc@m4800:~/data/git-cpp/haxorax/prodatum$ cmake --build build --config Release

output

[ 67%] Built target fltk
[ 71%] Built target fltk_images
[ 81%] Built target fluid
[ 84%] Built target portmidi
[ 85%] Linking CXX executable prodatum
**/usr/bin/ld: cannot find -lXft**
collect2: error: ld returned 1 exit status
CMakeFiles/prodatum.dir/build.make:256: recipe for target 'prodatum' failed
make[2]: *** [prodatum] Error 1
CMakeFiles/Makefile2:174: recipe for target 'CMakeFiles/prodatum.dir/all' failed
make[1]: *** [CMakeFiles/prodatum.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2

RESOLUTION

  • did cat . | grep -lXft and found a hit
  • eventually found it in link.txt:
    • /usr/bin/ld: cannot find -lXft
  • Error message referencing:
    • build.make, line 256 wasn't lying, but line 256 wasn't the issue
  • found link.txt had the culprit I was looking for:

original

/usr/bin/c++ -O3 -DNDEBUG -static-libgcc -static-libstdc++ CMakeFiles/prodatum.dir/src/cfg.cpp.o CMakeFiles/prodatum.dir/src/data.cpp.o CMakeFiles/prodatum.dir/src/debug.cpp.o CMakeFiles/prodatum.dir/src/Fl_Scope.cpp.o CMakeFiles/prodatum.dir/src/midi.cpp.o CMakeFiles/prodatum.dir/src/prodatum.cpp.o CMakeFiles/prodatum.dir/src/pxk.cpp.o CMakeFiles/prodatum.dir/src/ringbuffer.cpp.o CMakeFiles/prodatum.dir/src/widgets.cpp.o CMakeFiles/prodatum.dir/ui.cpp.o -o prodatum   -L/home/uc/data/git-cpp/haxorax/prodatum/lib  -L/home/uc/data/git-cpp/haxorax/prodatum/build/lib/fltk/lib  -L/home/uc/data/git-cpp/haxorax/prodatum/build/lib/fltk/lib/Release  -L/home/uc/data/git-cpp/haxorax/prodatum/build/lib/portmidi  -L/home/uc/data/git-cpp/haxorax/prodatum/build/lib/portmidi/Release  -Wl,-rpath,/home/uc/data/git-cpp/haxorax/prodatum/lib:/home/uc/data/git-cpp/haxorax/prodatum/build/lib/fltk/lib:/home/uc/data/git-cpp/haxorax/prodatum/build/lib/fltk/lib/Release:/home/uc/data/git-cpp/haxorax/prodatum/build/lib/portmidi:/home/uc/data/git-cpp/haxorax/prodatum/build/lib/portmidi/Release lib/fltk/lib/libfltk.a libportmidi.a -lX11 -lXinerama -lXft -lfontconfig -lasound -lpthread /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libXinerama.so /usr/lib/x86_64-linux-gnu/libXfixes.so /usr/lib/x86_64-linux-gnu/libXcursor.so /usr/lib/x86_64-linux-gnu/libXrender.so -pthread /usr/lib/x86_64-linux-gnu/libasound.so 

edited, removing the -lXft switch

/usr/bin/c++ -O3 -DNDEBUG -static-libgcc -static-libstdc++ CMakeFiles/prodatum.dir/src/cfg.cpp.o CMakeFiles/prodatum.dir/src/data.cpp.o CMakeFiles/prodatum.dir/src/debug.cpp.o CMakeFiles/prodatum.dir/src/Fl_Scope.cpp.o CMakeFiles/prodatum.dir/src/midi.cpp.o CMakeFiles/prodatum.dir/src/prodatum.cpp.o CMakeFiles/prodatum.dir/src/pxk.cpp.o CMakeFiles/prodatum.dir/src/ringbuffer.cpp.o CMakeFiles/prodatum.dir/src/widgets.cpp.o CMakeFiles/prodatum.dir/ui.cpp.o -o prodatum   -L/home/uc/data/git-cpp/haxorax/prodatum/lib  -L/home/uc/data/git-cpp/haxorax/prodatum/build/lib/fltk/lib  -L/home/uc/data/git-cpp/haxorax/prodatum/build/lib/fltk/lib/Release  -L/home/uc/data/git-cpp/haxorax/prodatum/build/lib/portmidi  -L/home/uc/data/git-cpp/haxorax/prodatum/build/lib/portmidi/Release  -Wl,-rpath,/home/uc/data/git-cpp/haxorax/prodatum/lib:/home/uc/data/git-cpp/haxorax/prodatum/build/lib/fltk/lib:/home/uc/data/git-cpp/haxorax/prodatum/build/lib/fltk/lib/Release:/home/uc/data/git-cpp/haxorax/prodatum/build/lib/portmidi:/home/uc/data/git-cpp/haxorax/prodatum/build/lib/portmidi/Release lib/fltk/lib/libfltk.a libportmidi.a -lX11 -lXinerama -lfontconfig -lasound -lpthread /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libXinerama.so /usr/lib/x86_64-linux-gnu/libXfixes.so /usr/lib/x86_64-linux-gnu/libXcursor.so /usr/lib/x86_64-linux-gnu/libXrender.so -pthread /usr/lib/x86_64-linux-gnu/libasound.so 

re-ran the build

cmake --build build --config Release
[ 67%] Built target fltk
[ 71%] Built target fltk_images
[ 81%] Built target fluid
[ 84%] Built target portmidi
[ 85%] Linking CXX executable prodatum
[ 89%] Built target prodatum
[ 89%] Building CXX object lib/fltk/src/CMakeFiles/fltk_forms.dir/forms_compatibility.cxx.o
[ 90%] Building CXX object lib/fltk/src/CMakeFiles/fltk_forms.dir/forms_bitmap.cxx.o
[ 90%] Building CXX object lib/fltk/src/CMakeFiles/fltk_forms.dir/forms_free.cxx.o
[ 90%] Building CXX object lib/fltk/src/CMakeFiles/fltk_forms.dir/forms_fselect.cxx.o
[ 91%] Building CXX object lib/fltk/src/CMakeFiles/fltk_forms.dir/forms_pixmap.cxx.o
[ 91%] Building CXX object lib/fltk/src/CMakeFiles/fltk_forms.dir/forms_timer.cxx.o
[ 91%] Linking CXX static library ../lib/libfltk_forms.a
[ 91%] Built target fltk_forms
[ 92%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/Fl_Gl_Choice.cxx.o
[ 92%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/Fl_Gl_Device_Plugin.cxx.o
[ 93%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/Fl_Gl_Overlay.cxx.o
[ 93%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/Fl_Gl_Window.cxx.o
[ 93%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/freeglut_geometry.cxx.o
[ 94%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/freeglut_stroke_mono_roman.cxx.o
[ 94%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/freeglut_stroke_roman.cxx.o
[ 94%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/freeglut_teapot.cxx.o
[ 95%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/gl_draw.cxx.o
[ 95%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/gl_start.cxx.o
[ 95%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/glut_compatibility.cxx.o
[ 96%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/glut_font.cxx.o
[ 96%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/drivers/OpenGL/Fl_OpenGL_Display_Device.cxx.o
[ 97%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_arci.cxx.o
[ 97%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx.o
[ 97%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_font.cxx.o
[ 98%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_line_style.cxx.o
[ 98%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx.o
[ 98%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_vertex.cxx.o
[ 99%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/drivers/X11/Fl_X11_Gl_Window_Driver.cxx.o
[ 99%] Building CXX object lib/fltk/src/CMakeFiles/fltk_gl.dir/drivers/X11/fl_X11_gl_platform_init.cxx.o
[100%] Linking CXX static library ../lib/libfltk_gl.a
[100%] Built target fltk_gl

list on the build dir to verify binary created

uc@m4800:~/data/git-cpp/haxorax/prodatum/build$ ls

output

CMakeCache.txt  CMakeFiles  cmake_install.cmake  lib  libportmidi.a  Makefile  **prodatum**  ui.cpp  ui.h

beautiful prodatum executed without error ( though I did nothing but smile & close it before typing this up )

./prodatum

epilog

Could be a system specific issue, deprecated cpp build tools, missing deps in my overly bloated os deployment or God-only-knows-what-else.
I get around in Java/C# professionally, but C++ might as well be chicken scratch and having multiple classes in a file makes me cross-eyed so employed brute force and hackskillz to resolve rather than triage root cause :)

Anyway, fan of your work and if I ever catch up on things to where I'm actually making tunes again I'd love to aid you in your EMU endeavors - at my own tooling expense. Worst case scenario, I'm a non-recovering archivist working on my 6th batch of 8TB drives so can assuredly curate tech docs & ops as safe keeping for future EMUnauts and/or theoretically have technical prowess that might be of value in testing hardware/firmware/software releases with 24+ yrs QA background, 20 of which has been in test automation, and to a lesser extent recently migrated to SDET roles.

yours truly brother,
~uc

BTW: haxorax is a killer handle... anyone giving you a hard time on it is.... well.....
JEALOUS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant