• 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
Cromulent

Linking libraries in VS 2012 (Express)

5 posts in this topic

I'm a Unix programmer. I've never really programmed on Windows before and as such Visual Studio is new beast for me. I'm finding some simple things pretty hard to do when compared to how easy it is on Unix. It seems that in Visual Studio you need to set the correct search paths by going to Project > Project Properties and then setting the relevant settings in VC++ Directories but even though I have set the correct directories for searching the linker can't find my compiled versions of Boost 1.54 and gives the following error:

 

Error 1 error LNK1104: cannot open file 'libboost_program_options-vc110-mt-gd-1_54.lib'
 
yet when I go and look in my Boost lib directory I see boost_program_options-vc110-mt-gd-1_54.lib and it should be discoverable. VC++ certainly finds the header files correctly it is just the DLLs and the LIB files that it can't find. Anyone got any suggestions as to what I am doing wrong here? Is there another setting I am missing at all?
0

Share this post


Link to post
Share on other sites

I'm almost in the same situation as you, coming from a Unix environment to develop games in Windows. If you go to Project > Project Properties > Linker >  Input > Additional libraries, you can specifiy more explicitly which libraries your project needs. That is how I'm getting the linker to properly work. Also you will need to put the directory where those libraries are, either in Linker > Additional library directories or in VC++ Directories > Directories for library search

Hope it helps !

Edited by Adyrhan
2

Share this post


Link to post
Share on other sites

I'm almost in the same situation as you, coming from a Unix environment to develop games in Windows. If you go to Project > Project Properties > Linker >  Input > Additional libraries, you can specifiy more explicitly which libraries your project needs. That is how I'm getting the linker to properly work. Also you will need to put the directory where those libraries are, either in Linker > Additional library directories or in VC++ Directories > Directories for library search

Hope it helps !

 

Thanks for the help. I've got my stuff linking statically but the dynamic linking is still eluding me at the moment. I'll have another play around with it when I have some more free time.

0

Share this post


Link to post
Share on other sites

There's a few things that you might be doing wrong, not sure exactly which one is causing you issues...

 

First is that setting directories by going to Project > Project properties probably isn't doing what you think its doing.  That will set the directories for only that single project.  If you want to set it for all your projects you have to go to the Propery Manager window.  There you'll find some files, the one you're looking for is Microsoft.Cpp.Win32.user (there's also a Microsoft.Cpp.Win64.user for 64 bit).  Right click on it, go to properties, and any properties you change in there will become the 'default' for all projects.

 

When linking to boost, you don't need to specify the libraries individually.  The header files automatically link in the appropriate .lib files as needed (probably through judicious of #pragma's in the headers I imagine).  So as long as your lib dir is set correctly you should be fine.

 

In my situation (using VS2012 express as well) in Microsoft.Cpp.Win32.user I added 'D:\Programming\boost\libx86' to my Library directory which is where the 32 bit libs sit on my system, and that was all that was needed.

 

Not sure if that solves your problem, but perhaps it'll help.

1

Share this post


Link to post
Share on other sites
We use the Microsoft C++ compiler in much the same way as GCC on Windows. The following is a few examples from our Makefiles if it helps (personally I find the documentation for commandline MSVC usage to be really lacking!).


.cpp unit to .obj
cl.exe /nologo /EHsc -c -I..\..\..\import\msvc\include -I..\..\ $(CXXFLAGS) /Fo$@ $<

relevant .obj files to static lib. Here we are also including the GLEW32s.lib into our static lib so it doesnt need to be linked in during the final step.
lib.exe /OUT:..\..\lib\mutiny.lib $(OBJ) ..\..\import\msvc\lib\GLEW32s.lib

Link other .obj files to final .exe and then link against required libs and our static lib we generated in the step above
link.exe /SUBSYSTEM:WINDOWS /OUT:$(BIN) $(OBJ) /LIBPATH:..\..\..\import\msvc\lib /LIBPATH:..\..\..\lib OpenGL32.lib GLU32.lib SDLmain.lib SDL.lib mutiny.lib $(LDFLAGS)

The main thing to notice is the /LIBPATH parameters are similar to -L on gcc. Also note that there is no need for -l, you just specify the name of the lib (including the .lib suffix). Edited by Karsten_
2

Share this post


Link to post
Share on other sites

We use the Microsoft C++ compiler in much the same way as GCC on Windows. The following is a few examples from our Makefiles if it helps (personally I find the documentation for commandline MSVC usage to be really lacking!).


.cpp unit to .obj

cl.exe /nologo /EHsc -c -I..\..\..\import\msvc\include -I..\..\ $(CXXFLAGS) /Fo$@ $<
relevant .obj files to static lib. Here we are also including the GLEW32s.lib into our static lib so it doesnt need to be linked in during the final step.
lib.exe /OUT:..\..\lib\mutiny.lib $(OBJ) ..\..\import\msvc\lib\GLEW32s.lib
Link other .obj files to final .exe and then link against required libs and our static lib we generated in the step above
link.exe /SUBSYSTEM:WINDOWS /OUT:$(BIN) $(OBJ) /LIBPATH:..\..\..\import\msvc\lib /LIBPATH:..\..\..\lib OpenGL32.lib GLU32.lib SDLmain.lib SDL.lib mutiny.lib $(LDFLAGS)
The main thing to notice is the /LIBPATH parameters are similar to -L on gcc. Also note that there is no need for -l, you just specify the name of the lib (including the .lib suffix).

 

 

Thank you for that. I much prefer using the command line options so that was incredibly useful.

 

I think I've pretty much got to grips with linking on Windows. Thanks for everyone's help.

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