Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Windows / Setting up AGK with VS 2013

Author
Message
Koakuma
8
Years of Service
User Offline
Joined: 13th Aug 2015
Location:
Posted: 23rd Oct 2015 23:55
So I recently decided to make the switch from basic to C++ after writing a complete test game in basic.

I downloaded and installed VS 2013, and copied the 2013 template project into VS... But now I'm stuck.
I'm not new to C++, but I am new to Visual Studio. Previously, all my code (c++ or not) was written in gedit or emacs and compiled via command line, as is university custom. Haha...
How do I add the AppGameKit libraries to Visual Studio so that I can compile the base template?
I've tried copying the libraries into Visual Studio\VC\crt\src and \VC\include, and it found the libraries after that, but the namespace AppGameKit didn't work and I got an error about glext.h not being found.

Can anyone point me in the right direction? There's not much google can offer on VS 2013, for some reason.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th Oct 2015 22:57 Edited at: 24th Oct 2015 23:00
It is actually fairly simple. You need to edit the compile/link properties.

Right click on the project (not the soluction itself) in the Solution Explorer and select Properties.

At the very top it allows you to select the Configuration. You will need to set both the Release and Debug configurations. The Release version is for the final product. The Debug version allows you to interactively debug your code. This can be very helpful at times.

These instructions will refer to whereever you have installed your AGK. Since it is possible to set that directory to something other than the default (which allows you to have multiple versions of AppGameKit installed at the same time), I will use '<AGK Dir>' to refer to that directory (mine is C:\TGC\V2_14). It is safer to use an absolute path rather than a relative one. That makes it possible to put your project directory anywhere. Whenever I install a new version of AppGameKit, the first thing I do is edit the Windows templates to use absolute paths for the AppGameKit version just installed. And I add all the changes listed below so that any project started from a template can be in a different location and be preconfigured.

To let your project 'see' the AppGameKit include files for the compilation stage, you want to change the 'Additional Include Directories' found in 'Configuration Properties->C/C++->General'. Add the following to the end of whatever string is in there:


"%(AdditionalIncludeDirectories)" is the actual string intended above.

To let your project 'see' the TGC libraries for the linking stage, edit the 'Additional Library Directories' entry in 'Configuration Properties->Linker->General'. For the 'Release' configuration add:


For the 'Debug' configuration add:


Some other configurations that I use for organization allow you to make sure that all the final and intermediate files created during compiling and linking to be created in directories underneath the project (instead of a shared area somewhere else) are set in the 'Configuration Properties->General' section. These need to be set for both the Release and Debug configurations (all the strings below are exactly as they appear, some of these fields may already appear as below):


By specifying a different 'Intermediate Directory', you make sure that your executable directory doesn't get cluttered with things not needed for actual execution.

Manually add the 'Final' directory in your project directory' and create your 'media' directory in that. That media directory is where you put all your images and other data that your program will use when running.

Another setting that comes in handy is the 'Preprocessor Definitions' entry under 'Configuration Properties->C/C++->Preprocessor'. This is where you can set things that the project can use. I add 'AGKWINDOWS' as the first string. It allows me to use "#ifdef' in my code so that I can have one set of files for all platforms. This is how that can be useful:


My current WIP (very lonely right now as I haven't had a lot of time) has 50 .h/.cpp files in the project. And, I was able to build for Windows, Mac, iOS and Android with the same files.
Cheers,
Ancient Lady
Koakuma
8
Years of Service
User Offline
Joined: 13th Aug 2015
Location:
Posted: 25th Oct 2015 20:17
Thanks for the reply!
I followed your instructions and it definitely helped somewhat, but now I'm getting a whole bunch of linker errors.
Upon compiling, I get "error LNK2038: mismatch detected for <various things> in Core.obj"
<various things> are stuff like '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2', or 'RuntimeLibrary': value 'MT_StaticRelease doesn't match value 'MTd_StaticDebug'
The file it's reporting it in is AGKWindows.lib.

A quick google seems to show that this is relating to the debug not being supported somewhere. Is there a setting I need to change somewhere?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Oct 2015 23:54
What happens when you try to compile and link in the Release configuration?

It also looks like you may have mixed debug settings. Make sure that the 'Additional Library Directories' entry in 'Configuration Properties->Linker->General' matches the configuration:
Debug config: <AGK Dir>\Tier2\Tier2\platform\windows\Lib\VS2013\Debug
Release config: <AGK Dir>\Tier2\Tier2\platform\windows\Lib\VS2013\Release

The 'Generate Debug Info' entry in 'Configuration Properties->Linker->Debugging' should be 'Yes (/DEBUG)' for the Debug configuration and 'No' for the Release configuration.
Cheers,
Ancient Lady
Koakuma
8
Years of Service
User Offline
Joined: 13th Aug 2015
Location:
Posted: 26th Oct 2015 09:29
Oh! My bad. I apparently added both the debug line and the release line to the Config Properties one after another.
I got it to compile in debug, with just some warnings about LNK4099: PDB 'atls.pdb' was not found with 'AGKWindows.lib' [...] linking object as if no debug info.
I got an exe with the screen FPS displaying though, and that's good enough for me!

I guess another question I'd like to ask, though this may deserve its own thread... Is it possible to add a windows-style dropdown menu via winAPI (file, edit, help, etc) to the AppGameKit window and have it be able to interact? If not I can just program a menu in AppGameKit but I figured I might as well ask, haha.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 27th Oct 2015 01:30
I'm glad you worked it out.

Quote: " LNK4099: PDB 'atls.pdb' was not found with 'AGKWindows.lib' "

We all get that in the debug config, it means nothing.

Quote: "Is it possible to add a windows-style dropdown menu via winAPI"

No, not as far as I know anyway. The AppGameKit engine takes total control of the display and user inputs.

FYI, I am only very minimally available during the work week. I checked today to see if you had gotten fixed or not.

Cheers!
Cheers,
Ancient Lady
Koakuma
8
Years of Service
User Offline
Joined: 13th Aug 2015
Location:
Posted: 5th Nov 2015 18:28
I recently started getting another error. This applies to the default template with the settings given.
error C1083: Cannot open include file: 'LinearMath/btHashMap.h': No such file or directory
followed by a whole bunch of IntelliSense errors being unable to open various source files.

I looked at the file in question and it looks like it's trying to access a source file in a subdirectory that's actually a directory above it. Any reason why this error suddenly cropped up? I didn't change anything, to my knowledge. Should I reinstall the AppGameKit additional files?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 8th Nov 2015 22:21
Check to make sure that you have the right paths in the 'Additional Include Directories' configurations for where the named file(s) exist.

I might suspect that the default templates may or may not have the include paths set right. The directory structure has changed more than once in the AppGameKit installs.
Cheers,
Ancient Lady
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 24th Dec 2015 13:41
@Ancient Lady: Just followed your walkthrough, but using Visual Studio 2015, it worked perfectly! (I too made the mistake of mixing up the debug/release linker settings) but it's all sorted!

You my lady are a legend!!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Dec 2015 21:03
I am always glad to help.

Happy Holidays!
Cheers,
Ancient Lady

Login to post a reply

Server time is: 2024-04-20 03:11:16
Your offset time is: 2024-04-20 03:11:16