Compiling ForumRS - ryandw11/ForumRS GitHub Wiki

Windows

  1. Install MYSQL.
    Diesel (a crate that ForumRS uses) requires Mysql server lib files to compile properly.
  2. You will now need to create an environment variable named MYSQLCLIENT_LIB_DIR that points to the location of mysqlclient.lib. This is usually found in the MySQL Server folder in Program Files. Example: C:\Program Files\MySQL\MySQL Server 8.0\lib where 8.0 is your MySQL version.
    1. You can use the following command to do that:
      setx MYSQLCLIENT_LIB_DIR "C:\Program Files\MySQL\MySQL Server 8.0\lib"
      
  3. You will now need to install SQLite3.
    1. Download the source code from sqlite.org and extract it in a location for SQLite3. (Ex: C:\SQlite3)
    2. Download the binary for Windows from sqlite.org (under the header named Precompiled Binaries for Windows) and extract it in the same location as the source code.
    3. Open Developer Command Prompt for VS 2019 by searching for it. (You can use an older or newer version of VS).
    4. Navigate to where you stored the binary and source code.
    5. Run lib /DEF:sqlite3.def /OUT:sqlite3.lib /MACHINE:x64
  4. You will need to create another environment variable named SQLITE3_LIB_DIR that points to the location of the directory where you put Sqlite3.
    1. You can use the following command to do that:
    setx SQLITE3_LIB_DIR "C:\Sqlite3"
    
  5. Restart your computer so the environment variable will take effect.
  6. Run cargo build or cargo run