Code::Blocks: Code Blocks IDE does not read backslashes from a .vcsproj file - c++

I am importing a C++ project that was created in Visual Studio on a Windows machine, into my Code::Blocks IDE using Linux Ubuntu 13.10. After importing the .sln file, Code::Blocks was able to detect the files but it could not read them due to the \'s in the .vcsproj file (which was created in VS on the Windows machine).
After replacing all of the \'s in the .vcsproj with /'s, everything works fine, but was this the correct solution? This is an open source project, so I wonder if there is a platform-independent solution, or should we expect each user to build the project themselves? Should the .vcsproj or .sln file be excluded from the repository?

Welcome to the world of cross platform development!
Consider using something like Cmake or Premake to generate the project files for the platform you are developing on.
This way any developer can take the CMake\Premake script and generate vcxproj files if they are on Windows or Codeblocks proj files for Linux/Windows, or even Gnu Makefiles if they are so inclined.

Related

Visual Studio 2017 Linux Makefile Project won't build because of chained prefix

I have a Linux project witch I developed in vim and now I'd like to go on developing it in Visual Studio with IntelliSense etc.
It's a Makefile project so I need to build it on the Linux machine.
I already created the project and created the connection and it works but I can't build because I am building with a prefix script so I open a new interactive shell with something like this
set -i
. "/tools/dist/xxxx-2010.0"/etc/profile
I don't think that visual studio can handle such thing.
Is there a way to do it?
I am calling my startprefix script with an alias then it starts the interactive shell and then I enter my make commands for usual but in visual studio it won't build it stops at t he very beginning after executing the first command (which is the startprefix alias)
And another thing is that I don't see any project files in my solution I unloaded and loaded the project but it won't get me the source files. Am I doing something wrong?
The Visual Studio C++ for Linux add-in supports MSBuild, makefile and CMake projects. If you already have the makefile then create a new Linux makefile project in VS, add in the source files and hit F5 to build.
Trying to read between the lines of your question:
C++ for Linux is optional and must be installed
thru the VS installer.
Everything, i.e editing, building, debugging, is run in VS from the
Windows host.
The source resides on the Windows host (although you can do things with shared drives if needed).
The Linux remote is just that, remote.
You might need to interact with the Linux remote to debug an
X-Windows based GUI application but console applications can be
debugged entirely on the Windows host.
If you have other commands that you need to run before and/or after the makefile then you can set these up in the VS project settings. Likewise and parameters you need to pass to make.

compiling c++ projects with sln file in ubuntu

This may be a stupid question, but I've been trying to compile a larger project that was originally associated with visual studio in Ubuntu. I settled on cmake to do this, but it needs a cmakelist file. As I don't want to set this up manually, since I'll have to port several thousand pages like this, is there a way to have cmake read the sln files visual studio generates?
Any way that would let me compile the projects automatically on Ubuntu would be great.

How to use Chromium Embedded Framework with Visual Studio 2017 (C++)?

