• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Bombshell93

[VS 2010 C++] Strange behavior including boost

13 posts in this topic

I'm pretty confused.
I tried including the boost thread library to get working with multi-threading within my DLL
but some off stuff happened.
I added the necessary directories into the project settings and put in
[code]#include <boost\thread.hpp>[/code]
but it told me the file didn't exist. (which it did)
I did some poking around and realized the problem, the directories needed for the header file were needed in the executable settings too.

Now the confusing part. After adding the directories to the project settings I started getting errors saying how Windows.h suddenly stopped existing!!
I "fixxed" this by having the settings inherit from default.
I put that in quotes because now I have a really odd problem, everything builds okay in debug (or so it seams) but when the program runs it doesn't even open a window. it does nothing at all.
just out of curiosity I decided to build in release. Which keeps giving me
[code]1>------ Build started: Project: IndigoFramework, Configuration: Release Win32 ------
1> Indigo.cpp
1>c:\users\bombshell\documents\visual studio 2010\projects\indigoengine\indigoengine\Indigo.h(8): fatal error C1083: Cannot open include file: 'd3dx11.h': No such file or directory
2>------ Build started: Project: IndigoEngine, Configuration: Release Win32 ------
2> MProg.cpp
2>c:\users\bombshell\documents\visual studio 2010\projects\indigoengine\indigoengine\Indigo.h(8): fatal error C1083: Cannot open include file: 'd3dx11.h': No such file or directory========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========[/code]

but on further investigation, though I don't know why building release gives me those errors
removing the
[code]#include <boost\thread.hpp>[/code]
from the DLL header file everything goes back to normal... (though building in release still gives the above error)

I'm just completely confused as to what is going on.
Any help is appreciated,
Thanks in advanced,
Bombshell
0

Share this post


Link to post
Share on other sites
The correct syntax for #include is #include <path/to/file.h> not <path\to\file.h>. The latter actually generates [i]escape sequences[/i] which means you're not getting "path\to\file" you're getting, well, what's likely gibberish :-)
0

Share this post


Link to post
Share on other sites
[quote name='ApochPiQ' timestamp='1311058917' post='4837239']
The correct syntax for #include is #include <path/to/file.h> not <path\to\file.h>. The latter actually generates [i]escape sequences[/i] which means you're not getting "path\to\file" you're getting, well, what's likely gibberish :-)
[/quote]

I'm not sure if thats the problem as VS is quite happy to accept either \ or / without generatign escape sequences. ..\ works as intended. I am curious as the right direction (\ or /) as I've never really been sure. I'm currently using \ with no problems - though whether that is the right thing to do or not I've no idea.

Bombshell, I would recheck the includes, remove them and try it again. I'm sure you've tried that a few times but thats the most likely problem. Don't add them as project includes, add them to VS itself Tools->Options->Projects and Solutions->VC++ Directories.
0

Share this post


Link to post
Share on other sites
#include directives are not string literals, escape sequences are not necessarily valid there. I believe they are actually implementation defined, apart from the standard headers of course.
0

Share this post


Link to post
Share on other sites
You need to set proper include paths in both debug and release mode.
Fire up your project setting dialog, then choose "release" target, check the include path.

BTW, you can use "boost\thread.hpp", but I think it's better to use '/' instead of '\' so it can be compiled anywhere (on Mac, Linux, etc). Though I'm not sure if '\' can compile on Linux.
0

Share this post


Link to post
Share on other sites
thanks for the clarification on the release problem.

as for debug when including boost
all the necessary directories are in VC++ Directories project settings.
But the program still does nothing after running.

I still find the strangest thing to be the fact that removing the boost include stops the problem.
I didn't think a single header file could have so much of a difference in getting the program to run.
To build sure, with linking problems or something, but the fact its building but not running has me most confused.

Here is what I get on build, seems relatively harmless
[code]1>------ Build started: Project: IndigoFramework, Configuration: Debug Win32 ------
1> Indigo.cpp
1>..\IndigoEngine\Indigo.cpp(10): warning C4244: '=' : conversion from 'float' to 'UINT', possible loss of data
1>..\IndigoEngine\Indigo.cpp(11): warning C4244: '=' : conversion from 'float' to 'UINT', possible loss of data
1>c:\program files (x86)\boost\boost_1_47\boost\thread\win32\basic_timed_mutex.hpp(160): warning C4793: 'boost::detail::basic_timed_mutex::unlock' : function compiled as native :
1> Found an intrinsic not supported in managed code
1>c:\program files (x86)\boost\boost_1_47\boost\thread\win32\thread_primitives.hpp(314): warning C4793: 'boost::detail::win32::interlocked_bit_test_and_set' : function compiled as native :
1> Found an intrinsic not supported in managed code
1> Creating library C:\Users\Bombshell\documents\visual studio 2010\Projects\IndigoEngine\Debug\IndigoFramework.lib and object C:\Users\Bombshell\documents\visual studio 2010\Projects\IndigoEngine\Debug\IndigoFramework.exp
1>Indigo.obj : warning LNK4248: unresolved typeref token (01000023) for 'boost.detail.win32._SECURITY_ATTRIBUTES'; image may not run
1> IndigoFramework.vcxproj -> C:\Users\Bombshell\documents\visual studio 2010\Projects\IndigoEngine\Debug\IndigoFramework.dll
2>------ Build started: Project: IndigoEngine, Configuration: Debug Win32 ------
2> MProg.cpp
2> LINK : C:\Users\Bombshell\documents\visual studio 2010\Projects\IndigoEngine\Debug\IndigoEngine.exe not found or not built by the last incremental link; performing full link
2> IndigoEngine.vcxproj -> C:\Users\Bombshell\documents\visual studio 2010\Projects\IndigoEngine\Debug\IndigoEngine.exe========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========[/code]

