EAB3 skin Register
English Amiga Board


1 2 3  ... Last
support.WinUAE>Dr. Strangelove's guide to compiling WinUAE 1.6.1
gilgamesh 01:19 17 October 2009
… or how I learned to stop worrying and love the bomb.

I get an illegal cast error for sounddep\sound.c(496).
Parser.c and ioport.c get lots of errors, because the headers of ghostscript and winio seem to have changed from what Toni uses. I could confirm this for paraport.

EDIT: ioport.c compiles if every reference to getPortInfo (line 166, 170, 199) is turned off. paraport.h does not define PARAPORT_INFO any more.
EDIT2: Inluded ghost.h, imain.h, ierrors.h, iapi.h to parser.c and made all ghostscript headers visible to the compiler. parser.c compiles now.

My build system is XP, Visual C++ Express 2008, latest DirectX SDK (DXSDK_Aug2009), WDK (was DDK) and Windows 7 SDK (!). (GNU, where are you )
Then I copied dxerr.h to dxerr9.h. The DDK headers screw everything else, so I only included ntdkbd.h, ntddstor.h and ntddcdrm.h which is sufficient.
EDIT3: see here
The compilation is set to win32 and release, since windowing stuff won't compile in debug mode.

I installed in addition

Advertisement:


andreas 11:16 17 October 2009
1.6.1. ... hmm.
Maybe an attempt with the latest beta sources will give more promising results?
(Yes, I know you'll have to ask Toni for them, since there's no link.)
It would certainly be worth a try because poking around in old source code is usually not too great fun
Toni Wilen 12:01 17 October 2009
You do know that I am not interested with "lots of errors" and similar "error reports". Obviously I do not get those errors