I would like to use CEF with VS 2017 using C++ (not C#, so CEFSharp won't work here). I can't quite understand how to do this. From what I have read, it seems like I need to build the source into a .sln file and then modify the existing code, however their site also says there are binaries available to download, which is confusing me.
How do I program in C++ using CEF and VS 2017?
Download CEF3 binaries, and extract archive to folder
Download and install CMake
Open CMake, and set:
Where is the source code: folder
Where to build the binaries: folder/build
Press Configure
Press Generate
Open solution in folder/build/cef.sln
Build Debug/Release
Reference in your project folder/build/libcef_dll_wrapper/[Debug|Release]/libcef_dll_wrapper.lib
Copy files to your bin folder:
folder/[Debug|Release]
folder/Resources

C++ OpenGL Project Setup using GLEW, assimp, SDL2 and CMake with CodeBlocks

I've done a whole tutorial about making a 3D Rendering Engine in OpenGL with Java and lwjgl and the guy who made the tutorial also wrote the engine in C++
To increase my knowledge about programming I wanted to take a look at the C++ version too. Also I believe (and I might be totally wrong) that I'm actually able to do a lot more with C++ than with java. The main problem I have is that I cannot get the engine running despite the included instructions and I would really appreciate if someone can help me out.
this is the engine i want to setup: https://github.com/BennyQBD/3DEngineCpp
I want to use CodeBlocks for this project since it was recommended and unlike Visual Studio it is free.. I also already downloaded glew, assimp and sdl and I installed CMake which are needed for this to run. Now I have to put that together according to this instruction here:
###Windows/MinGW###
- Make sure CMake is both installed and added to the system PATH.
- Open a Terminal and run:
```Shell
# install dependencies
# Install GLEW in %PROGRAMFILES%/GLEW or SET %GLEW_ROOT_DIR% to where GLEW is on your machine (Example: D:\PATH_TO_GLEW)
# Install SDL2 in %PROGRAMFILES%/SDL2 or SET %SDL2_ROOT_DIR% to where SDL2 is on your machine (Example: D:\PATH_TO_SDL2)
# Install ASSIMP in %PROGRAMFILES%/ASSIMP or SET %ASSIMP_ROOT_DIR% to where ASSIMP is on your machine (Example: D:\PATH_TO_ASSIMP)
cd build
# REPLACE "Visual Studio 12" with your preferred build toolchain (Maybe you want "Codeblocks - MinGW Makefiles")
# BTW VS 10 is VS 2010, VS 11 is VS 2012 and VS 12 is VS 2013, BLAME MicroSoft for the naming! LOL!
cmake -G "Visual Studio 12" ../
# open the generated SLN file (or cbp file if using CodeBlocks) and build!
```
- Copy the DLLs in /lib/_bin/ to /build/Debug/ and /build/Release/
- In Visual Studio, set the Startup project to 3DEngineCpp
- Move the res folder into the build folder
- Run
Major problem is, since I've only done java coding in eclipse I'm a bit confused..
What does he mean by "Open a Terminal and run: '''Shell" ?? and how am I supposed to install glew, sdl2 and assimp? what's cd build? and why do I need CMake, it isn't really mentioned what it does..?
Maybe someone can elaborate (step by step if possible) what I need to do in order to get this running, thanks a lot!
No guarantees my steps will work flawlessly as external dependencies in C++ is still very painful to deal with for me, but I'll give you some leads and hope you make some progress. Also, I've never used Code::Blocks, so I'm not sure if Visual Studio projects are compatible with it. This is the only way I know how to do things on Windows.
First, you'll need to install CMake. CMake is a utility that generates project files so that the project can be easily compiled on certain platforms. It generates Visual Studio project files on Windows, which will allow you to open the project in Visual Studio, and compile them from there.
In order to build the project, you'll have to sort out its dependencies first.
GLEW:
Download GLEW's sources and extract everything. It comes with Visual Studio project files
Open up Visual Studio with Administrator permissions
Open up GLEW's project
Build everything
Run the install "project" to get Visual Studio to install GLEW
Assimp:
Download Assimp's source from GitHub
Extract the project root directory somewhere. The root directory is the directory where CMakeLists.txt is in
Open CMake's GUI utility
Click Browse Source, and select that directory
Select an output directory by clicking Browse Build
Click Configure, when that's done click Generate. This will generate a Visual Studio project file for you
Open project with Visual Studio, build everything. Run install like you did before to install Assimp
SDL2: SDL's sources come with Visual Studio project files, so you can repeat the steps for GLEW to install it.
Now you can finally start attempting to get the engine to work. No guarantees that it'll work, but I'd try the same thing I suggested for Assimp as they're both CMake projects. Once the project files are generated, you can open it up in Visual Studio. Except this time, you won't really be installing it. You can modify the sources and run it like you would any other C++ project.

use msbuild to compile a vcxproj created by vs2010 on a computer without vs

I have created a large Visual C++ 10.0 project which builds nicely within the visual studio ide as well as within the "special" Visual Studio Command Prompt using msbuild with a vcxproj file.
However this project needs to be compiled by computers that do not have the vs ide, but only have the msbuild tool and the vc++ 10.0 runtime files.
The problem is that the vcxproj (created by the vs ide) file contains references to files such as Microsoft.Cpp.Default.props and Microsoft.Cpp.targets which clearly won't be available in a computer without visual studio.
Since all the compile and link command line options are available and fixed (no changes will be necessary), how is it possible to create a new vcxproj file to implement the compiling and linking of the project using these options?
I was finally able to make some tests on a "clean" computer. These are the results:
First, I installed .NET Framework 4.0 from http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=17718. Along with it, MSBuild 4.0 was also installed automatically. When I tried to compile I got the following error:
error MSB4019: The imported project "H:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
which means that extra files are needed to compile the vcxproj and these files were missing. Note that simple project files written by hand (and not by the VS IDE) are expected to compile without problems since they contain no references to theses files (I did not test it for certain).
Next, I installed Windows SDK 7.1 from http://www.microsoft.com/download/en/details.aspx?id=8442. The error about missing files disappeared, but I got a new one. This new error (along with the way I overcomed it) is described in http://www.damirscorner.com/CommentView,guid,9121bd6b-876c-4051-8487-de1b95a7e919.aspx.
Doing the above successfully allowed me build my vcxproj file on a computer without vs2010.
I think that the files that you mention are not part of Visual Studio. They are part of MSbuild.