Advertisement
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - SDK/Python

Notices

Reply
 
Thread Tools
Old May 13, 2010, 09:01 AM   #1
Jester Fool
Dune Messiah
 
Jester Fool's Avatar
 
Join Date: Apr 2010
Location: Katy, TX
Posts: 1,179
BUG/BULL/BBAI? source code error

Specifics: Vista 64 bit OS; Visual Studio 2008 Express; have successfully compiled the vanilla SDK and other Mods
I am trying to compile a SDK which uses BUG DLL makefile. I can compile it using the 2003 C++ Toolkit fine but I get CTD running the Debug DLL. I then switched to the tools that come with VS 2008 to make the Debug DLL. I have fixed the errors revealed so far (most of which were undeclared identifiers in For loops) but get these errors...
Spoiler:
CxImage/general/ximatran.cpp(183) : error C2666: 'div' : 2 overloads have similar conversions
1> C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include\stdlib.h(480): could be 'ldiv_t div(long,long)'
1> C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include\stdlib.h(446): or 'div_t div(int,int)'
1> while trying to match the argument list '(long, int)'
1>CxImage/general/ximatran.cpp(301) : error C2666: 'div' : 2 overloads have similar conversions
1> C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include\stdlib.h(480): could be 'ldiv_t div(long,long)'
1> C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/include\stdlib.h(446): or 'div_t div(int,int)'
1> while trying to match the argument list '(long, int)'
Looking at the source
Code:
div_r = div(y + dlineup, 8);
the problem is clear since both y and dlineup have already been declared long and obviously 8 is an integer. How do you force a conversion? Any help would be appreciated.
Jester Fool is offline   Reply With Quote
Old May 13, 2010, 10:35 AM   #2
davidlallen
Deity
 
davidlallen's Avatar
 
Join Date: Apr 2008
Location: California
Posts: 4,728
Quote:
Originally Posted by Jester Fool View Post
I then switched to the tools that come with VS 2008 to make the Debug DLL.
This approach is not going to work. The civ code was written in 2001-2002 and it is completely incompatible with more recent compilers. You will have to make hundreds of code changes in order to do a native VS 2008 compile.

What is the specific problem that happens with your VS 2003 debug dll? Are you able to attach the debugger? Are you able to start a game?
__________________
Come see the Fury Road sub-forum! Everybody wants post-apocalyptic desert warfare with crossbows!
davidlallen is offline   Reply With Quote
Old May 13, 2010, 12:19 PM   #3
Jester Fool
Dune Messiah
 
Jester Fool's Avatar
 
Join Date: Apr 2010
Location: Katy, TX
Posts: 1,179
I get an XML error...
Spoiler:
There are more siblings than memory allocated for them in CvXMLLoadUtility::SetVariableListTagPair
Current XML file is: xml\Civilizations/Civ4LeaderHeadInfos.xml
followed by...
Spoiler:
Unhandled exception at 0x7729ac6c in Civ4BeyondSword.exe:0xC0000005:Access violation writing location 0x00007364
and of course the dreaded CTD. I actually could compile, natively under VS 2008, if I removed ximage (with a bunch of warnings) but of course couldn't link any of the OBJ files since removing ximage created unresolved external references. I don't know if ximage is causing the CTD but from what I can tell, the addition of ximage into BUG is the only change from the old code.
Jester Fool is offline   Reply With Quote
Old May 13, 2010, 12:26 PM   #4
davidlallen
Deity
 
davidlallen's Avatar
 
Join Date: Apr 2008
Location: California
Posts: 4,728
I don't think the xml error is due to the way you built the dll.

When you build in "final release" and "debug" you should get the same xml error. Is that correct? Once you get this xml error all bets are off and a crash is highly likely. When you change only to use the dll which is distributed in the release, then you do not get any xml error. Is that also correct?

Then the source code you are building from must not be the same as what was built to make dll in the release. If that is the problem, we should go back to the DW sub-forum and discuss there.
__________________
Come see the Fury Road sub-forum! Everybody wants post-apocalyptic desert warfare with crossbows!
davidlallen is offline   Reply With Quote
Old May 13, 2010, 02:04 PM   #5
Jester Fool
Dune Messiah
 
Jester Fool's Avatar
 
Join Date: Apr 2010
Location: Katy, TX
Posts: 1,179
No. I only get the XML using the debug DLL. The Final_Release and original DLLs work.
Jester Fool is offline   Reply With Quote
Old May 13, 2010, 03:49 PM   #6
davidlallen
Deity
 
davidlallen's Avatar
 
Join Date: Apr 2008
Location: California
Posts: 4,728
I cannot think of any reason why that should happen. Anybody?
__________________
Come see the Fury Road sub-forum! Everybody wants post-apocalyptic desert warfare with crossbows!
davidlallen is offline   Reply With Quote
Old May 14, 2010, 08:11 PM   #7
Afforess
The White Wizard
 
Afforess's Avatar
 
Join Date: Jul 2007
Location: Michigan, USA
Posts: 10,652
Images: 8
Uh... that happens when you create an array of size -1 or 0...
__________________
"A Witty Saying Proves Nothing"
-Voltaire

Civilization 4 Mods: Rise of Mankind - A New Dawn 1.75
Civilization 5 Mods: Active City Defense, Tech Diffusion
Minecraft Mods: Spout & Spoutcraft Lead Developer
Afforess is offline   Reply With Quote
Old May 16, 2010, 05:00 PM   #8
EmperorFool
Deity
 
EmperorFool's Avatar
 
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,625
Are you using the original BTS XML files, or are they modded as well?
__________________
Monkeys killing monkeys killing monkeys over pieces of the ground.
Silly monkeys, give them thumbs they make a club and beat their brother down.


BUG Mod - BTS Unaltered Gameplay
[ Forum | Download | FAQ | Known Issues | Troubleshooting | Modding Tutorial ]

BAT 3.0.1 QuickFix™ released Oct 24th
EmperorFool is offline   Reply With Quote
Old May 17, 2010, 11:05 AM   #9
Jester Fool
Dune Messiah
 
Jester Fool's Avatar
 
Join Date: Apr 2010
Location: Katy, TX
Posts: 1,179
Quote:
Originally Posted by EmperorFool View Post
Are you using the original BTS XML files, or are they modded as well?
Unfortunately they are modded as well (and parts of other mods are embedded in the source code as well). I'll try compiling a debug dll with just BUG/BULL. If that works at least I will know the problem is not caused by BUG/BULL.
Jester Fool is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - SDK/Python > [SDK] BUG/BULL/BBAI? source code error

Thread Tools

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Source Code Gamemaster77 Civ3 - Creation & Customization 17 May 22, 2013 04:20 AM
BUG shared file with BBAI entwood Civ4 - BTS Unaltered Gameplay (BUG, BAT and BULL) 3 Aug 18, 2009 11:07 PM
source code? Nemo Civ4 - Sevomod 6 Oct 27, 2007 08:00 AM
Source-Code imporator Civ4 - Rhye's and Fall of Civilization 3 Jun 26, 2007 08:05 AM
Source code SCC2 Civ2 - General Discussions 1 Jul 05, 2004 11:31 PM


Advertisement

All times are GMT -6. The time now is 03:22 AM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR