 |
|  |
 |
|
vovan
|
|
Okay, the Getting the source to compile thread is great, but it is starting to overflow with different kinds of information. I think it would be good to keep different discussions separate, and since that other thread has pretty much gotten to the point of taking care of CivSound, I thought a new thread for us VS.NET users is in order. So, the progress I have achieved so far is this:
The conversion from VS6.0 files to .NET was successful, and I had no problems with the quotes as people in the other thread have said. The problems I did have were as follows:
- Custom Build Step couldn't find byacc and bison.
Solution: Put the binaries into some path that does not contain spaces in it.
- byacc couldn't find the source file.
Solution: Put the source files into some path that doesn't contain spaces in it.
- byacc: f - cannot open "/tmp/yacc.aa####"
Solution: Create a C:\tmp directory (or replace the C: drive with whichever one you have your byacc on).
Alternative Solution: Create an environment variable "TMPDIR" that points to a temp directory (e.g.: "%systemroot%\TEMP").
(Atahualpa)
- The definition of dbgallocator in c3debugstl.h doesn't match what's required for the new STL.
Solution: Some template defintions now require the additon of the typename keyword to compile.
(RalphTrickey)
- Some of the math functions (sqrt, ceil, floor) now require floats instead of integers.
Solution: Cast them to double. I think that I remember one that had ceiling of a number divided by 2. This will always return the floor instead. These should be fixed and documeted for anyone working on v6.
(RalphTrickey)
- The definition of dbgallocator in c3debugstl.h doesn't match what's required for the new STL.
Solution: For now, do a global search and replace of dbgallocator< with std::allocator<
(RalphTrickey)
- Ambiguous overload.
Solution: The line
aui_TextBase((MBCHAR *)NULL, (uint32)0)
needs to be
aui_TextBase((const MBCHAR *)NULL, (uint32)0)
(RalphTrickey)
- std::_MAX has changed.
Solution: Replace with max
(RalphTrickey)
-----------------
I was thinking that this would be a good start for sort of an FAQ, or step-by-step instructions, on how to get the thing to compile on .NET. So, if anyone has made more progress than I have, please post here, and I will update the list above.
Last edited by vovan on 03-11-2003 at 07:19
|
|
|  |
 |