DDK headers do not screw anything up either. Do you want help or do you just want to complain? It is always so easy to blame others. (sorry for being annoying again but I had two choices, either not reply at all or reply something and I just can't do it without commenting your style...)

Never ever rename header files, rename dxerr9.h to dxerr.h in direct3d.h (or get newer sources)

Also make sure header paths are in correct order in MSVC:
1.WinSDK
2.DXSDK
3.DDK
4.Other includes

winio.h is not C compatible, remove extern "C" and line that includes "bool"

EDIT: DDK path must be "winddk\<version>\inc\api"
Maccara 12:54 17 October 2009
Originally Posted by Toni Wilen:
You do know that I am not interested with "lots of errors" and similar "error reports". Obviously I do not get those errors
I haven't tried for a while, but I can confirm that at least winuae used to compile just fine for me too with a correctly setup build environment (there were some minor quirks when I last tried, but they had nothing to do with the "standard" windows/platform/driver/dx DDKs).

I seriously doubt Toni would have broken it "just for fun" since.

Of course, there may be some fun hunting down all the dependencies still.

EDIT: Though, I haven't tried the free compiler (express) ever, so don't if it will bring its own problems.
Toni Wilen 13:15 17 October 2009
Express should work just fine. I am quite sure problem is wrong order of Windows header paths (it can cause really weird errors)

Also "other" header files can also cause conflicts. I haven't updated ghostscript etc.. header files for long time now. Perhaps it is time
gilgamesh 23:17 17 October 2009
Originally Posted by Toni Wilen:
Do you want help or do you just want to complain? It is always so easy to blame others. (sorry for being annoying again but I had two choices, either not reply at all or reply something and I just can't do it without commenting your style...)
I did not blame anybody for anything and I am not complaining. (That would not make any sense. Whom? For what? ) I just tinkered some hours, reported what I found, and tinkered some more to find solutions. Nevertheless I apologize if you feel offended by my style. (Style?) It simply expresses that I stagger from one pitfall to the next, and that the MS tool chain just seems uncomfortable.

Originally Posted by Toni Wilen:
Also "other" header files can also cause conflicts. I haven't updated ghostscript etc.. header files for long time now. Perhaps it is time
parser.c in combination with gs 8.70 gave me literally dozens of "missing" braces, semicolons etc. (That is what I meant by "lots of errors".)
And yes, one can fix this by adding several subdirectories of the gs source tree for headers, and parser.c must include: ghost.h, imain.h, ierrors.h, iapi.h

Originally Posted by Toni Wilen:
I am quite sure problem is wrong order of Windows header paths (it can cause really weird errors)
For me it works now with
(VC's includes were part of "everything else" before. That gave me many syntax errors in stdio.h etc. Is "screw up" too harsh? I would say this is unexpected behaviour.)

Originally Posted by Toni Wilen:
winio.h is not C compatible, remove extern "C" and line that includes "bool"
Yes did so, but didn't know it was common sense, and therefore reported it as an error.

Originally Posted by Maccara:
I seriously doubt Toni would have broken it "just for fun" since.
Me too. It's all about correct setup, compatibility etc.

There is still an issue with undefined PARAPORT_INFO. (Though I guess it isn't really needed.)

And then there is this:
EDIT:
Code:
..\sounddep\sound.c(496) : error C2440: 'Funktion': 'int (__cdecl *)(const void *,void *,unsigned long,const PaStreamCallbackTimeInfo *,PaStreamCallbackFlags,void *)' kann nicht in 'PaStreamCallback (__stdcall *)' konvertiert werden
..\sounddep\sound.c(496) : warning C4024: 'Pa_OpenStream': Unterschiedliche Typen für formalen und übergebenen Parameter 7
(Sorry for the language, it means "type cast error" and "different types for the seventh parameter")
EDIT2: Just set "static int /*_cdecl*/ portAudioCallback" in line 399. Seems ok now.
Maccara 01:55 18 October 2009
Originally Posted by gilgamesh:
There is still an issue with undefined PARAPORT_INFO. (Though I guess it isn't really needed.)
I *think* this was one of the quirks I also ran into when I compiled WinUAE last time. Can't remember at all what I did with it, though, after so long time.
Toni Wilen 10:44 18 October 2009
Random set of header files and libraries uploaded to the zone. Hope these helps.

Your problem is calling convention mismatch, I changed it from _cdecl to _stdcall (_cdecl = standard C-style, parameters always in stack, _stdcall = use registers first and then stack) few releases ago and some external dlls headers do not specify calling convention = defaults to _stdcall now = problems. (linker errors or crashes when calling the function)

(for example portaudio.h)

I would have remembered this issue instantly if you'd have included better errors in first post

btw, winsdk comes with utility that changes between SDK versions, easier than changing paths (but GUI version may not work with 2008sp1.. command line version will..)
gilgamesh 11:33 18 October 2009
Thank you. That will help a lot.

Right now I am stuck with an 'express edition' specific problem. Express has no MFC support. Therefore you need something like
Code:
#include "resource.h"
#include "winuser.h"
// #include "afxres.h"
#ifndef IDC_STATIC
#define IDC_STATIC (-1)
#endif
/* ... */
//LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
LANGUAGE 0x409, 0x000
Compiling winuae.rc then yields
Code:
..\resources\winuae.rc(99) : error RC2104 : undefined keyword or key name: ID_DBG_PAGE1
I might define a value for ID_DBG_* and IDC_*, but the resource compiler should do that for me, shouldn't it? Strange.
eLowar 12:34 18 October 2009
Hmm, I thought it was also possible to get MFC/ATL from the older platform SDKs (e.g. Windows Server 2003). That said, I don't know if those are still available.
thor 17:00 18 October 2009
WDK has MFC headers in path inc/mfc42/.
gilgamesh 00:49 19 October 2009
Yes, thanks for the hint!

Then I had to rename ./od-win32/resources/resource to ./od-win32/resources/resource.h and reset the output dir for the linker.
(Don't know if that is normal. Express is designed not to help you with resource files in any way.)

Everything compiles at last.
And now to linking...
gilgamesh 22:55 19 October 2009
The hq*.asm files in od-win32 don't get assembled and therefore the linker complains about not finding hq4x16.obj. So I added these hq*.asm to target winuae:common with build rule MASM, but MASM tells me

Code:
Assembling...
  Assembling: ..\hq4x16.asm
 ..\hq4x16.asm(21) : error A2008:syntax error : GLOBAL
 ..\hq4x16.asm(23) : error A2008:syntax error : in directive
 ..\hq4x16.asm(24) : error A2008:syntax error : in directive
 ..\hq4x16.asm(26) : error A2008:syntax error : SECTION
 ..\hq4x16.asm(27) : error A2008:syntax error : linesleft
 ..\hq4x16.asm(28) : error A2008:syntax error : xcounter
 ..\hq4x16.asm(29) : error A2008:syntax error : cross
 ..\hq4x16.asm(30) : error A2008:syntax error : nextline
 ..\hq4x16.asm(31) : error A2008:syntax error : prevline
 ..\hq4x16.asm(32) : error A2008:syntax error : w1
 ..\hq4x16.asm(33) : error A2008:syntax error : w2
 ..\hq4x16.asm(34) : error A2008:syntax error : w3
 ..\hq4x16.asm(35) : error A2008:syntax error : w4
 ..\hq4x16.asm(36) : error A2008:syntax error : w5
 ..\hq4x16.asm(37) : error A2008:syntax error : w6
 ..\hq4x16.asm(38) : error A2008:syntax error : w7
 ..\hq4x16.asm(39) : error A2008:syntax error : w8
 ..\hq4x16.asm(40) : error A2008:syntax error : w9
 ..\hq4x16.asm(42) : error A2008:syntax error : SECTION
 ..\hq4x16.asm(44) : error A2034:must be in segment block
 ..\hq4x16.asm(45) : error A2034:must be in segment block
 ..\hq4x16.asm(46) : error A2034:must be in segment block
 ..\hq4x16.asm(47) : error A2034:must be in segment block
 ..\hq4x16.asm(48) : error A2034:must be in segment block
 ..\hq4x16.asm(49) : error A2034:must be in segment block
 ..\hq4x16.asm(50) : error A2034:must be in segment block
 ..\hq4x16.asm(52) : error A2008:syntax error : SECTION
 ..\hq4x16.asm(54) : error A2008:syntax error : macro
 ..\hq4x16.asm(55) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(56) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(57) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(58) : error A2008:syntax error : endmacro
 ..\hq4x16.asm(60) : error A2008:syntax error : macro
 ..\hq4x16.asm(61) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(62) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(63) : error A2034:must be in segment block
 ..\hq4x16.asm(64) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(65) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(66) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(67) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(68) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(69) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(70) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(71) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(72) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(73) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(74) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(75) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(76) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(77) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(78) : error A2034:must be in segment block
 ..\hq4x16.asm(79) : error A2008:syntax error : endmacro
 ..\hq4x16.asm(81) : error A2008:syntax error : macro
 ..\hq4x16.asm(82) : error A2008:syntax error : TestDiff
 ..\hq4x16.asm(83) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(84) : error A2034:must be in segment block
 ..\hq4x16.asm(85) : error A2008:syntax error : integer
 ..\hq4x16.asm(86) : error A2034:must be in segment block
 ..\hq4x16.asm(87) : error A2034:must be in segment block
 ..\hq4x16.asm(88) : error A2008:syntax error : integer
 ..\hq4x16.asm(89) : error A2008:syntax error : fin
 ..\hq4x16.asm(90) : error A2008:syntax error : endmacro
 ..\hq4x16.asm(92) : error A2008:syntax error : macro
 ..\hq4x16.asm(93) : error A2008:syntax error : TestDiff
 ..\hq4x16.asm(94) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(95) : error A2034:must be in segment block
 ..\hq4x16.asm(96) : error A2008:syntax error : integer
 ..\hq4x16.asm(97) : error A2008:syntax error : integer
 ..\hq4x16.asm(98) : error A2008:syntax error : integer
 ..\hq4x16.asm(99) : error A2034:must be in segment block
 ..\hq4x16.asm(100) : error A2034:must be in segment block
 ..\hq4x16.asm(101) : error A2008:syntax error : integer
 ..\hq4x16.asm(102) : error A2008:syntax error : integer
 ..\hq4x16.asm(103) : error A2008:syntax error : integer
 ..\hq4x16.asm(104) : error A2008:syntax error : fin
 ..\hq4x16.asm(105) : error A2008:syntax error : endmacro
 ..\hq4x16.asm(107) : error A2008:syntax error : macro
 ..\hq4x16.asm(108) : error A2008:syntax error : TestDiff
 ..\hq4x16.asm(109) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(110) : error A2034:must be in segment block
 ..\hq4x16.asm(111) : error A2008:syntax error : integer
 ..\hq4x16.asm(112) : error A2008:syntax error : integer
 ..\hq4x16.asm(113) : error A2008:syntax error : integer
 ..\hq4x16.asm(114) : error A2008:syntax error : integer
 ..\hq4x16.asm(115) : error A2034:must be in segment block
 ..\hq4x16.asm(116) : error A2034:must be in segment block
 ..\hq4x16.asm(117) : error A2008:syntax error : integer
 ..\hq4x16.asm(118) : error A2008:syntax error : integer
 ..\hq4x16.asm(119) : error A2008:syntax error : integer
 ..\hq4x16.asm(120) : error A2008:syntax error : integer
 ..\hq4x16.asm(121) : error A2008:syntax error : fin
 ..\hq4x16.asm(122) : error A2008:syntax error : endmacro
 ..\hq4x16.asm(124) : error A2008:syntax error : macro
 ..\hq4x16.asm(125) : error A2008:syntax error : TestDiff
 ..\hq4x16.asm(126) : error A2085:instruction or register not accepted in current CPU mode
 ..\hq4x16.asm(127) : error A2034:must be in segment block
 ..\hq4x16.asm(128) : error A2008:syntax error : integer
 ..\hq4x16.asm(129) : error A2008:syntax error : integer
 ..\hq4x16.asm(130) : error A2008:syntax error : integer
 ..\hq4x16.asm(131) : error A2008:syntax error : integer
 ..\hq4x16.asm(132) : fatal error A1012:error count exceeds 100; stopping assembly
Should these be assembled with some other assembler, or did I get something wrong?
Toni Wilen 23:03 19 October 2009
Originally Posted by gilgamesh:
Should these be assembled with some other assembler, or did I get something wrong?
NASM is needed to assemble them.
andreas 05:11 20 October 2009
Heh Toni, I had no idea we still have such a great share of assembly code in WinUAE source. Really not. Thought most of it has been rewritten now...
Toni Wilen 09:00 20 October 2009
Originally Posted by andreas:
Heh Toni, I had no idea we still have such a great share of assembly code in WinUAE source. Really not. Thought most of it has been rewritten now...
Perhaps you should read above posts again, that assembly code isn't mine and basically has to be in assembly because hq2x filters are probably the slowest available.
andreas 09:15 20 October 2009
Oops ... missed this bit ... mea culpa

Once you're finished wearing your brown paper bag because of the network path bug, could you hand it over to me afterwards?
gilgamesh 22:46 21 October 2009
Here is what I found in the meantime:

Some library dependencies have changed their names: dxerr9->DxErr, zlibstat->zlib, portaudio_x86->pablio

The command line for the assemblies is (probably)
Code:
nasm -f coff -w-all -o hq2x16.obj hq2x16.asm
...
I ran into the problem that strcmpi is not resolved by the linker. (It seems to have been deprecated in VC '05 and abandoned in '08). It is used in zfile.c, unzip.c and heavily in direct3d.c. I'll try to replace it with stricmp() tomorrow.
Toni Wilen 22:57 21 October 2009
Originally Posted by gilgamesh:
Here is what I found in the meantime:

Some library dependencies have changed their names: dxerr9->DxErr, zlibstat->zlib, portaudio_x86->pablio
dxerr: yes (changed in August 2009 version)
zlibstat: = this is static library, this does not come with win32 binary release. (at least didn't when I built it myself)
portaudio: pablio? what? (you also need to use svn version of portaudio)

Originally Posted by :
The command line for the assemblies is (probably)
Code:
nasm -f coff -w-all -o hq2x16.obj hq2x16.asm
...
asm.cmd comes with sources

Originally Posted by :
I ran into the problem that strcmpi is not resolved by the linker. (It seems to have been deprecated in VC '05 and abandoned in '08). It is used in zfile.c, unzip.c and heavily in direct3d.c. I'll try to replace it with stricmp() tomorrow.
strcmpi is in string.h that comes with msvc (at least here)
gilgamesh 23:42 21 October 2009
Originally Posted by Toni Wilen:
zlibstat: = this is static library, this does not come with win32 binary release. (at least didn't when I built it myself)
You mean there is zlib.lib which comes precompiled and bundled, and then there is a different zlibstat.lib which can be built from source?
Originally Posted by Toni Wilen:
portaudio: pablio? what? (you also need to use svn version of portaudio)
I download the PA library stuff precompiled from their site. I'll have to build it myself, then.
Originally Posted by Toni Wilen:
strcmpi is in string.h that comes with msvc (at least here)
Do you use Visual Studio 2005 then?
2005 strcmpi deprecated: http://msdn.microsoft.com/en-us/library/ms235392(VS.80).aspx
2008 strcmpi gone: http://msdn.microsoft.com/en-us/library/f0151s4x.aspx

Yet the compiler didn't complain, only the linker. Maybe Microsoft simply forgot to update string.h? This ogre dev agrees.

EDIT: shlwapi stuff was nonsense.

1 2 3  ... Last


Page generated in 0.08333 seconds with 13 queries