(Slightly edited - I did not write this, so all credits should stand as is.)
I want to give all credits to the Project XI forums for all they're great development and progression. Basically, I am just here as a messenger and provider, wanting to help everyone in their Final Fantasy XI server development.
Prerequisites:
- some version of the Visual Studio C++ compiler (2008 Express or later preferred)
- heap o' code for pXI
Compiling the Server - the down and dirty just-get-it-running way
1. Make sure you have obtained the Prerequisites. (Unpack the code into a directory and remember where it is.)
2. Open your Visual C++ 2008 Express Edition. Select "File>New>Project from Existing Code".
3. A window will pop up and ask you what type of project you would like to create. Make sure Visual C++ is selected, and press Next.
4. Under "Project File Location" select browse, and find the folder that you put the code in. This should be your Project File Location.
5. Type in your Project Name. It can be whatever you want it to be. The pXI team recommended using a descriptive name. Once you've typed that in, press Next.
6. This screen should say "How do you want to Build the Project?". You want to Use Visual Studio, and select "Console Application Project" from the dropdown Menu. After this, you can select Finish.
7. Now your project should be created to the left side. Before you continue with it, select "Configuration Manager" from the "Build" menu in the menubar. Your project will be on this list. Next to your Project Name you'll see it say "Debug". Change this to "Release". and then press "Close".
8. Now you want to Right click your project name on the left side, and go to Properties. Go to "C/C++" and open the +. Now go to General underneath that. On the right side of the window, you will see some Information about the General Tab. You want to click just right of "Additional Include Directories". If you setup your project file in the same directory as the SVN branch directory, you can simply paste the following string:
Code (there should be no spaces in this... don't know why they appear):
include;include\ItemTypes;include\LUA;include\MySQ L;include\PacketTypes;include\pThreads;include\Uti ls
* If your project file is elsewhere, or you get errors when you try to compile, you may need to specify the exact location of your "include" directories. To do this, click the "Additional Include Directories" field. A grey "..." will appear to the right. Click that. A mini window will appear. Click in the white area twice and it will allow you to type. Also, on the right side there will be another Grey "..." button. This allows you to select the correct directory through browsing. You can add multiple directories, one at a time; which you will need to add a few.
* The directories you need to add are inside of your trunk/SVN folder and include those mentioned in the list above. The folders may have been updated since this guide was last updated, so you may wish to add every folder and sub-folder in the "trunk" directory.
* Again, you will have to add them one at a time, but make sure all are added. Also, make sure you browse through your folders to get their exact locations. Once this is done, press "OK", and "Apply". Do not close out the Properties Window yet.
9. On the left side of the Properties Window, go to "Linker" now. Press the + to expand it, then go to "Input". On the right side the Input information will show. Next to "Additional Dependencies" copy and paste this:
Code (there should be spaces between each of these):
lib\libmysql.lib lib\lua5.1.lib lib\ws2_32.lib lib\pthreadVSE2.lib
Once that is added, press "Apply" and then select the "General" tab that is under "Linker" and above the "Input" tab that you are currently on.
10. There is a spot where it says "Enable Incremental Linking". Change this so it says "No", and then press "Apply", and then "OK".
11. Finally, right click your project, and select "Build". It will put your new .exe inside of your project folder, inside of a "Release" Folder. Go into that folder after your build has finish, and Copy YourProjectName.exe and paste it into the folder you run your server from -- the .exe requires that you have the 4 dat files: compress, decompress, weatherinfo, and BLOWFISH.
Troubleshooting:
* If you mess up anywhere throughout this, and then change/fix something, make sure you right click your project and select "Clean". This can prevent further errors when you Build or Rebuild after changing information.
* Following the above instructions with current revisions will yield an error regarding "version.h". This is because we do not include version.h. You must either rename "version_example.h" to "version.h" and put it in the include directory, or, more appropriately: go into the include directory and read "version_template.h" for instructions on how to use SubWCRev.exe to create a proper "version.h" file.
* Your "Additional Include Directories" (from Step 8) may also need to contain the rest of the include folder's subdirectories (in my case: "include;include\ItemTypes;include\LUA;include\MyS QL;include\PacketTypes;include\pThreads;include\Ut ils")
Post-Compiling Errors:
If you are able to compile successfully, but are experiencing issues when trying to run the executable, please try the following:
* In the executable directory (usually "Release" or "Debug"), be sure to include the following files: "pthread.dll", "compress.dat", "decompress.dat", and "BLOWFISH.dat".
* Be sure you update your database using the SQL files in the "misc" directory (all prefaced with "update"). If all else fails, empty your database and restore it from the original DB provided, then run the updates. You will, of course, lose your characters.
Credits:
ProjectXI Forums and Creators