 |
|  |
 |
|
J Bytheway
|
 |
England
Jul 2001 time: 05:31
|
|
OK, I've had some success getting the source to compile. Here's a quick summary of what I had to do:
Firstly, download both the DirectX things as mentioned in the readme, and set up the VC++ paths as mentioned.
Set up the environment variable as instructed in the readme, and then reboot (Otherwise the change will not be noticed).
I worked with the workspace ctp2_code\ctp\civctp.dsw in MSDev (That is the MS Visual C++ IDE) from MS Visual Studio 6.0.
The next thing that went wrong was that none of the custom build instructions using flex or byacc worked, so I had to copy/paste out the command lines and do them myself at a command prompt (You can find the command lines it is trying to run by right-clicking on the file it's trying to build, choosing "Settings..." and going to the "Custom Build" tab).
After that, the lack of miles sound system is the next problem. This is referenced in civsound.h, and I think the best solution is to rewrite the CivSound class with stub methods. I haven't got the time to do that, because I have to get to bed, but I'll try to find some more time tomorrow.
Any other suggestions are welcome.
Last edited by J Bytheway on 29-10-2003 at 06:26
|
|
|  |
 |
|
RalphTrickey
|
|
Colorado Springs
Oct 2001 time: 22:31
|
|
.Net is more interesting...
I found the following...
1) The Flex and Bison build commands
a) Don't like embedded spaces
b) the "s are in the wrong spaces.
You need to install to a path without embedded spaces, and look closely at where the "s are. Some need to be removed or moved.
2) replace references to the include file List-fixed with references to List.
3) there's a new keyword called typename, required for the templates.
4) Scheduler has some redundency issues. It look like moving s_Schedulers into the .cpp file resolves this.
5) Many math functions now cause redundancy errors. At least one of these looks like it hid a bug
Taking the (Ceil of an Int/Int will always do a floor instead)
6) It looks like the custom allocation for the STL has changed slightly.
Ralph
|
|
|  |
 |
|
vovan
|
|
Something I found out is that the custom build steps don't like spaces in your path, like RalphTrickey said. I had the following error when building: "C:/Documents" not found. Or something along these lines. The solution was to copy the bison and yacc files into a folder with no spaces, like "C:\cdk_dir" and put that into the CDKDIR environment variable.
The next problem was that my sources were also in a path with spaces in it. And sure enough yacc didn't like it... And sure enough, into a directory with no spaces the source went. That's a bit of copying around, but hey, I didn't have to do the yacc and bison stuff manually. 
EDIT: Update: All of the projects except for ctp2 compiled cleanly. As for the ctp2 one... Heh... It's going... But I've seen so many errors, it's not even funny, I'll update with the number, when it comes up. 
Update2: The thing's finally done with the first run of compilation... I could only dream of 101 Errors. 732 Errors and 1264 warnings here. Most are in ctp2_code/ai/list-fixed.... Guess I'll just include the list header I have on my machine for now and see what happens. Any way, like RalphTrickey said, it's definitely a little more complicated on VS.NET, which is also what I have. I'll post a detailed list of what needs to be done when I get down to 101 errors. 
Last edited by vovan on 29-10-2003 at 10:48
|
|
|  |
 |
|  |
 |
|
DDowell
|
|
Västerås, Sweden
Nov 2001 time: 06:31
|
|
How do I solve this?
--------------------Configuration: ctp2 - Win32 Debug Browse--------------------
Performing Custom Build Step on ..\ui\ldl\ldl.y
k:\Activision\CTP2Source\bin\byacc: f - cannot open "/tmp/yacc.aa01116"
Error executing c:\windows\system32\cmd.exe.
CivCTP_dbg.exe - 1 error(s), 0 warning(s)
Last edited by DDowell on 29-10-2003 at 20:05
|
|
|  |
 |
|
J Bytheway
|
 |