And heres what I get on Debug
[code]'IndigoEngine.exe': Loaded 'C:\Users\Bombshell\Documents\Visual Studio 2010\Projects\IndigoEngine\Debug\IndigoEngine.exe', Symbols loaded.
'IndigoEngine.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'IndigoEngine.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'IndigoEngine.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'IndigoEngine.exe': Loaded 'C:\Users\Bombshell\Documents\Visual Studio 2010\Projects\IndigoEngine\Debug\IndigoFramework.dll', Symbols loaded.
'IndigoEngine.exe': Loaded 'C:\Windows\SysWOW64\mscoree.dll', Cannot find or open the PDB file
'IndigoEngine.exe': Unloaded 'C:\Windows\SysWOW64\mscoree.dll'
'IndigoEngine.exe': Unloaded 'C:\Users\Bombshell\Documents\Visual Studio 2010\Projects\IndigoEngine\Debug\IndigoFramework.dll'
The program '[4528] IndigoEngine.exe: Native' has exited with code -1073741701 (0xc000007b).[/code]
0

Share this post


Link to post
Share on other sites
[quote name='bombshell93' timestamp='1311077797' post='4837341']
1>c:\program files (x86)\boost\boost_1_47\boost\thread\win32\basic_timed_mutex.hpp(160): warning C4793: 'boost::detail::basic_timed_mutex::unlock' : function compiled as native :
1> Found an intrinsic not supported in managed code
1>c:\program files (x86)\boost\boost_1_47\boost\thread\win32\thread_primitives.hpp(314): warning C4793: 'boost::detail::win32::interlocked_bit_test_and_set' : function compiled as native :
1> Found an intrinsic not supported in managed code
[/quote]

Are you using C++/CLI? It looks like it is complaining about boost's use of non-managed code along with managed code.
0

Share this post


Link to post
Share on other sites
I'm not using C++/CLI... at least not to my knowledge
Intellisence still works and it was to my understanding it didn't work with projects that included / used C++/CLI (I've come across VS 2010 commenting on it in the bottom right corner when looking at certain code examples)
0

Share this post


Link to post
Share on other sites
[quote name='bombshell93' timestamp='1311079666' post='4837347']
I'm not using C++/CLI... at least not to my knowledge
Intellisence still works and it was to my understanding it didn't work with projects that included / used C++/CLI (I've come across VS 2010 commenting on it in the bottom right corner when looking at certain code examples)
[/quote]

I just tried creating a test C++/CLI project in VC2010 and included <boost/thread.hpp> and got the exact same error you did.

[quote]

1>------ Build started: Project: CLRTest, Configuration: Debug Win32 ------
1>Build started 7/19/2011 8:51:27 AM.
1>InitializeBuildStatus:
1> Creating "E:\Programming\CLRTest\_Obj\Win32\Debug\CLRTest\CLRTest.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1> stdafx.cpp
1> AssemblyInfo.cpp
1> CLRTest.cpp
1> Generating Code...
[b]1>e:\programming\boost\boost\thread\win32\basic_timed_mutex.hpp(160): warning C4793: 'boost::detail::basic_timed_mutex::unlock' : function compiled as native :
1> Found an intrinsic not supported in managed code
1>e:\programming\boost\boost\thread\win32\thread_primitives.hpp(314): warning C4793: 'boost::detail::win32::interlocked_bit_test_and_set' : function compiled as native :
1> Found an intrinsic not supported in managed code[/b]
1> .NETFramework,Version=v4.0.AssemblyAttributes.cpp
1>C:\Users\Rob Yull\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.cpp : fatal error C1083: Cannot open compiler generated file: 'E:\Programming\CLRTest\_Obj\Win32\Debug\CLRTest\C:\Users\Rob Yull\AppData\Local\Temp\.NETFramework,Version=v4.0.AssemblyAttributes.obj': Invalid argument
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:04.30
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[/quote]

It looks like your IndigoFramework project is C++/CLI.

You are correct about Intellisense and C++/CLI, but I'm guessing only one of the projects may be incorrectly setup this way.
1

Share this post


Link to post
Share on other sites
[quote name='ApochPiQ' timestamp='1311058917' post='4837239']
The correct syntax for #include is #include <path/to/file.h> not <path\to\file.h>.
[/quote]

VC 2010 Pro (not sure about express) actually has the option to auto-complete includes either with either slash (defaults to \ )

[attachment=4225:VS2010Slash.png]


1

Share this post


Link to post
Share on other sites
do you think they could be causing the problem of the program doing nothing?
if so what would I be looking for that indicates CLI?
I'm unfamiliar with the language, but taking a quick google it seems similar to C# (with that being the coding language I'm most familiar with its plausible I used similar code in C++ by mistake)
0

Share this post


Link to post
Share on other sites
[quote name='bombshell93' timestamp='1311083618' post='4837378']
do you think they could be causing the problem of the program doing nothing?
if so what would I be looking for that indicates CLI?
I'm unfamiliar with the language, but taking a quick google it seems similar to C# (with that being the coding language I'm most familiar with its plausible I used similar code in C++ by mistake)
[/quote]

It's basically a modified version of C++ that uses the .Net Common Language Runtime. Check your project files (Right click on the Project and choose [b]Properties[/b]). Check under [b]General [/b]-> C[b]ommon Language Runtime Support [/b]and see if it says [b]Common Language Runtime Support /clr[/b] (see picture below)

[attachment=4226:VS2010CLR.png]


If it is there, try changing it to [b]No Common Language Runtime Support[/b].
2

Share this post


Link to post
Share on other sites
Good to hear.

Be sure to check this under the Release settings too, as Release may still be set to CLR enabled.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0