1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

A simple guide to compiling the DLL

Discussion in 'Civ4 - Modding Tutorials & Reference' started by Asaf, Dec 29, 2010.

  1. Asaf

    Asaf Sleep Deprived

    Joined:
    Mar 22, 2010
    Messages:
    1,326
    Can you compress your compiled DLL and attach it?
     
  2. UncleOwen

    UncleOwen Chieftain

    Joined:
    Apr 19, 2012
    Messages:
    9
    Sure. This is my debug .dll. Does it work for you?
     

    Attached Files:

  3. Red Key

    Red Key Modder

    Joined:
    Sep 24, 2011
    Messages:
    418
    Gender:
    Male
    Location:
    USA
    Is it possible to compile the source files when they are in a different folder than the makefile and project? If it is simple to do then I would like to keep the source files in a separate folder from the project and makefile.

    If that is not simple to do... would it be easy if I kept the makefile with the source files but had the project in a different folder?
     
  4. Sareln

    Sareln Warlord

    Joined:
    Dec 29, 2005
    Messages:
    211
    Location:
    Davis, CA
    It's definitely possible. I'm curious though, why do you want to do it?

    You can alter the makefile to point to the location of the source files. It will require relative directory path commands. I think VS2010 lets you leave project files in different folders instead of copying them into a working directory. Should be an option/prompt when you create the project.
     
  5. Red Key

    Red Key Modder

    Joined:
    Sep 24, 2011
    Messages:
    418
    Gender:
    Male
    Location:
    USA
    I am using VS2010 so that is good to know.

    As for why - I plan on creating a sourceforge project and using SVN to keep track of my code changes. I don't want the project and all the extra files it generates to be included in the sourceforge/SVN stuff, so I thought it would be best if the project was in a different folder than the source files.
     
  6. Sareln

    Sareln Warlord

    Joined:
    Dec 29, 2005
    Messages:
    211
    Location:
    Davis, CA
    Hmm. I think you can do that a better way. With SVN and definitely with Bzr it should be possible to only version some of the files in a folder; say *.c and *.h. That way you can keep the whole thing together (which the makefile and visual studio like) while only versioning the source and not the *.o or project files (which SVN likes since it reduces the size of commits).
     
  7. Lemon Merchant

    Lemon Merchant Forum Buzzkill Super Moderator

    Joined:
    Jun 27, 2008
    Messages:
    8,389
    Gender:
    Female
    Location:
    Red Sector A
    Hi Asaf. :)

    I am working on BAT again and I keep running into this error:

    Code:
        106    IntelliSense: PCH warning: line directives cannot be used in a PCH.  An intellisense PCH file was not generated.    c:\firaxis games\sid meier's civilization 4\beyond the sword\cvgamecoredll\boost-1.32.0\include\boost\python\call.hpp    44    4    
    
    Any ideas? I seem to be getting one for each .hpp file. I'm using VS2010 Pro. It's always worked before... :crazyeye:
     
  8. Asaf

    Asaf Sleep Deprived

    Joined:
    Mar 22, 2010
    Messages:
    1,326
    @UncleOwen - Sorry for the long wait. I didn't have time yet to take a look at your DLL. I hope I'll find the time in a few weeks. Post a reminder here from time to time if it's still relevant.

    @Red Key - When using source control, developers usually keep the project files and makefiles with the source code files in the source control. The idea is that you can checkout a working copy and with minimal additions successfully build the project. What you shouldn't check in are the user files (*.user, *.suo) and intellisense files (in VS2010 - *.sdf, *.opensdf), and anything that is built from the files (*.obj, *.lib), but these are usually in a subfolder.

    @LM - As far as I can see, it might only affect intellisense performance. I'm assuming your DLL is created? If so, you can usually hide intellisense errors using by turning the "error reporting" property off in the relevant options page.
    Let me know if it's enough or if you want me to investigate it further.
     
  9. UncleOwen

    UncleOwen Chieftain

    Joined:
    Apr 19, 2012
    Messages:
    9
    Yeah, no problem. Just have a look when you got the time.
     
  10. Lemon Merchant

    Lemon Merchant Forum Buzzkill Super Moderator

    Joined:
    Jun 27, 2008
    Messages:
    8,389
    Gender:
    Female
    Location:
    Red Sector A
    I seem to have fixed this one, though I'm not sure how. Now, I'm just fighting with the effing Boost libraries - AGAIN. :wallbash:

    It's sort of "Now you see me, now you don't" with those stupid things, and no matter how many times I do this, I lose at least a day getting this @&%$ figured out. I'm using Danny Demonic's makefile. All of this has worked fine before, but it will.not.compile. [pissed]

    I've even had to resort to editing the vcproj file manually to fix what should be read from the makefile. What am I doing wrong? :confused:
     
  11. Asaf

    Asaf Sleep Deprived

    Joined:
    Mar 22, 2010
    Messages:
    1,326
    :dunno: post the makefile and proj
     
  12. Lemon Merchant

    Lemon Merchant Forum Buzzkill Super Moderator

    Joined:
    Jun 27, 2008
    Messages:
    8,389
    Gender:
    Female
    Location:
    Red Sector A
    I'm sorry I was cross earlier. Here are the files:
    View attachment ProjectFiles.zip

    No matter what I do, I can't see the Boost files, I get arbitrary errors in intellisense, and it will not compile with any amount of coaxing.

    I'm at a total loss. I must mention that everything is a fresh install as my original development machine was smashed to pieces during a recent move. :(
     
  13. Asaf

    Asaf Sleep Deprived

    Joined:
    Mar 22, 2010
    Messages:
    1,326
    First, I assume these are correct?
    Code:
    TOOLKIT=C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003
    PSDK=E:\WindowsSDK
    CIVINSTALL=C:\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword
    
    Second, you can ignore the intellisense errors (just hide them the way I posted earlier). Can you post the rest of the errors? The actual compilation errors?
     
  14. AbsintheRed

    AbsintheRed Deity

    Joined:
    Jul 27, 2009
    Messages:
    8,288
    Location:
    Szeged, Hungary
    I used an earlier version before, now switching to this
    So just to make it sure:
    If you have extra c++ and header files among the source files, you simply add those into the projectfile?
    The makefile adds them automatically, right?
    Also, it doesn't really matters, whether I compile the CvTextScreens file or not, correct?

    EDIT: Also, with your files, I don't need the Boost-1.32.0 and Python24 folders from Beyond the Sword\CvGameCoreDLL\, right?
    (if the CIVINSTALL route is set correctly in the makefile)
     
  15. Lemon Merchant

    Lemon Merchant Forum Buzzkill Super Moderator

    Joined:
    Jun 27, 2008
    Messages:
    8,389
    Gender:
    Female
    Location:
    Red Sector A
    Hi Asaf.

    First of all, here is the proper makefile. (I sent the wrong one at first, sorry) And the errors. I've got it from 6339 errors down to 9, so I'm doing something right. :lol:

    View attachment errors.zip

    Of the nine I still have left, only the PCH errors are a concern. The others are something borked in my code, and I'll have to fix those myself. My makefile comes from Better BAT AI, which I know compiles properly.

    Thanks.

    EDIT:

    I have it fixed.
     
  16. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    having a problem, needed a debug dll for my mod and I put the source files and stuff into the folder, the environment said the project was out of date so I looked and saw it was replaced by the mods project files (old) so put in the right project (basically redid from stratch), when I try to build the solution I just get this:

    1>------ Build started: Project: CvGameCoreDLL, Configuration: Release Win32 ------
    1>Performing Makefile project actions
    1> COPY "Release\CvGameCoreDLL.dll" "C:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword\Mods\New Leader\Assets\."
    1>Access is denied.
    1> 0 file(s) copied.
    1>Build log was saved at "file://c:\Users\User\DLL Compilation\CvGameCoreDLL\Release\BuildLog.htm"
    1>CvGameCoreDLL - 0 error(s), 0 warning(s)
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

    but in the Debug folder there is no new dll... whats the problem?
     
  17. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    I did it!!! I compiled a .dll!!! I cannot believe I did it!! Awesome tutorial 7 thumbs up!!
     
  18. dacubz145

    dacubz145 Deity

    Joined:
    Jun 21, 2010
    Messages:
    3,730
    Location:
    Windy City
    Decided to try this out, and I did everything as you said but when I did that, I got errors.
    Spoiler :

    1>Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"
    1>Build log was saved at "file://c:\Users\kyle\Desktop\CvGameCoreDLL\Debug\BuildLog.htm"
    1>CvGameCoreDLL - 1 error(s), 103 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Thats just the bottom since the whole thing would be to long
     
  19. UncleOwen

    UncleOwen Chieftain

    Joined:
    Apr 19, 2012
    Messages:
    9
    That's just saying "There was an error". The important information is further up.
     
  20. dacubz145

    dacubz145 Deity

    Joined:
    Jun 21, 2010
    Messages:
    3,730
    Location:
    Windy City
    Well what part is important? There are 89,000 lines above soo not sure what to post
     

Share This Page