England
Jul 2001 time: 05:31
|
|
Now I'm down to just 11 errors/12 warnings. Some are in display.h/.cpp, which are presumably due to non-backwards compatibility of DirectX 9.0b to 7.0a, and others have to do with the list include file (#include ), and I have no idea about those at all, but I guess it's related to what RalphTrickey was saying above.
Anyway, here are the changes I have made to the CivSound class to get this far:
In civsound.h replace the #include "mss.h" with:
code: // JJB MSS removal
// #include "mss.h"
// and redefine HAUDIO, HREDBOOK, which were
// presumably defined in mss.h:
#define HAUDIO uint32
#define HREDBOOK uint32
and in CivSound.cpp, replace the constructor with:
code: CivSound::CivSound(uint32 associatedObject, sint32 soundID)
{
const char *fname;
// JJB altered so that always fname == NULL
// and then m_hAudio never needs to be initialized
//if(soundID < 0)
fname = NULL;
//else
// fname = g_theSoundDB->Get(soundID)->GetValue();
m_associatedObject = associatedObject;
m_soundID = soundID;
m_isPlaying = FALSE;
m_isLooping = FALSE;
m_hAudio = NULL;
if (fname == NULL) {
m_soundFilename[0] = 0;
m_dataptr = NULL;
m_datasize = 0;
return;
}
// JJB cut out these lines which now never run
//strcpy(m_soundFilename, fname);
//m_dataptr = g_SoundPF->getData(m_soundFilename, &m_datasize);
//m_hAudio = AIL_quick_load_mem(m_dataptr, m_datasize);
}
(The indentation is a little messed up due to my using tab length 4 in VC++)
|
|
|  |
 |
|
J Bytheway
|
 |
