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

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.

Related

Build a Visual Studio solution on a target macOS machine remotely

We have a large Visual Studio C++ solution that builds on a Windows machine.
We want to build this application on a macOS system and I’ve read that it’s possible by building/deploying remotely to a target macOS machine from a Windows Visual Studio environment.
Can we do that if we have a Visual studio solution with MSBuild projects? Or it is mandatory to have CMake projects to do that? At least for Linux remote building it seems that CMake isn't mandatory.
We also need to build our application in a CI/CD pipeline so we also need to build from a command line, from what I understood I also read that it should be possible but I don't know how maintainable it is.
For anyone interested, it is possible to remote build on Linux/macOS a MSBuild project without converting it to a CMake project.
Follow this topic for more info.

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.

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

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.

Visual Studio Remote Compile and Run

I am trying to figure out if it is possible to use Visual Studio 2012 as a full linux development suite. I know this is not the regular question here but work with me. What i have so far is the ability to use Visual Studio as a text editor to edit inside a virtual machine of Linux running on my computer.
The way that I have done this is to set up a permanent ssh portal that acts as as a hard drive in my windows. I have done this using a program called WebDrive:
So that is cool, it means I have the ability to fully view my Linux c++ project from Visual Studio. This provides all of the cool c++ editing things that i like about visual studio.
So where to from here?
Basically what I have now is a heavy glorified text editor.
What I would like to do is get the whole 'shabam' working.
I would like to be able to compile and run code from visual studio remotely on a server address. Is it possible? The code is built with cmake and g++ compiler?
Your best bet would be http://www.wingdb.com/. WinGDB allows working within VS studio and compiling on a remote Linux machine directly. Full step through debugging within VS is supported. For DLLs you can attach to remote process running on your Linux build server within VS. Great solution for working within the kinder VS dev environment but still having the full power of the Linux dev stack. Auto-generation of makefiles via VS project files too. Hope this helps.

Running .exe crashes while running from vs2010 is successful

I've developed a c++ program using Visual Studio 2010 and it works perfectly, but while trying to start it with the .exe file created in the debug folder instead of inside the VS2010, it crashes. It updates my DB once, but then it crashes unexpectly..
Does anyone know why? What should I do to avoid it in order to be able to run my application in another PC. It uses the winsock library and mysql API for C, so I'm wondering if I need to configure something else that the VS2010 doesn't do by its own while linking or so.
Did you depend on the current directory? We had a case once that turned up where that was the problem.
You should set the build configuration to Release, and use the .exe from the Release folder, once you rebuild the application. The executable from the Debug folder is (in principle) only used by Visual Studio internally, and it would therefore make no sense to redistribute it.
Note however, that in order to run any application created with visual C++, the user must install the visual C++ redistributable package, so make sure that the user has got that installed.