9

I have made a sudoku solver using SDL (for GUI) on VCpp 2010 IDE.

The program compiles without errors and runs fine. However, i cannot pass the compiled executable on to some people because they don't have msvc dll on their pc.

I thought i could use devc++ that compiles with GCC but this IDE is kinda buggy and just won't let me include some header files.I also have some problems setting up SDL expansions.

So, is there a way to change VisualStudio compiler to GCC?

I really need to stay with VS because it is easy to use and there is a lot of online support.

genpfault
  • 51,148
  • 11
  • 85
  • 139
Giwrgos Tsopanoglou
  • 1,165
  • 2
  • 8
  • 15
  • they should use Visual Studio Express edition it is free, Or they need to at least use the Windows SDK if they insist on using GCC compiler. If you can try to use QT instead of using Windows specific files it may help too. – Mahmoud Fayez Feb 19 '13 at 13:32
  • Oh i'm sorry, i meant that i cannot pass on the compiled executable file. Let me fix it on the post. – Giwrgos Tsopanoglou Feb 19 '13 at 13:34
  • Why can't you just just ship Visual Studio redistributables with your application? – Bartek Banachewicz Feb 19 '13 at 13:40
  • i don't know...because it is just a small sudoku solver application? I can't force the user to install visual c++ redistributable for a small app...i suppose... – Giwrgos Tsopanoglou Feb 19 '13 at 13:43
  • 1
    Since GCC is a much better compiler (more C compliancy) than Visual Stupid, if microsoft did that, then they'd never make any money. If you want to use GCC consider using cygwin, but it's mutually exclusive to microsoft's libraries. – Owl Apr 05 '17 at 10:38

4 Answers4

8

Short answer: no, you cannot change cl.exe (MS cc compiler) with gcc. Or mingw. (You can with a compatible compiler, like Intel C compiler)

Long answer: you don't need to to that. Use the static linked runtime library, and you don't have a dependency ms dlls anymore (see this answer: How do I make a fully statically linked .exe with Visual Studio Express 2005?)

Or redistribute the VC++ runtime with your app. It's free (http://www.microsoft.com/en-us/download/details.aspx?id=26999)

Community
  • 1
  • 1
Lorenzo Dematté
  • 7,638
  • 3
  • 37
  • 77
  • Thanks a lot sir, i will look into both of these options – Giwrgos Tsopanoglou Feb 19 '13 at 13:44
  • I do believe you can use the GCC compiler in VS check this out http://stackoverflow.com/questions/530831/switching-3rd-party-compilers-in-devenv-from-the-command-line also I managed to use VC6 compiler with VS2005 successfully. – Mahmoud Fayez Feb 19 '13 at 19:20
3

You don't need to change compiler - they need to download the Visual Studio 2010 redistributable: http://www.microsoft.com/en-gb/download/details.aspx?id=5555

Vicky
  • 12,934
  • 4
  • 46
  • 54
1

In short: no. You can't simply use the GCC compiler in Visual Studio.

The long version: you can use a Makefile project to run GCC, but then you lose some of the benefits of using Visual Studio.

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
1

I'm not sure when this became a feature in Visual Studio (probably wasn't one in 2013), but it is now possible to change the "Platform Toolset" - and thus the compiler - used by Visual Studio to other compilers like Clang/LLVM and GCC. I have been happily using Clang with VS2017 ever since the MSVC++ compiler bugged up with some 3rd party libraries.

Microsoft made a blog post on the installation instructions and how to switch.

Ð..
  • 298
  • 5
  • 18
  • 1
    Neither your answer, nor that blog post actually specify the exact steps needed to change the compiler toolchain. A proper answer would be: Click on this option, navigate to that tab, etc. – Tryer Mar 08 '22 at 19:40