England
Jul 2001 time: 05:31
|
|
Here are some of those display errors:
code: Compiling...
display.cpp
c:\games\ctp2src\ctp2_code\ctp\display.h(11) : error C2146: syntax error : missing ';' before identifier 'hMon'
c:\games\ctp2src\ctp2_code\ctp\display.h(11) : error C2501: 'HMONITOR' : missing storage-class or type specifiers
c:\games\ctp2src\ctp2_code\ctp\display.h(11) : error C2501: 'hMon' : missing storage-class or type specifiers
c:\games\ctp2src\ctp2_code\ctp\display.h(25) : error C2061: syntax error : identifier 'HMONITOR'
c:\games\ctp2src\ctp2_code\ctp\display.cpp(55) : error C2039: 'hMon' : is not a member of 'DisplayDevice'
c:\games\ctp2src\ctp2_code\ctp\display.h(6) : see declaration of 'DisplayDevice'
c:\games\ctp2src\ctp2_code\ctp\display.cpp(68) : error C2065: 'LPDIRECTDRAWENUMERATEEX' : undeclared identifier
c:\games\ctp2src\ctp2_code\ctp\display.cpp(68) : error C2146: syntax error : missing ';' before identifier 'pfnEnum'
c:\games\ctp2src\ctp2_code\ctp\display.cpp(68) : error C2065: 'pfnEnum' : undeclared identifier
c:\games\ctp2src\ctp2_code\ctp\display.cpp(77) : error C2146: syntax error : missing ';' before identifier 'GetProcAddress'
c:\games\ctp2src\ctp2_code\ctp\display.cpp(84) : error C2100: illegal indirection
c:\games\ctp2src\ctp2_code\ctp\display.cpp(268) : error C2039: 'hMon' : is not a member of 'DisplayDevice'
c:\games\ctp2src\ctp2_code\ctp\display.h(6) : see declaration of 'DisplayDevice'
Which seems to mostly be due to an undeclared HMONITOR.
And here are some of the list-related errors (well, technically they are warnings, not errors. In any case they are rather more difficult to decipher):
code: WldGen.cpp
c:\program files\microsoft visual studio\vc98\include\list(178) : warning C4786: '?rbegin@?$list@PAVTransport@NETFunc@@V?$allocator@PAVTransport@NETFunc@@@std@@@std@@QBE?AV?$reverse_bidirectional_iterator@Vconst_iterator@?$list@PAVTransport@NETFunc@
@V? $allocator@PAVTransport@NETFunc@@@std@@@std@@PAVTr
ansport@NETFunc@@ABQAV45@PBQAV45@H@2@XZ' : identifier was truncated to '255' characters in the browser information
c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(134) : see reference to class template instantiation 'std::list >' being compiled
c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(753) : see reference to class template instantiation 'NETFunc::List' being compiled
c:\program files\microsoft visual studio\vc98\include\list(182) : warning C4786: '?rend@?$list@PAVTransport@NETFunc@@V?$allocator@PAVTransport@NETFunc@@@std@@@std@@QBE?AV?$reverse_bidirectional_iterator@Vconst_iterator@?$list@PAVTransport@NETFunc@@V
? $allocator@PAVTransport@NETFunc@@@std@@@std@@PAVTr
ansport@NETFunc@@ABQAV45@PBQAV45@H@2@XZ' : identifier was truncated to '255' characters in the browser information
c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(134) : see reference to class template instantiation 'std::list >' being compiled
c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(753) : see reference to class template instantiation 'NETFunc::List' being compiled
c:\program files\microsoft visual studio\vc98\include\list(176) : warning C4786: '?rbegin@?$list@PAVPlayerStat@NETFunc@@V?$allocator@PAVPlayerStat@NETFunc@@@std@@@std@@QAE?AV?$reverse_bidirectional_iterator@Viterator@?$list@PAVPlayerStat@NETFunc@@V?
$allocator@PAVPlayerStat@NETFunc@@@std@@@std@@PAVP
layerStat@NETFunc@@AAPAV45@PAPAV45@H@2@XZ' : identifier was truncated to '255' characters in the browser information
c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(134) : see reference to class template instantiation 'std::list >' being compiled
c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(951) : see reference to class template instantiation 'NETFunc::List' being compiled
c:\program files\microsoft visual studio\vc98\include\list(178) : warning C4786: '?rbegin@?$list@PAVPlayerStat@NETFunc@@V?$allocator@PAVPlayerStat@NETFunc@@@std@@@std@@QBE?AV?$reverse_bidirectional_iterator@Vconst_iterator@?$list@PAVPlayerStat@NETFu
nc@@V? $allocator@PAVPlayerStat@NETFunc@@@std@@@std@@PAVP
layerStat@NETFunc@@ABQAV45@PBQAV45@H@2@XZ' : identifier was truncated to '255' characters in the browser information
c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(134) : see reference to class template instantiation 'std::list >' being compiled
c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(951) : see reference to class template instantiation 'NETFunc::List' being compiled
c:\program files\microsoft visual studio\vc98\include\list(180) : warning C4786: '?rend@?$list@PAVPlayerStat@NETFunc@@V?$allocator@PAVPlayerStat@NETFunc@@@std@@@std@@QAE?AV?$reverse_bidirectional_iterator@Viterator@?$list@PAVPlayerStat@NETFunc@@V?$a
llocator@PAVPlayerStat@NETFunc@@@std@@@std@@PAVPla
yerStat@NETFunc@@AAPAV45@PAPAV45@H@2@XZ' : identifier was truncated to '255' characters in the browser information
c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(134) : see reference to class template instantiation 'std::list >' being compiled
c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(951) : see reference to class template instantiation 'NETFunc::List' being compiled
c:\program files\microsoft visual studio\vc98\include\list(182) : warning C4786: '?rend@?$list@PAVPlayerStat@NETFunc@@V?$allocator@PAVPlayerStat@NETFunc@@@std@@@std@@QBE?AV?$reverse_bidirectional_iterator@Vconst_iterator@?$list@PAVPlayerStat@NETFunc
@@V? $allocator@PAVPlayerStat@NETFunc@@@std@@@std@@PAVP
layerStat@NETFunc@@ABQAV45@PBQAV45@H@2@XZ' : identifier was truncated to '255' characters in the browser information
c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(134) : see reference to class template instantiation 'std::list >' being compiled
c:\games\ctp2src\ctp2_code\ui\netshell\netfunc.h(951) : see reference to class template instantiation 'NETFunc::List' being compiled
Last edited by J Bytheway on 29-10-2003 at 20:17
|
|
|  |
 |
