Reply 41 of 70, by marooned_on_mars
- Rank
- Member
wrote:Your mileage may vary, but I was able to use ddraw in my own build by replacing SDL.dll with the one distributed with DOSBox.
Not sure what you mean by that "mileage" comment. Copied that dll in DOSBox folder and it works now, thanks. Any suggestions for libpng not being detected? I know it's trivial but I also need screenshot functionality. png.h and pngconf.h are both present in /MinGW/include and /MinGW/include/libpng12
Reply 42 of 70, by bloodbat
- Rank
- Oldbie
Is libpng compiled too?
Also...since you're under Windows, why not compile with Visual C++? (it optimizes better, IMO)
Reply 43 of 70, by marooned_on_mars
- Rank
- Member
wrote:Is libpng compiled too?
Also...since you're under Windows, why not compile with Visual C++? (it optimizes better, IMO)
libpng3.dll and libpng12.dll are both under /MinGW/bin/
Compile what in Visual C++? DosBox, Munt or libpng? Also what does it optimize better, CPU usage? Libraries?
Reply 44 of 70, by bloodbat
- Rank
- Oldbie
wrote:wrote:Is libpng compiled too?
Also...since you're under Windows, why not compile with Visual C++? (it optimizes better, IMO)Compile what in Visual C++? DosBox, Munt or libpng? Also what does it optimize better, CPU usage? Libraries?
Is the library present also under lib? (Not the dlls).
Speed...it produces faster programs...and includes an IDE. And you'd have to compile EVERYTHING under it.
For ddraw: look at sdl-win32.diff under src/platform in the DosBox source code tree.
Reply 45 of 70, by marooned_on_mars
- Rank
- Member
wrote:Is the library present also under lib? (Not the dlls).
Yes they are, libpng.a libpng.la libpng12.a and libpng12.la also libpng.lib and libpng-bcc.lib
wrote:Speed...it produces faster programs...and includes an IDE. And you'd have to compile EVERYTHING under it.
I tried compiling DosBox under it and it came with this error:
BSCMAKE: error BK1506 : cannot open file '.\Release\dos.sbr': No such file or directory
I followed this guide but it doesn't specify how to add modules or patches (munt in my case)
wrote:For ddraw: look at sdl-win32.diff under src/platform in the DosBox source code tree.
Not sure how a patch would help further since I copied DosBox's own dll in the root of my build and ddraw works now ^^
Reply 46 of 70, by bloodbat
- Rank
- Oldbie
wrote:Yes they are, libpng.a libpng.la libpng12.a and libpng12.la also libpng.lib and libpng-bcc.lib […]
wrote:Is the library present also under lib? (Not the dlls).
Yes they are, libpng.a libpng.la libpng12.a and libpng12.la also libpng.lib and libpng-bcc.lib
wrote:Speed...it produces faster programs...and includes an IDE. And you'd have to compile EVERYTHING under it.
I tried compiling DosBox under it and it came with this error:
BSCMAKE: error BK1506 : cannot open file '.\Release\dos.sbr': No such file or directory
I followed this guide but it doesn't specify how to add modules or patches (munt in my case)
wrote:For ddraw: look at sdl-win32.diff under src/platform in the DosBox source code tree.
Not sure how a patch would help further since I copied DosBox's own dll in the root of my build and ddraw works now ^^
Ok, the libraries are there...even for Borland C++ and Visual C++ (those are redundant and rather useless for MinGW [libpng.lib and libpng-bcc.lib]), so that means the compiler can't find them...I don't know how you set it up (maybe recompile libpng and make sure that at least png can find zlib, libpng requires it).
Thing is making stuff with GNU Make is a pain in the ass, specially if it's missing something it requires, like automake, which you didn't have, maybe you're missing others, there's an automated installer for MinGW that should take care of those dependencies (I think, haven't used it for quite a while). Look here:
http://en.wikipedia.org/wiki/GNU_toolchain
Compiling DosBox with Visual C++ is a diferent can of worms, you need to edit the project file to point to the right headers and libraries.
One thing missing from the tutorial you read is that you need to set the linker to ignore default library "msvcrt.lib" sans the quotes. "Rebuild" the project making sure all requirements are met and the folders are properly found (including, in particular, building munt with visual c++ so it produces a .lib instead of a .la or a).
That tutorial is not intended for patching or adding modules; because that has nothing at all to do with DosBox, BUT you already patched the source with the .diff from Munt, right? (Otherwise it wouldn't work, no matter the compiler), if using that source you already patched, you need to make sure the headers for the munt library and the library itself (compiled with Visual C++) can be found by the compiler. The idea to achieve that is following the same instructions used for adding SDL ("Setting up the environment" in that tutorial) but adding the paths to the munt headers (include files) and library (and those for libpng too).
The ddraw patch would help if you wanted to use a different, maybe newer, SDL, that you compiled yourself (the patch is for SDL, not DosBox, and must probably be added by hand if using the latest SDL sources (a lot of stuff changed since that .diff was made)).
Reply 47 of 70, by VileR
- Rank
- l33t
wrote:Any suggestions for libpng not being detected? I know it's trivial but I also need screenshot functionality. png.h and pngconf.h are both present in /MinGW/include and /MinGW/include/libpng12
This worked for me in MinGW: Re: CGA Composite Mode under DOSBOX?
Reply 48 of 70, by marooned_on_mars
- Rank
- Member
wrote:so that means the compiler can't find them...I don't know how you set it up (maybe recompile libpng and make sure that at least png can find zlib, libpng requires it).
Thing is making stuff with GNU Make is a pain in the ass, specially if it's missing something it requires, like automake, which you didn't have, maybe you're missing others, there's an automated installer for MinGW that should take care of those dependencies (I think, haven't used it for quite a while). Look here:
http://en.wikipedia.org/wiki/GNU_toolchain
I think it is the case of zlib missing, as it isn't present under /lib or /include. I already had the MinGW installer through which I got automake. Thanks for the pointers ^^
wrote:Compiling DosBox with Visual C++ is a diferent can of worms, you need to edit the project file to point to the right headers and libraries.
One thing missing from the tutorial you read is that you need to set the linker to ignore default library "msvcrt.lib" sans the quotes.
It isn't present under "Additional Dependencies" so I assume I must add that under "Ignore Specific Library".
wrote:"Rebuild" the project making sure all requirements are met and the folders are properly found (including, in particular, building munt with visual c++ so it produces a .lib instead of a .la or a).
Just to make sure, rebuild is a combination of clean and build, right?
wrote:That tutorial is not intended for patching or adding modules; because that has nothing at all to do with DosBox, BUT you already patched the source with the .diff from Munt, right? (Otherwise it wouldn't work, no matter the compiler), if using that source you already patched, you need to make sure the headers for the munt library and the library itself (compiled with Visual C++) can be found by the compiler. The idea to achieve that is following the same instructions used for adding SDL ("Setting up the environment" in that tutorial) but adding the paths to the munt headers (include files) and library (and those for libpng too).
Sorry for being a bother, but how exactly would I compile munt with VC++? I tried looking around for guides but nothing came up except guides that include how you write code and then compile it. Nothing is said about how you compile ready-made code (that's been made by others). Also should I run CMake on munt before compiling?
wrote:The ddraw patch would help if you wanted to use a different, maybe newer, SDL, that you compiled yourself (the patch is for SDL, not DosBox, and must probably be added by hand if using the latest SDL sources (a lot of stuff changed since that .diff was made)).
Not the case here but thanks for the pointers ^^
Reply 49 of 70, by bloodbat
- Rank
- Oldbie
wrote:I think it is the case of zlib missing, as it isn't present under /lib or /include. I already had the MinGW installer through wh […]
wrote:so that means the compiler can't find them...I don't know how you set it up (maybe recompile libpng and make sure that at least png can find zlib, libpng requires it).
Thing is making stuff with GNU Make is a pain in the ass, specially if it's missing something it requires, like automake, which you didn't have, maybe you're missing others, there's an automated installer for MinGW that should take care of those dependencies (I think, haven't used it for quite a while). Look here:
http://en.wikipedia.org/wiki/GNU_toolchainI think it is the case of zlib missing, as it isn't present under /lib or /include. I already had the MinGW installer through which I got automake. Thanks for the pointers ^^
wrote:Compiling DosBox with Visual C++ is a diferent can of worms, you need to edit the project file to point to the right headers and libraries.
One thing missing from the tutorial you read is that you need to set the linker to ignore default library "msvcrt.lib" sans the quotes.It isn't present under "Additional Dependencies" so I assume I must add that under "Ignore Specific Library".
wrote:"Rebuild" the project making sure all requirements are met and the folders are properly found (including, in particular, building munt with visual c++ so it produces a .lib instead of a .la or a).
Just to make sure, rebuild is a combination of clean and build, right?
wrote:That tutorial is not intended for patching or adding modules; because that has nothing at all to do with DosBox, BUT you already patched the source with the .diff from Munt, right? (Otherwise it wouldn't work, no matter the compiler), if using that source you already patched, you need to make sure the headers for the munt library and the library itself (compiled with Visual C++) can be found by the compiler. The idea to achieve that is following the same instructions used for adding SDL ("Setting up the environment" in that tutorial) but adding the paths to the munt headers (include files) and library (and those for libpng too).
Sorry for being a bother, but how exactly would I compile munt with VC++? I tried looking around for guides but nothing came up except guides that include how you write code and then compile it. Nothing is said about how you compile ready-made code (that's been made by others). Also should I run CMake on munt before compiling?
wrote:The ddraw patch would help if you wanted to use a different, maybe newer, SDL, that you compiled yourself (the patch is for SDL, not DosBox, and must probably be added by hand if using the latest SDL sources (a lot of stuff changed since that .diff was made)).
Not the case here but thanks for the pointers ^^
Vilerancor sent a useful link for the PNG not found problem.
Yes, add it to ignore specific library.
Yes, that's what rebuild does.
The beauty (and purpose) of CMake is that it enables the creation of different projects from a single set of files (unlike, say...GNU Make), so make it generate a Visual C++ project that corresponds to whatever version you have and open it, mt32emu should not require additional libraries, unlike DosBox, so you can use the project right away (though you might want to set it to "release" instead of debug and *maybe* use Multithreaded (under Code-Generation -> Runtime library) instead of Multithreaded DLL (if you intend to distribute your build at some point and not require to download or also distribute Visual C++ redistributable package)...keep in mind that everything must be compiled using the same selection for that option or it won't work. Most programs include some sort of Visual C++ project, even if it's old and you have to convert it. You have to make your own, at times, but it's just a matter of telling the compiler what you want and where to find it, along with setting some (or a lot, depending on what you want to tweak) options...pretty much like ANY compiler.
Reply 50 of 70, by marooned_on_mars
- Rank
- Member
wrote:Vilerancor sent a useful link for the PNG not found problem.
I forgot to thank him. Right now I'm concentrating on building with VC++, since it seems to produce faster running programs as you said (according to sergm at least).
wrote:The beauty (and purpose) of CMake is that it enables the creation of different projects from a single set of files (unlike, say...GNU Make), so make it generate a Visual C++ project that corresponds to whatever version you have and open it, mt32emu should not require additional libraries, unlike DosBox, so you can use the project right away (though you might want to set it to "release" instead of debug and *maybe* use Multithreaded (under Code-Generation -> Runtime library) instead of Multithreaded DLL (if you intend to distribute your build at some point and not require to download or also distribute Visual C++ redistributable package)...keep in mind that everything must be compiled using the same selection for that option or it won't work. Most programs include some sort of Visual C++ project, even if it's old and you have to convert it. You have to make your own, at times, but it's just a matter of telling the compiler what you want and where to find it, along with setting some (or a lot, depending on what you want to tweak) options...pretty much like ANY compiler.
I tried compiling munt, a lib was created as expected, not sure yet if it works or if I've done it right.
Now, DOSBox Complains of two things:
BSCMAKE: error BK1506 : cannot open file '.\Release\dos.sbr': No such file or directory
Which indeed it isn't present there. I suppose this has something to do with the following error:
d:\downloads\dosbox\include\timer.h(23) : fatal error C1083: Cannot open include file: 'SDL.h': No such file or directory
Reply 51 of 70, by bloodbat
- Rank
- Oldbie
wrote:wrote:I tried compiling munt, a lib was created as expected, not sure yet if it works or if I've done it right. Now, DOSBox Complains […]
I tried compiling munt, a lib was created as expected, not sure yet if it works or if I've done it right.
Now, DOSBox Complains of two things:
d:\downloads\dosbox\include\timer.h(23) : fatal error C1083: Cannot open include file: 'SDL.h': No such file or directory
If you got a .lib file it should work and be linkable with your .exe.
The header files (.h) should go under the "include directories", not executable files; the library files (.lib) should be listed in the "library directories"; that's why sdl.h is not found, .h files are NOT executable (nor are .lib files), that goes for SDL, Munt, libpng and everything else you're using (maybe SDL_net and such). Remember, though, you need a compiled library (.lib, not .a or .la, nor the one for borland compilers) version for whatever Visual C++ you're using (compiled with the same parameters for "Runtime library" (Multithreaded or Multithreaded DLL) you are using, too).
Reply 52 of 70, by marooned_on_mars
- Rank
- Member
wrote:The header files (.h) should go under the "include directories", not executable files; the library files (.lib) should be listed in the "library directories"; that's why sdl.h is not found, .h files are NOT executable (nor are .lib files), that goes for SDL, Munt, libpng and everything else you're using (maybe SDL_net and such). Remember, though, you need a compiled library (.lib, not .a or .la, nor the one for borland compilers) version for whatever Visual C++ you're using (compiled with the same parameters for "Runtime library" (Multithreaded or Multithreaded DLL) you are using, too).
Urk, I can't believe I didn't notice that, thanks.
Another error showed up:
\dosbox\src\cpu\core_dyn_x86\risc_x86.h(110) : warning C4731: 'gen_runcode' : frame pointer register 'ebp' modified by inline assembly code
Reply 53 of 70, by Qbix
- Rank
- DOSBox Author
that is a warning, not an error.
Water flows down the stream
How to ask questions the smart way!
Reply 54 of 70, by marooned_on_mars
- Rank
- Member
For some reason it stopped at that warning without creating a binary.
I tried again after clearing and this is what shows up now:
dosbox.cpp
Generating Code...
d:\downloads\dosbox\src\cpu\core_dyn_x86\risc_x86.h(110) : warning C4731: 'gen_runcode' : frame pointer register 'ebp' modified by inline assembly code
Compiling resources...
Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
Copyright (C) Microsoft Corporation. All rights reserved.
..\src\winres.rc(2) : fatal error RC1015: cannot open include file 'afxres.h'.
Creating browse information file...
Microsoft Browse Information Maintenance Utility Version 9.00.30729
Reply 55 of 70, by bloodbat
- Rank
- Oldbie
Change to Windows.h the reference to afxres.h in winres.rc.
Funny, deleting that line IS mentioned in the tutorial you said you read...
Reply 56 of 70, by marooned_on_mars
- Rank
- Member
Yes, you're right it was in the tutorial, my bad...
Now I encounter a huge compound of errors (not warnings) *sigh*
I'll attach the buildlog.htm since it's too large.
I tried looking around for the errors to see if I can find a fix, but nothing relevant came up.
Reply 57 of 70, by bloodbat
- Rank
- Oldbie
Did you add MSVCRT to ignore default libs?
Are you using the correct SDL (and the other libs) for whatever version of Visual C++ you are using?
Are the correct libraries listed in additional dependencies for the Visual C++ linker?
Out of the top of my head you need at least these (Some may not be required for what YOU are building, and there's a chance some are missing).
opengl32.lib;winmm.lib;sdlmain.lib;sdl.lib;libpng15.lib;mt32emu.lib
Adjust (specially libpng15.lib) for whatever version number (and filename) you do have.
Looking at your log, you might be missing more than you think, for example sdl_net (that requires a number of other libraries in additional dependencies)...disable what you don't intend to use.
Remember that libraries must be compiled using the same version of the runtime library (static or dynamic) as your DosBox...otherwise evil things happen (that look a lot like your log).
Reply 58 of 70, by marooned_on_mars
- Rank
- Member
wrote:Did you add MSVCRT to ignore default libs?
Yes, it is set to ignore.
wrote:Are you using the correct SDL (and the other libs) for whatever version of Visual C++ you are using?
Are the correct libraries listed in additional dependencies for the Visual C++ linker?
There is only one version of SDL development libraries for VC++. I've seen in the guide a screenshot that shown SDL having devel libs for VC++2008 Express (What I have) and 2005.
wrote:Out of the top of my head you need at least these (Some may not be required for what YOU are building, and there's a chance some are missing).
opengl32.lib;winmm.lib;sdlmain.lib;sdl.lib;libpng15.lib;mt32emu.lib
Adjust (specially libpng15.lib) for whatever version number (and filename) you do have.
The current libs I have listed under dependencies: "opengl32.lib winmm.lib sdlmain.lib sdl.lib mt32emu.lib ws2_32.lib $(NOINHERIT)". I knew opengl32.lib came with the compiler and also I checked but there doesn't seem to be any source code or development libraries for it. Also winmm and ws2_32.lib look like they definitely came with the compiler, right? ^^;
wrote:Looking at your log, you might be missing more than you think, for example sdl_net (that requires a number of other libraries in additional dependencies)...disable what you don't intend to use.
Remember that libraries must be compiled using the same version of the runtime library (static or dynamic) as your DosBox...otherwise evil things happen (that look a lot like your log).
That's quite troublesome if it doesn't let you know of the other dependencies within the libs you require. I disabled sdl_net.lib (also C_MODEM and C_IPX under config.h) to see what happens and nothing changed, so then I assume something's amiss with SDL, maybe I should compile the libs myself?
Reply 59 of 70, by bloodbat
- Rank
- Oldbie
Yes, compile them yourself. ws2_32.lib is used for winsock and, since you disabled sdl_net, you don't need it.
Oh...right, if you don't have the DirectX SDK...disable ddraw.h. But you probably want that SDK to compile SDL...try disabling it first and see if DosBox compiles...