|
RalphTrickey
|
|
Colorado Springs
Oct 2001 time: 22:31
|
|
quote: Originally posted by vovansim
4. Now I am having plenty of errors in regards to the STL and the use of incomplete definitions (like, typedefing a deque template with the class parameter from within that class. While that is allowed for compilation, it isn't handled correctly by .NET for some reason.)
Solution: None that I can see right now.
|
The problem here is that it is DEFINING an instance of the type (s_Scheduler(?) inside the class. The definition now requires the size of the item.
Solutions...
Short term.. Move s_Scheduler out of the class and into a static variable in the.cpp file.
|
|
|  |
 |
|
RalphTrickey
|
|
Colorado Springs
Oct 2001 time: 22:31
|
|
Problem...
The definition of dbgallocator in c3debugstl.h doesn't match what's required for the new STL.
Solution...???
Ralph
|
|
|  |
 |
|
RalphTrickey
|
|
Colorado Springs
Oct 2001 time: 22:31
|
|
Solution...
some template defintions now require the additon of the typename keyword to compile.
|
|
|  |
 |
|
RalphTrickey
|
|
Colorado Springs
Oct 2001 time: 22:31
|
|
Problem...
some of the math functions (sqrt, ceil, floor) now require floats instead of integers.
Cast them to double. I think that I remember one that had ceiling of a number divided by 2. This will always return the floor instead. These should be fixed and documeted for anyone working on v6.
|
|
|  |
 |
|
RalphTrickey
|
|
Colorado Springs
Oct 2001 time: 22:31
|
|
quote: Originally posted by RalphTrickey
Problem...
The definition of dbgallocator in c3debugstl.h doesn't match what's required for the new STL.
Solution...???
Ralph |
For now, do a global search and replace of dbgallocator< with std::allocator<
|
|
|  |
 |
|
RalphTrickey
|
|
Colorado Springs
Oct 2001 time: 22:31
|
|
Problem...
the NS_ files (for example ns_games) don't compile as is. I'm not sure what they are supposed to do, or what they do in V6.
|
|
|  |
 |
|
RalphTrickey
|
|
Colorado Springs
Oct 2001 time: 22:31
|
|
Problem...
Ambiguous overload.
Solution...
The line
aui_TextBase((MBCHAR *)NULL, (uint32)0)
needs to be
aui_TextBase((const MBCHAR *)NULL, (uint32)0)
|
|
|  |
 |
|
RalphTrickey
|
|
Colorado Springs
Oct 2001 time: 22:31
|
|
problem...
std::_MAX has changed.
solution
replace wiht max
|
|
|  |
 |
|
vovan
|
|
Thanks, Ralph! That fixed a bunch of errors. I'm thinking now it would be nice to actually implement the changes we make this way in such a way that it doesn't screw things up if we share the code between the people on VS 6 and VS.NET. Probably a good idea to have some #ifdefs in there.
And also, Pyaray, thanks for your response. The list-fixed file contains this comment:
// REM102200: fixed as per http://www.dinkumware.com/vc_fixes.html
So, I suppose that's where the fix was gotten from. Or was list not the only fix you used?
|
|
|  |
 |
|
RalphTrickey
|
|
Colorado Springs
Oct 2001 time: 22:31
|
|
Problem...
The ns_files won't compile.
Work-Around...
Code like the follwing...
ns_AIPlayer::Struct ns_AIPlayer::list[] = {
{STRING, 0},//(Data)&m_name},
{STRING, 0},//(Data)&m_tribe},
{INT, 0},//(Data)&m_civpoints},
{INT, 0},//(Data)&m_pwpoints}
};
Solution...
???
|
|
|  |
 |
|
RalphTrickey
|
|
Colorado Springs
Oct 2001 time: 22:31
|
|
Problem...
sizeof(enum) is undefined
Work-around... For now, use sizeof(int)
solution...
??? Possibly see what it's used for/see what value vc6 has.
|
|
|  |
 |
|
mjs0
|
|
Florida, USA
Jun 2001 time: 00:31
|
|
Just looking back over my notes of things I had to change to get to this point.
One of the things that really stands out is how little trouble there was with DXMedia/DirectX, especially compared to the VS6 thread on this forum.
For DirectX I used the latest DX9 SDK and all I had to do for DXMedia was make a couple of simple changes to combase.h and refclock.h
If I read my notes right I had to
1. comment out an inline definition for InterlockedExchange in combase.h (as .net supports volatiles passed directly to this API)
2. Change #include to #include "schedule.h" as the former was pulling in the runtime version of schedule.h instead of the DXMedia version. This was causing multiple failures due to the resulting absence of CAMSchedule.
(I know there are more elegant fixes to both of these issues!)
Did others see only these DXMedia issues?
For the mss.h issue I simply created stubs for each of the missing functions (and put them in civsound.h) plus ensured they returned an error when appropriate.
I'll try to get my notes in decent shape and post a detailed list of the steps I went through later this evening. (The list will have significant overlap with what is already on here but hopefully will still prove valuable.)
Martin.
|
|
|  |
 |
|  |
 |
|
george03
|
|
I'm sorry, but can some of you guys who understand this whole thing better, please help me out. First of all, I use VC 2003, i.e. v 7.1 (but I suppose it should not bee too different from 2002 - 7). Ihave a few questions:
1. I installed DX 9 SDK. But I don't have DX Media 9 SDK, and cannot download it - it's just way too big. Can anyone tell me what is the solution? Does anyone have the actual files it refers to - i.e. reftime.h?
2. What should be done to the sound system, to get around miles library? The were several work arounds, but which one is better?
3. I seem to have a lot of problems with PointerList.h - has anyone manged to get through it?
4. Perhaps someone can post a working .ent compiled version once he manages to do it. This will make may things easier for others.
Thanks a lot.
|
|
|  |
 |
|  |
 |
|
RalphTrickey
|
|
Colorado Springs
Oct 2001 time: 22:31
|
|
Atahualpa,
Look up in this thread, and you'll see a work-around to the NS_ issue.
I changed the stl headter ot and that seemed to fix many issues with the list class.
I've actually gotten it to run, but then I modified something in the CTP2 options, and haven't been able to get it to run since.
Anyone know where the options are stored?
Ralph
|
|
|  |
 |
|
Atahualpa
|
 |
Hawthrone
Mar 1999 time: 06:31
|
|
Ralph: oops I should have checked the thread more intense. I also ran into the sizeof(enum) thing. I thought WTF???
Can somebody with VC6 compile this little program:
code: #include <iostream.h>
#include <conio.h>
int main(int argc, char** argv)
{
int test;
test = sizeof(enum);
cout<<"sizeof(enum): "<<test;
getch();
return 0;
}
I hope that compiles, I always mix c and c++ ^^
I dont know when I can give it another shot at compiling because I dont have much time.
Btw: the list thing? Is this a bug in the MS STL?
ata
edit: in between [ code ] this forum could really replace < with < and > with >
Last edited by Atahualpa on 07-11-2003 at 14:48
|
|
|  |
 |
|
Fromafar
|
|
VC6 has sizeof(enum): 4
|
|
|  |
 |
|
RalphTrickey
|
|
Colorado Springs
Oct 2001 time: 22:31
|
|
quote: Originally posted by Locutus
In userprofile.txt (in the same folder as the executable). |
Thanks. I deleted it, and everything works again.
|
|
|  |
 |
|
RalphTrickey
|
|
Colorado Springs
Oct 2001 time: 22:31
|
|
quote: Originally posted by Atahualpa
Anyone found a solution to the netshell thing already? (not a compiler-work-around)
I really like to know how on earth that can compile on VC6!?!?!! illegal reference to non static member is not something VS.NET specific.
The problem is that list is declared static in ns_accessor.h and yet you want to add non static members of ns_AIPlayer for example. This can never work out!!! I dont get it. How should the executable know which object's member variable to add to the list.
Besides can someone explain what this should do? There must be another solution to this.
ata |
This code is clearly illegal. I'll bet that on VC6, the code does something like... ns_array[0].data = &ns_array[0].text, that is it implicitly access the n'th array on the right hand side during the assignment. The solution is to break it into two parts, the main part is similar to what I posted above. The second part is in the initialization section, to actually make the assignments. I played with this a little, but coudn't get the cast right.
Ralph
|
|
|  |
 |
|  |
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
|
|
|
|
|
|