|
mjs0
|
|
Florida, USA
Jun 2001 time: 00:31
|
|
quote: Originally posted by J Bytheway
What do you mean by the latter - there aren't any "s in the Flex and Bison build commands, are there? They look something like:
code: $(CDKDIR)\flex -i -o$(ProjDir)\lex.yy.c $(InputPath)
|
I hope it is OK for a relative newbie to the CTP forums to jump in here (OK, I admit it I've been lurking since before CTPI was released)...I have a lot of hard earned experience in tracking down Visual C++ build errors and couldn't resist pulling down the code to experiment for myself.
Whilst the original VS6 civctp.dsp file (i.e. the project file) does not have quotes in the custom build definitions that invoke flex, byacc etc. all dsw/dsp files go through a conversion process when loading them in VS.NET for the first time resulting in sln/vcproj files that are now stored in XML.
The conversion process is (how shall I put it) ...suboptimal when dealing with environment variables in custom build commands. Basically the conversion process inserts &quot before and after each environment variable resulting in the crippled workspace and project files we now see.
Probably the quickest way to fix this would be to edit the XML files as text and do a global search/replace on a pattern of &quot($envvar)&quot with ($envvar) for each affected environment variable.
I guess I'll try my own suggestion and let you all know if it works.
Martin
Last edited by mjs0 on 29-10-2003 at 20:37
|
|
|  |
 |
|
mjs0
|
|
Florida, USA
Jun 2001 time: 00:31
|
|
quote: Originally posted by mjs0
Probably the quickest way to fix this would be to edit the XML files as text and do a global search/replace on a pattern of &quot($envvar)&quot with ($envvar) for each affected environment variable.
I guess I'll try my own suggestion and let you all know if it works.
Martin |
Well...for VS.NET this approach fixed all the custom build errors so the calls to flex, byacc, ctpdb et al ran successfully.
Now I just have the compiler problems (3275 errors and 1486 warnings) to resolve!!
Martin.
|
|
|  |
 |
|
vovan
|
|
quote: Originally posted by DDowell
How do I solve this?
--------------------Configuration: ctp2 - Win32 Debug Browse--------------------
Performing Custom Build Step on ..\ui\ldl\ldl.y
k:\Activision\CTP2Source\bin\byacc: f - cannot open "/tmp/yacc.aa01116"
Error executing c:\windows\system32\cmd.exe.
CivCTP_dbg.exe - 1 error(s), 0 warning(s) |
Just create a temp directory that byacc can write to on your C: hard drive.
|
|
|  |
 |
|
vovan
|
|
quote: Originally posted by J Bytheway
Well, I popped in a copy of DECLARE_HANDLE(HMONITOR) (which is almost certainly a really bad idea, but never mind) and now the first errors I get are in the DXMedia files, which is a bad sign...
code: vidplay.cpp
c:\dxmedia\classes\base\ctlutil.h(439) : error C2504: 'IBasicVideo2' : base class undefined
c:\dxmedia\classes\base\sysclock.h(23) : error C2504: 'IAMClockAdjust' : base class undefined
I also have a whole host more errors in SoundManager.cpp - mostly undeclared identifiers... |
Well, maybe I'm just pointing out the obvious, but... HMONITOR is just a windows handle for monitors, which can be used to enumerate all of the monitors connected to the system. It's just a GDI thing, so the definition should be included in windows.h, if I am not mistaken...
|
|
|  |
All times are GMT. The time now is 05:31. Apolyton Time is 00:31. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|