Skip to content

Compiling with VS 2010 & VS 2012

jonwd7 edited this page Feb 14, 2014 · 4 revisions

(WIP)

Requirements

ALL Qt 4.8.3
VS 2010 Qt Visual Studio Add-in for Qt4  (NOTE: VS 2010 is required to use Qt Designer for Qt4) May not be true
VS 2012 Qt Visual Studio Add-in for Qt5  (NOTE: Limited to regenerating your .vcxproj files from nifskope.pro) May not be true
VS 2012 You must also have VS 2010 installed in order to compile with the VS 2010 platform toolset (v100)

Preparing Your Build Environment

  1. Install Qt 4.8.3.
  2. Install Qt Visual Studio Add-in for your version of Visual Studio.
  3. In Visual Studio, create a new, empty project in your Nifskope folder.
  4. Open nifskope.pro. (See: Regenerating Your Project Files)
  5. Define the QTDIR environment variable (See: Establishing Environment Variables)
  6. In your NifSkope Property Page > General verify that your Platform Toolset is set to Visual Studio 2010 (v100)

Establishing Environment Variables

There are a few ways to define QTDIR.

Editing .user Files

You can add QTDIR to your NifSkope.vcxproj.user file. Open it up as text, and add <QTDIR>C:\Qt\4.8.3</QTDIR> directly inside each . Replace the path with your Qt path. Example:

...
    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
        <QTDIR>C:\Qt\4.8.3</QTDIR>
        <LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
    </PropertyGroup>
...

Creating a System Environment Variable

You can also add a user or system environment variable in Windows.

Regenerating Your Project Files

  1. Make your edits to nifskope.pro.
  2. Save and unload the project if it is open.
  3. In the menu bar navigate to Qt4 (or Qt5) > Open Qt Project File (.pro) ...
  4. Prompt "Yes" when it asks if you want to regenerate the project files.

(Note: Currently this must be done every time you want to update NIFSKOPE_VERSION and NIFSKOPE_REVISION) Does it? I might be wrong.

Common Issues

Moc'ing ... "The system cannot find the path specified."

QTDIR is probably not defined. You can tell if this is already defined by going to the Nifskope project in Visual Studio, Right Click > Properties. Under C/C++ > Command Line you can see the entire output for the build. You should see the full path to Qt includes several times (e.g C:\Qt\4.8.3...), and if you only see "\include\QtCore", QTDIR is not defined.

LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700'

You have not set your Platform Toolset to Visual Studio 2010 (v100).