Visual C++ in CLion for OpenCL - visual-c++

I have a program for Visual C++ that I would like to further develop on CLion. I have managed to make it compile fine, however code insights are still showing errors on a bunch of things. Foremost among them is certain type definitions not resolving correctly. I have traced them through to the original definitions from the AMD OpenCL SDK, however those definitions have errors:
As far as I can tell, the problem with those is that it thinks it's defining the __int8 types. I believe that __int8 and the rest are supposed to be defined in the Microsoft Visual Studio stuff, but I can't figure out how to link that into the project using CMake or CLion.
I'm using CLion 2017.2.3 and have Microsoft Visual Studio 2017 Community installed.
I suspect that I'm not understanding something with how Microsoft Visual Studio integration would work, but please let me know if there is any further useful information that I could provide.
EDIT:
I've done some further digging, and it looks like I must be missing something fairly major. The __int8 style types are apparently Windows only, but even size_t and FILE aren't defined according to the code insights.

That's a CLion bug. We are currently on it and it will be addressed in 2017.3 likely. Follow the updates here: https://youtrack.jetbrains.com/issue/CPP-9224

Related

Migrating from Visual studio 2008 to 2015

I have code for a software written in C++ with MFC in Visual Studio 2005. Now I need to migrate it to Visual Studio 2015. How can I do it and what are the challenges to be countered?
Like said in comments, open your solution, it will be converted. The issues I had when doing so:
Only blocking issue for compilation I had was to change the Unicode handling option in project options because one of the related options disapeared/changed its values. There is a report after the conversion is complete, read it!
All possible issues with such a huge gap in compilator versions are still possible then. So be carefull of the warnings (activate them if not done)
Running some code analysis may be a good idea to detect deprecated syntax/methods, I had some unexpected behaviour on old Microsoft methods that were a bit too permissive before (clearly it was my fault but for some reason the old compilator was kind with some of my mistakes).

Can someone tell me how to Configure Visual C++ 2015 with CPLEX?

I tried tutorial steps for Visual 2010, the linking didn't work or the console doesn't respond to build or run. I tried for other options to configure, which also didn't work as well.
You may vote for a request for enhancement at https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=85231
regards
Alex Fleischer
It can be a bit complicated...
First, I think you should start reading the following tutorial. I find it quite straightforward as adapted to any CPLEX version. You must only notice that using a CPLEX version 12.X translates into the usage of its library: cplex12X.lib, the tutorial referring to CPLEX v12.61.
Then, you must install Visual Studio 2012, or even 2010, as they will install another Platform Toolset, v110 for VS2012 or v100 for VS2010. This is required since CPLEX comes with libraries for the 2010, 2012 and 2013 only, there is none so far for VS2015.
The configuration might work even if you have already VS2015 installed on your computer but I strongly advise you to begin installing the older version first, then the VS2015 to ensure the latter will recognize the older Platform Toolset and give you the option under: View\Property Pages\Configuration Properties\General\Platform Toolset of choosing the v110 for your project.
Be aware that using only VS2015 will prompt you a bunch of LNK2038 mismatch detected for '_msc_ver' errors letting you know that you're using version 1800 whereas you're linking libraries compiled on 1600 or 1700 versions.
One is glad to be of service
As of CPLEX 12.6.3, VS2015 is not supported (see the detailed system requirements here). It is possible to use VS2015 with a VS2013 project (e.g., see here), but this is probably not what you are looking for.

Visual Studio 2015 code map external dependencies

I have a native Win32 project written in C and wanted to visualize my project's dependencies from external DLLs. Visual Studio 2012 and 2013 let me generate a code map which would not only show all my functions and their dependencies from each other using arrows, but also all external libraries I used, which functions I used from those and which of my functions called which external functions etc..
Now, in Visual Studio 2015, this latter part seems to be missing. I can not get Visual Studio to show my project's external dependencies. I only see the internal ones. So here's my questions: Am I missing something? Do I have to activate a specific option in my project settings? Or are those external dependencies just not working in Visual Studio 2015 right now?
Steps to reproduce: Create a new non-empty Win32-project. In the Architecture menu, select Generate code map for solution. You will only see Win32Project1.exe in the middle of the screen. Meanwhile, Visual C# seems to be fine, showing the external dependencies. Create any C#-project for comparison.
Thank you for taking the time to post this! This looks like a regression, as in Visual Studio 2013 an Externals group with external dependencies is shown for C++.
I've logged a bug on Microsoft Connect so that you're able to track this externally:
https://connect.microsoft.com/VisualStudio/feedback/details/1694695
I have posted this workaround on the link that Bogdan Gavril listed and hope it helps someone. Unfortunately, it requires that you enable "CLR" support for your project. Basically, it appears that the VC++ linker and librarian is looking for a flag that indicates some type of managed code. At the very least, the code map is dependent on the mscorlib.dll reference injection. To make the CLR issue (which adds a lot of unnecessary bulk for native code) less a problem, simply create a new build configuration for use only when you need code maps with external dependencies. Make sure you've selected "CLR Support" on the general options of the project properties configuration page. Then, clean (probably not necessary) your solution and generate a code map. You will find the external dependencies as expected!
Zac

Migrating huge vc++ 6.0 project to vs2008 is possible?

Hi I'm newer to this technology. And I also migrate the MFC project to visual studio 2008 which is developed in visual c++ 6.0. If its possible are not? I already start my work on that and face some issues like initialization of variables and inclusion of header files. And some cases it shows the CString error and template error. Can any one suggest its possible are not?
Thanks in advance.
It is very much possible. It may need a day or two to fix all compiler and linker errors. You will need to fix compiler errors, Unicode stuff, MFC related errors, some deprecated stuff, stricter C++, and many other. But, it is doable, and worth doing.

Is it possible to compile MonoTouch projects with languages other than C#?

How would I go about using F# or J# for instance? I'm not sure what to get to grips with in the project's compiler settings.
Is there a sequence of command line steps I could follow to compile a MonoTouch project that I might interpret to replace the C# step but tell the other compiler to use the correct platform details etc?
Thank you.
Unfortunately, no. In the book "Developing C# Apps for iPhone and iPad using MonoTouch" you could see text (proof):
C# Is Currently the Only Language
Additionally, currently, the only .NET language available for writing MonoTouch applications is C#.
Nothing changed since that book publication.
Maxim Korobov is right, MonoDevelop only supports C# when writing for MonoTouch.
But this is not the whole truth: MonoDevelop also has (preliminary) support for Portable Library Projects (PLP). What this means is that you can create and compile PLP projects in Visual Studio (in any language Visual Studio supports for PLP projects), and then reference that library in MonoDevelop. Just have in mind that the PLP support is preliminary right now, and you might run into a few bumps on the way.

Resources