VOGONS


First post, by vinceohm

User metadata
Rank Newbie
Rank
Newbie

On Mac Snow Leopard

After
./configure --enable-debug=heavy
make gives:

In file included from core_dyn_x86.cpp:238:
core_dyn_x86/decoder.h: In function ‘CacheBlock* CreateCacheBlock(CodePageHandler*, PhysPt, Bitu)’:
core_dyn_x86/decoder.h:2006: error: cast from ‘CacheBlock*’ to ‘Bit32u’ loses precision
make[4]: *** [core_dyn_x86.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

After
./configure --enable-debug=heavy --disable-dynrec
make gives:

In file included from core_dyn_x86.cpp:238:
core_dyn_x86/decoder.h: In function ‘CacheBlock* CreateCacheBlock(CodePageHandler*, PhysPt, Bitu)’:
core_dyn_x86/decoder.h:2006: error: cast from ‘CacheBlock*’ to ‘Bit32u’ loses precision
make[4]: *** [core_dyn_x86.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

After
./configure --enable-debug=heavy --disable-dynrec --disable-dynamic-x86
make gives:

debug_gui.cpp:149: error: invalid use of incomplete type ‘struct _win_st’
/usr/include/curses.h:322: error: forward declaration of ‘struct _win_st’
debug_gui.cpp:151: error: invalid use of incomplete type ‘struct _win_st’
/usr/include/curses.h:322: error: forward declaration of ‘struct _win_st’
debug_gui.cpp:153: error: invalid use of incomplete type ‘struct _win_st’
/usr/include/curses.h:322: error: forward declaration of ‘struct _win_st’
debug_gui.cpp:155: error: invalid use of incomplete type ‘struct _win_st’
/usr/include/curses.h:322: error: forward declaration of ‘struct _win_st’
debug_gui.cpp:157: error: invalid use of incomplete type ‘struct _win_st’
/usr/include/curses.h:322: error: forward declaration of ‘struct _win_st’
make[3]: *** [debug_gui.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Any help?

Thanks.

Reply 1 of 9, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

did you do ./autogen.sh as well? Also I'd advise to build in 32bit on OS X. The 64bit dynamic core will crash when you run Dosbox and it switches to it (but I guess you know that because you disabled it)

To compile in 32bit I built by

cd ~/Code/svn/dosbox
export CFLAGS='-O2 -arch i386 -fomit-frame-pointer -fstrict-aliasing -momit-leaf-frame-pointer -fno-tree-pre -falign-loops -ffast-math' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-O2 -mdynamic-no-pic -arch i386 -fomit-frame-pointer -fstrict-aliasing -momit-leaf-frame-pointer -fno-tree-pre -falign-loops -ffast-math' MACOSX_DEPLOYMENT_TARGET='10.6' CXX='/usr/bin/g++-4.2' F90FLAGS='-O2 -m32' LDFLAGS='-L/opt/local/lib -arch i386 -O2 -fomit-frame-pointer -fstrict-aliasing -momit-leaf-frame-pointer -fno-tree-pre -falign-loops -ffast-math' OBJC='/usr/bin/gcc-4.2' FCFLAGS='-O2 -m32' OBJCFLAGS='-O2 -arch i386' FFLAGS='-O2 -m32' CC='/usr/bin/gcc-4.2'
./autogen.sh
./configure --disable-sdltest --disable-alsatest --enable-core-inline
make clean
make

I haven't built very latest SVN but at least around the release time of 0.74 SVN didn't give me any headache (but I also didn't build with debug).
Also I'm using MacPorts to have all needed libs built in universal flavor 😀

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 2 of 9, by vinceohm

User metadata
Rank Newbie
Rank
Newbie

Thanks for you quick answer.

Well I don't really know... I've just seen some of your posts elsewhere.. 😉

I tried your script (the 5 commandes) and got :

Undefined symbols:
"_SDL_UnlockAudio", referenced from:
MixerChannel::FillUp() in libhardware.a(mixer.o)
MixerChannel::FillUp() in libhardware.a(mixer.o)
MixerChannel::Enable(bool) in libhardware.a(mixer.o)
MIXER_Mix() in libhardware.a(mixer.o)
"_SDL_NumJoysticks", referenced from:
...
about 100 more lines
...
"_SDL_WM_SetCaption", referenced from:
GFX_SetTitle(int, int, bool)in libgui.a(sdlmain.o)
GUI_StartUp(Section*) in libgui.a(sdlmain.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [dosbox] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Then I added --enable-debug=heavy to the configure line, and got:

debug_gui.cpp: In function ‘void DrawBars()’:
debug_gui.cpp:149: error: invalid use of incomplete type ‘struct _win_st’
/usr/include/curses.h:322: error: forward declaration of ‘struct _win_st’
debug_gui.cpp:151: error: invalid use of incomplete type ‘struct _win_st’
/usr/include/curses.h:322: error: forward declaration of ‘struct _win_st’
debug_gui.cpp:153: error: invalid use of incomplete type ‘struct _win_st’
/usr/include/curses.h:322: error: forward declaration of ‘struct _win_st’
debug_gui.cpp:155: error: invalid use of incomplete type ‘struct _win_st’
/usr/include/curses.h:322: error: forward declaration of ‘struct _win_st’
debug_gui.cpp:157: error: invalid use of incomplete type ‘struct _win_st’
/usr/include/curses.h:322: error: forward declaration of ‘struct _win_st’
make[3]: *** [debug_gui.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Reading you, I had used MacPorts and did:

 sudo port -d selfupdate
sudo port install libsdl
sudo port install p5-curses
sudo port install ncurses
sudo port upgrade outdated

Reply 3 of 9, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

the LDflags don't include a reference to sdl. so that explains the problems.
For the curses problem. Not sure what kind of curses mac os x has installed. Isn't there a different version somehow ?
I use ncurses.

Water flows down the stream
How to ask questions the smart way!

Reply 4 of 9, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

As I wrote above it needs to be universal, meaning you have to "sudo port install SOMETHING +universal" or else building Dosbox in 32bit will fail on modern Apple machines with OS X 10.6...

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 5 of 9, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

I got your debug build problem figured out now, since I first got the same error as you got.
You need to pass on the include for ncurses or ./configure will use the "bad" curses that comes with xcode by apple.
When you add -I/opt/local/include/ncurses to the CPPFLAGS it will built fine.
The whole export *I* use and which is working for me is

export CFLAGS='-O2 -arch i386 -fomit-frame-pointer -fstrict-aliasing -momit-leaf-frame-pointer -fno-tree-pre -falign-loops -ffast-math' CPPFLAGS='-I/opt/local/include -I/opt/local/include/ncurses' CXXFLAGS='-O2 -mdynamic-no-pic -arch i386 -fomit-frame-pointer -fstrict-aliasing -momit-leaf-frame-pointer -fno-tree-pre -falign-loops -ffast-math' MACOSX_DEPLOYMENT_TARGET='10.6' CXX='/usr/bin/g++-4.2' F90FLAGS='-O2 -m32' LDFLAGS='-L/opt/local/lib -arch i386 -O2 -fomit-frame-pointer -fstrict-aliasing -momit-leaf-frame-pointer -fno-tree-pre -falign-loops -ffast-math' OBJC='/usr/bin/gcc-4.2' FCFLAGS='-O2 -m32' OBJCFLAGS='-O2 -arch i386' FFLAGS='-O2 -m32' CC='/usr/bin/gcc-4.2'

If you installed all the needed libs via macports and the +universal option and you still get the SDL errors a
export LDFLAGS=-L/opt/local/lib
might help.

@Qbix
I do get these warnings though

debug.cpp: In function ‘void LogGDT()’:
debug.cpp:1857: warning: format not a string literal and no format arguments
debug.cpp:1859: warning: format not a string literal and no format arguments
debug.cpp: In function ‘void LogLDT()’:
debug.cpp:1877: warning: format not a string literal and no format arguments
debug.cpp:1879: warning: format not a string literal and no format arguments
debug.cpp: In function ‘void LogIDT()’:
debug.cpp:1891: warning: format not a string literal and no format arguments
debug.cpp: In function ‘void LogPages(char*)’:
debug.cpp:1914: warning: format not a string literal and no format arguments
debug.cpp:1927: warning: format not a string literal and no format arguments
debug.cpp:1930: warning: format not a string literal and no format arguments
debug.cpp: In function ‘void LogCPUInfo()’:
debug.cpp:1939: warning: format not a string literal and no format arguments
debug.cpp:1941: warning: format not a string literal and no format arguments
debug.cpp:1943: warning: format not a string literal and no format arguments
debug.cpp:1945: warning: format not a string literal and no format arguments
debug.cpp:1951: warning: format not a string literal and no format arguments
debug.cpp:1956: warning: format not a string literal and no format arguments

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 6 of 9, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

you could do a const char* out2= &out1[0];
and replace the out1 with out2 in those LOG() calls.

Maybe that makes the compiler happy

Water flows down the stream
How to ask questions the smart way!

Reply 7 of 9, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

I'm not sure I understood you right but in line 1848 I added the const char* out2= &out1[0]; and then replaced the out1 with out2 in the log calls. The compiler will still complain the same way.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 8 of 9, by vinceohm

User metadata
Rank Newbie
Rank
Newbie

Thanks a lot Dominus, my make does it now!

Cheers,

Vince.