Opened 16 years ago

Closed 16 years ago

Last modified 6 years ago

#9018 closed patch

Fix Tools for MSVC8/9

Reported by: SF/nolange Owned by: bluegr
Priority: normal Component: Tools
Version: Keywords:
Cc: Game:

Description

*) adds "kyra_ins.cpp" to the extract_kyra project. Aint compiling without. *) added linker-depencies for the projects that need it (png,zlib,ogg,vorbis,flac). *) added a FLAC__NO_DLL definition to enable static linking. a DLL-dependent Version still can be easily created by using the correct library if thats a concern.

Ticket imported from: #2791338. Ticket imported from: patches/1123.

Attachments (2)

patch3.diff (64.5 KB ) - added by SF/nolange 16 years ago.
patch3_dirs.diff (89.5 KB ) - added by SF/nolange 16 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 by SF/nolange, 16 years ago

sigh, more trouble. I found out that the "Release" Configuration cant compile a single project since it ignores the libcmt library... which is the C-Runtime it should use. New patch2 does everything patch1 does plus: *)Dont ignore libcmt anymore *)Dont add debug-information to release-binaries

comment:2 by SF/nolange, 16 years ago

And some further notes: MSVC9 compiles multiple files at once if you got a multicore CPU. Since alot projects include the same files (compress.cpp for example) the "building all" often breaks when it tries to compile the same file (for multiple projects) in parallel. Ways to fix this would be: *)Have seperate working directories, one for each project. since the problem comes from trying to compile to the same output-file this would be a quick and easy workaround. *)seperate the commonly used files in an own project and let the other projects depend on the output. More work but would be the more efficient solution.

comment:3 by SF/nolange, 16 years ago

updated patch due to recent addition of compress_gob. Added patch with seperate working directories

by SF/nolange, 16 years ago

Attachment: patch3.diff added

by SF/nolange, 16 years ago

Attachment: patch3_dirs.diff added

comment:4 by lordhoto, 16 years ago

Hey Filippos.

could you please take a look at this patch?

comment:5 by lordhoto, 16 years ago

Owner: set to bluegr

comment:6 by bluegr, 16 years ago

Hi nolange, and thanks for your work on the tools :)

I've applied your patch, with some modifications: - all the projects also need vorbisenc, which I've added. Did it actually work for you without this file? - I couldn't get it to compile with FLAC support, so I've disabled it till we find out what's wrong... - I couldn't compile encode_dxa without ignoring libcmt.lib in the release build and libcmtd.lib in the debug build

comment:7 by sev-, 16 years ago

So, close this patch then?

comment:8 by SF/nolange, 16 years ago

thebluegr: MAy I ask you where you got the needed libraries from? I compiled them all myself (using the projects from the official sources where possible), so likely thats where the discrepancies come from.

> all the projects also need vorbisenc, which I've added. Did it actually work for you without this file? Yes, but libvorbis has both decoder and encoder included on my side. Id have seperate project for vorbisdec and vorbisenc aswell. >I couldn't get it to compile with FLAC support, so I've disabled it till we find out what's wrong... And whats the problem on your side - compiler/linker errormessage? Works fine for me apparently, not even a single warning >I couldn't compile encode_dxa without ignoring libcmt.lib in the release build and libcmtd.lib in the debug build. This is certainly wrong as libcmt.lib (libcmtd.lib) is the Multithreaded C-Runtime (debug Version), and the project is configured to compile against it. If you ignore it you have no runtime (and ~50 missing depencies on my side). I think you have a whole runtime in one of the .lib files you are linking (otherwise it wont be working), try ignoring msvcrt.lib/msvcrtd.lib instead of libcmt.lib.

If its of any help I could upload the libraries, which are compiled with MSVC9 and the same compilersettings as ScummVM/Tools

comment:9 by bluegr, 16 years ago

nolange: I compiled the libraries myself. I've detailed the steps I followed here: http://wiki.scummvm.org/index.php/Compiling_ScummVM/Visual_Studio Tell me if you find anything wrong there...

It's certainly wrong to have both decoder and encoder included in libvorbis, as the encoding functionality is only needed for the ScummVM tools and not in ScummVM itself. As vorbisenc is a little over 1MB, you're actually bloating the main ScummVM executable with unneeded code. Please don't do that.

As for FLAC... I get linker error messages saying it can't find FLAC's functions (same error I get when compiling ScummVM with FLAC support), which is strange, as I've compiled the regular FLAC library, and I don't know what's missing from it.

The problem with encode_dxa might be because of some incorrectly compiled library, with the runtime being included in the library instead. I'll try your suggestion. The error I'm getting is that some functions are already defined in libcmt (which probably come from one of the incorrect libraries, libpng might be the culprit)

I can also upload the libraries I've got... that way, we can compare them and see what's wrong

comment:10 by bluegr, 16 years ago

The libraries I'm using are in the aforementioned page, I've updated them to the version I'm using now. Please use the rapidshare link: http://rapidshare.com/files/233933799/scummvm_vs_libs.zip

This also has a nice installer to install them in the system

comment:11 by SF/nolange, 16 years ago

Is seems that some of your libs contain parts of the msvcrt library. Ignore msvcrt.lib instead of libcmt.lib/libcmtd.lib and it should work. Compiling all the libs with /NODEFAULTLIB (ignore all default libs) would be the best choice though.

regarding vorbis: I used the VC2005 projects as starting points, and theres a single libvorbis-project for both en- and decoder, seemed sensible to use that. All MS compilers since 2000 or so can cut away unused part of linked libraries anyway so it wont bloat the executeable (much). Same could be said for Flac btw as there is no seperate encoder either. I did split the encoder on my compiles now.

for flac: I can compile and link the tools with your libraries (and I did remove the DISABLE_BUILTIN_FLAC macro). No problemo? Havent tried compile scummvm with your libs yet, but I doubt things would be different

I uploaded my libs and the whole project for creating them, maybe it helps you find the culprit: http://rapidshare.com/files/233982171/ScummVMLibs.zip.html (aint anything as tidy as your archiv, sorry.. wasnt created to be shown around =) )

comment:12 by bluegr, 16 years ago

Status: newclosed

comment:13 by bluegr, 16 years ago

Many thanks for your comments nolange :) I got everything to compile properly now, with the inclusion of the /NODEFAULTLIB switch. I've updated the project files, enabled FLAC (it compiles fine for me now), and fixed the errors due to incorrect library files.

I'll update the libraries in the ZIP package too

Closing this

comment:14 by digitall, 6 years ago

Component: Tools
Note: See TracTickets for help on using tickets.