English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 17 October 2009, 00:19   #1
gilgamesh
Linux snob
 
gilgamesh's Avatar
 
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
Dr. Strangelove's guide to compiling WinUAE 1.6.1

… 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

Last edited by gilgamesh; 17 October 2009 at 22:22.
gilgamesh is offline  
Old 17 October 2009, 10:16   #2
andreas
Zone Friend
 
Join Date: Jun 2001
Location: Germany
Age: 50
Posts: 5,857
Send a message via ICQ to andreas Send a message via AIM to andreas
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
andreas is offline  
Old 17 October 2009, 11:01   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
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"

Last edited by Toni Wilen; 17 October 2009 at 12:17.
Toni Wilen is offline  
Old 17 October 2009, 11:54   #4
Maccara
The Spanish Songstress
 
Join Date: Jul 2009
Location: Finland
Posts: 114
Quote:
Originally Posted by Toni Wilen View Post
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.
Maccara is offline  
Old 17 October 2009, 12:15   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
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
Toni Wilen is offline  
Old 17 October 2009, 22:17   #6
gilgamesh
Linux snob
 
gilgamesh's Avatar
 
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
Quote:
Originally Posted by Toni Wilen View Post
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.

Quote:
Originally Posted by Toni Wilen View Post
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

Quote:
Originally Posted by Toni Wilen View Post
I am quite sure problem is wrong order of Windows header paths (it can cause really weird errors)
For me it works now with
  • SDK
  • DXSDK
  • VC include dir
  • DDK
  • everything else
(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.)

Quote:
Originally Posted by Toni Wilen View Post
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.

Quote:
Originally Posted by Maccara View Post
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.

Last edited by gilgamesh; 17 October 2009 at 23:08.
gilgamesh is offline  
Old 18 October 2009, 00:55   #7
Maccara
The Spanish Songstress
 
Join Date: Jul 2009
Location: Finland
Posts: 114
Quote:
Originally Posted by gilgamesh View Post
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.
Maccara is offline  
Old 18 October 2009, 09:44   #8
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
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..)
Toni Wilen is offline  
Old 18 October 2009, 10:33   #9
gilgamesh
Linux snob
 
gilgamesh's Avatar
 
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
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.
gilgamesh is offline  
Old 18 October 2009, 11:34   #10
eLowar
Citizen of Elthesh
 
eLowar's Avatar
 
Join Date: Sep 2003
Location: UK
Posts: 949
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.
eLowar is offline  
Old 18 October 2009, 16:00   #11
thor
Registered User
 
thor's Avatar
 
Join Date: Mar 2006
Location: Germany
Posts: 899
WDK has MFC headers in path inc/mfc42/.
thor is offline  
Old 18 October 2009, 23:49   #12
gilgamesh
Linux snob
 
gilgamesh's Avatar
 
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
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 is offline  
Old 19 October 2009, 21:55   #13
gilgamesh
Linux snob
 
gilgamesh's Avatar
 
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
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?
gilgamesh is offline  
Old 19 October 2009, 22:03   #14
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Quote:
Originally Posted by gilgamesh View Post
Should these be assembled with some other assembler, or did I get something wrong?
NASM is needed to assemble them.
Toni Wilen is offline  
Old 20 October 2009, 04:11   #15
andreas
Zone Friend
 
Join Date: Jun 2001
Location: Germany
Age: 50
Posts: 5,857
Send a message via ICQ to andreas Send a message via AIM to 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...
andreas is offline  
Old 20 October 2009, 08:00   #16
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Quote:
Originally Posted by andreas View Post
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.
Toni Wilen is offline  
Old 20 October 2009, 08:15   #17
andreas
Zone Friend
 
Join Date: Jun 2001
Location: Germany
Age: 50
Posts: 5,857
Send a message via ICQ to andreas Send a message via AIM to andreas
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?
andreas is offline  
Old 21 October 2009, 21:46   #18
gilgamesh
Linux snob
 
gilgamesh's Avatar
 
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
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.

Last edited by gilgamesh; 21 October 2009 at 22:42. Reason: pablio faulty
gilgamesh is offline  
Old 21 October 2009, 21:57   #19
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Quote:
Originally Posted by gilgamesh View Post
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)

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

Quote:
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)
Toni Wilen is offline  
Old 21 October 2009, 22:42   #20
gilgamesh
Linux snob
 
gilgamesh's Avatar
 
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
Quote:
Originally Posted by Toni Wilen View Post
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?
Quote:
Originally Posted by Toni Wilen View Post
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.
Quote:
Originally Posted by Toni Wilen View Post
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.
gilgamesh is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
DIY Compiling WinUAE 2.0.x gilgamesh support.WinUAE 19 10 July 2010 19:00
Compiling WinUAE 2.1.0 rotacak support.WinUAE 8 06 May 2010 17:09
Idiots guide to compiling WinUAE? Ian New to Emulation or Amiga scene 1 28 September 2009 14:30
Compiling WinUAE with VS 2005 Express ? girv support.WinUAE 23 04 December 2006 21:26
Compiling WinUAE 1.3.2 rotacak support.WinUAE 1 06 October 2006 20:34

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:44.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.56976 seconds with 14 queries