Configure SFML inside project directory so you won't have to configure it again if you move your project to another computer? - sfml

So I've made this project using SFML and VS. Now when I copy my project to a usb and try running it on a different computer, I have to reconfigure SFML for the project in that computer. This is because the SFML bin and library folders were stored in different locations when making the projects. Is there a way to put the SFML bin and library folders inside the project directory so that the solution would automatically recognize them even after moving the project directory as a whole?
Thanks!

Related

Synchronising SFML with C++ Project on GitHub

At the moment I'm using Visual Studio C++ with SFML Graphics, Windows, and System libraries (plus opengl / relevant dependencies).
I'm attempting to sync this project with a group of us who all need to work on it (via GitHub) but it seems (at first glance, at least) like the project file will need different 'include' paths for each person wanting to run the project on their machine. Could get tedious if we're all constantly syncing different settings.
TL;DR: Is there a way to install SFML to the project directory so that the project can be opened and run on any machine without needing to configure the project settings?
As a variant, I'm storing only source in the repository, without project preferences. It also helps in different platforms. I use windows+visual stuido and linux+eclipse.
Or you really can put "include", "lib" folders of SFML into your projects directory like other usual files.

Project cannot load image assets while running from visual studio IDE

I am porting an old visual studio C++ project. I have a data folder in the project directory that contains all the image assets. The project is build using an external make file.
My problem is, the project cannot load the asset files while running the executable from the VS IDE during debugging. However, if I execute the exe from bin folder, it can load the assets.I am assuming there are some kind of environment issue in the project, but could not figured it out.
Any clue?
My guess is that the program tries to access the assets using a relative path like ..\data\some.data. It works when you run it manually from the bin folder, because the current directory is set to the bin folder itself (the folder from where an application was launched) by default.
But when running projects from the Visual Studio IDE, parameters set under "Project properties > Debugging" tab apply instead. There is an option "Working directory", which defaults to $(ProjectDir), i.e. the folder where the project file resides.
Try changing that to the bin folder, or, if the resulting .exe file is placed directly there, easily just to the $(OutDir) variable.

Multiple c++ Eclipse Helios Projects with Source in a Single Directory

I'm working on a legacy codebase that has all the code for multiple c++ executables and static libraries in a single folder.
I'm wondering if its possible to create projects in Eclipse Helios for each of these without moving the corresponding source to its own directory?
You can create Eclipse projects anywhere, then in each of the project do:
RMB on project->New->Folder, expand Advanced>>, select Link to alternate location (Linked Folder) and browse to the directory where your shared sources are located.
Or you can have one project with multiple targets instead.

Can I point my project to a locally stored glut.dll?

I have a c++ opengl project that uses glut. It runs fine in my computer, but I need to be able to run it on a lab computer. When I try to do this, it tells me the glut.dll is not installed, but I do not have the privileges to put the file in the proper system folder on the computer. Is there anyway I can store the file with my game, and point to it in my project?
Thanks
Add required dlls to your project and set property to copy local.
Executable looks for dlls in folders listed in $PATH and in the folder with exe file.

Setup cocos2d-x application through visual studio 2010 project template

I'm trying to setup an application on Windows 7 using Cocos2D-x.
I followed this tutorial.
I did the following:
Built the library running Build-win32.bat script. Works.
Installed VS2010 project template. Works.
Run successfully all test programs.
Created a new cocos2D-x project through the installed template. Works
When I compile the Hello World application I have the follwing errors:
error C1083: impossible to open inclusion file 'CCstdC.h' No such file or directory
error C1083: impossible to open inclusion file 'cocos2d.h' No such file or directory
It's a wrong include path.
I could fix it by manually modifying include path but since I'm creating project through the template I-d like to solve this, possibly not having to modify paths manually for each new project I'll create.
Did anyone ever had the same issue?Do you know how to fix this?
Well, I setup cocos2dx projects like this:
create an empty win32 app in VS
open the folder contains your .sln file (your solution folder)
open the cocos2dx package (i.e. cocos2d-1.0.1-x-0.12.0.zip) with 7z or something
drag cocos2dx, and optionally CocosDenshion, Box2D, etc. to your solution folder
add cocos2dx project (cocos2dx\proj.win32\cocos2d-win32.vcxproj) into your solution
go to your project's properties, select C/C++->General, add the following entries to your Additional Include Directories option:
..\cocos2dx; ..\cocos2dx\include; ..\cocos2dx\platform; ..\cocos2dx\platform\win32; ..\cocos2dx\platform\third_party\win32\OGLES
and ..\CocosDenshion\include if you're using the SimpleAudioEngine
in the Linker->Input->Additional Dependencies option, add libcocos2d.lib, and libCocosDenshion.lib if you use the audio engine; in the Linker->General->Additional Library Directories option, add $(OutDir)
go to the Configuration Properties->General->Output Directory option, set it to $(SolutionDir)\build\
open the project property for cocos2d library, go to the Configuration Properties->General->Output Directory, set it to $(SolutionDir)\build\, also do that to the rest of the libraries you included.
All set, you're ready to go.
Unfortunately that template is not that useful. I believe that in a previous version of cocos2d-x (the one that tutorial is based on) the paths were absolute, and referenced the cocos2dx, cocosdenshion projects directly.
Now, as they're relative (..\..\cocos2dx), and they are not copied to the solution directory when a project is created, it just doesn't work.
You could obviously fix the paths (as you suggested) but my suggestion is: copy the HelloWorld project and use it as a template. The solution structure is much better than the one in the template as it's already prepared for iOS, win32 and Android. Trust me, can't get any easier than that.
Now, here's the catch: if you copy the HelloWorld project to a sibling folder, you're done, as all the references are already setup. If you want to copy to other place you'll have to also copy cocos2dx, cocosdenshion along, leaving the target structure like:
target_path\cocos2dx
target_path\cocosdenshion
target_path\Copy_of_Hello_World
I solved opening the cocos2dx library solution and add to it a new project through VS template wizard.