Menu

#1466 failed to build bochs 3.0 on macos

fixed_in_SVN
closed
None
1
2025-02-17
2025-02-16
Rui Chen
No

While building on macos, seeing some build issue as below

  clang++ -c -I.. -I../.. -I./.. -I./../.. -I../../instrument/stubs -I./../../instrument/stubs -fpascal-strings -fno-common -Wno-four-char-constants -Wno-unknown-pragmas -Dmacintosh -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -fpascal-strings -fno-common -Wno-four-char-constants -Wno-unknown-pragmas -Dmacintosh -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES   -I/opt/homebrew/Cellar/sdl2/2.32.0/include/SDL2 -D_THREAD_SAFE intel/corei5_lynnfield_750.cc -o intel/corei5_lynnfield_750.o
  keymap.cc:133:28: error: use of undeclared identifier 'basename'
    133 |       if (strncmp(prefix2, basename(keymap_file), strlen(prefix2))) {
        |                            ^
  1 error generated.

This patch works for me

diff --git a/gui/keymap.cc b/gui/keymap.cc
index 3426b6b..7bf76d8 100644
--- a/gui/keymap.cc
+++ b/gui/keymap.cc
@@ -30,6 +30,10 @@
 #include "gui.h"
 #include "keymap.h"

+#if defined(__APPLE__)
+#include <libgen.h>
+#endif
+
 // Table of bochs "BX_KEY_*" symbols
 // the table must be in BX_KEY_* order
 const char *bx_key_symbol[BX_KEY_NBKEYS] = {

Discussion

  • Volker Ruppert

    Volker Ruppert - 2025-02-17
    • status: open --> closed
    • assigned_to: Volker Ruppert
    • Group: pending --> fixed_in_SVN
     
  • Volker Ruppert

    Volker Ruppert - 2025-02-17

    Fixed in Bochs source tree on GitHub.

     

Log in to post a comment.

MongoDB Logo MongoDB