I am using Eclipse classic 4.2.1 (Juno) on my new mac to develop c/c++ programs. When I create a new project their is a choice of "Toolchains" to use: Cross GCC, MacOSX GCC and XL C/C++ Tool Chain.
Which one should I choose? I also use the mac terminal to run, make and vim the same code sometimes.
Maybe GCC is in common use if your app will run both in mac and windows
I had the same problem on my Mac OS X Luna(eclipse 8.4) but they are the same edition in general. Just goto the Help tab and click on "Install new software..." or anything similar to that. Type this in the big obvious add software link (pretty much just the test input at the top of the new opened window):
http://download.eclipse.org/tools/cdt/releases/juno
if you think juno can handle the newest version, type this in:
http://download.eclipse.org/tools/cdt/releases/8.4
Select every thing and proceed with the download.
You should now be able to create C/C++ projects and source files. I found this to be slightly buggy, like sometimes not include the standard C++ library, or std does not even exist but this should work if you install the correct version.
Related
I'm running Eclipse Oxygen.1 IDE for Java Developers 64 bit and I want to add the C/C++ language to it so I can write and compile code for my C Language class using only one IDE. When I go to install new software am I supposed to be installing the development tools for under the programming language tab or from the CDT tab or both? The tools under the Programming Language tab are version 9.3.2 and the tools under CDT tab are version 9.3.0. I'm confused as to which ones I'm supposed to install. Also if anyone could help me with the installation of MinGW. I'm running Windows 10 on a 64 bit operating system. And I'm not sure as to how I can get the latest version of MinGW for 64 bit OS. Any help is appreciated. Thanks!
You can have a combined IDE. I use one that combines the Eclipse SDK, including Java and a bunch of other things all in one. It's a bit clunky to do but can be done. Just go to the Help -> Install New Software... menu item and bring up the install dialog.
First install one of them, Java or C/C++. Then after launching it, select the "Luna - http://download.eclipse.org/releases/oxygen" item in the "Work with:" selector. Then find the other IDE components you would like in the list and install it.
I had Oxygen with java and pydev but experienced great difficulty adding cdt yesterday. I have some good reasons for keeping Oxygen instead of upgrading (older code and even OS compatibility since I'm still running High Sierra, again there are reasons for doing that). One key is finding the url given above download.eclipse.org/releases/oxygen . However, my install would still not work, for some unknown reason.
Here is the important part of my comment. Installs and updates can take forever if you don't uncheck the box on the install page which says this:
Contact all update sites during install to find required software
It is a known bug, that it is checked by default, but never to be fixed. https://bugs.eclipse.org/bugs/show_bug.cgi?id=340298
Also this bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=340298 was applied to cdt 9.3 if you get the pty error trying to compile.
I am using 64-bit Windows 7 PC and I want to develop C/C++ programs using Eclipse IDE.
I have tried DOSBox but it was not working for me. Also, I din't liked it as well.
I just want to use Eclipse for the same. I tried using CDT Plugin in Eclipse but that doesn't worked.
When I create a new C++ project, there are different Tool Chains available - Cross GCC, Microsoft Visual C++, MinGW GCC. I really don't know what exactly it is. I tried all but I am getting error and snapshot attached :-
Basically, it is not able to detect what iostream, stdio, cout is.
I tried different solutions available on other posts but none worked for me.
I don't know what to do with it. I know I am having problem due to 64-bit Windows but I want to fix this now. Please help!
You need to install MinGW, and then select the MinGW toolchain when selecting a new project.
Well I tried different tool chains on Eclipse IDE, but nothing worked.
Then I installed CodeBlocks IDE and plugins for the same as well.
Sic: Now, I am running C/C++ codes on Code Blocks perfectly.
You need to download MinGW and install the C++ compiler, don't forget to add the MinGW bin to the system variables under "path".
I recommend you using Visual Studio Code. If you do install Visual Studio Code, make sure to install Code Runner plugin to make running C++ projects easier.
Over the last couple of months I practiced console programming with Java just with the help of JDK and a text editor of my choice (Notepad++). And I loved the simplicity as a program can be compiled from the command line plainly using javac and run using java.
Now, I'm looking for similar compiler for C/C++, such that I create a .c or .cpp file and compile it in the command prompt, and all it does is create a "native" executable that can be run directly from the command prompt. Thus, without any need of bloated IDE. The reason I'm looking for such simple compiler is because it is going to be used by high-school students so I'm advised to avoid any IDE as far as possible, so students can practice all the concepts of C/C++ languages without having to go for IDE. Which compiler can I use that does this job? also, I must work across all the versions Windows starting from Windows XP.
You can download MinGW which is basically GCC for windows.
Then you can simply gcc somefile.c to create an executable.
http://gcc.gnu.org/gcc is a multi platform c/c++ compiler
Visual Studio includes the ability to compile from the command line. Like others just said you can look at cygwin/MinGW. I would recommended using Code::Blocks or Dev-C++. I know you stated you do not want an IDE, but I would highly suggest a minimalist IDE like the ones I just suggested, or at least SciTE or Notepad++ to get some basic syntax highlighting with the ability to configure build tools if you want as well.
MinGW GCC is definitely the way go, but I would recomend the nuwen.net distro (http://nuwen.net/mingw.html). Haven't used it in a while (yay unix!), but if IIRC, it comes with everything ready to go after unpacking. The official distribution is ... very hard to get working.
A very simple solution woul be cygwin and MinGW, which provides an environment very similar to a UNIX shell. Then you can use the make utilities to compile your program.
You should certainly consider using MinGW GCC, but not by download from the MiNGW web page, unless you are some kind of masochist. Get the one packaged by Twilight Dragon Media at http://tdm-gcc.tdragon.net.
I too use VisualStudio on Windows from the command prompt and use VS Make files as well. That way, I can smb mount my source code from a different machine and perform compiles on several different platforms at once (e.g. Windows, Linux, Solarsi).
This question already has answers here:
C++ cross-compiler from Windows to Linux [closed]
(5 answers)
Closed 9 years ago.
I need to write a relatively simple command line C++ program to be run a Linux environment. However, I would like to code as well as compile this on Windows. The reason I don't want to port it to Linux is because it requires MySQL interactions, and that would require some messy porting (IMO). It does not have to run on Windows; I just want to compile it on Windows because I want to use my preferred IDE's.
I've looked up on Cygwin for this task, but I haven't been able to find any documentation to do what I'm trying to do.
(I'm assuming "..don't want to port it to Linux.." is a typo for "..from Linux" and that you want the code to run in Linux as you said in your first sentence. This means cygwin or mingw would only be used as cross compilers and aren't going to be very useful.)
This program already builds and works (or mostly works) on Linux, right? No reason to change that. Use your preferred editor (probably the one in your IDE) to edit the files and then just run the build system (probably make) in a Linux system (possibly in a VM). Export the files using a samba share (especially easy from a VM) so you can edit and automatically save remotely.
Note that you seem fine ditching every other feature of your IDE (debugger and compiler, mainly) and just using the editor part anyway.
Ah, are you not starting from any existing project and want to write this from scratch? If so, porting doesn't make any sense. You want to write cross-platform code. (Cross-platform or "portable code" being related to, but different than, the act of "porting code" from one platform to another.)
The code is then both "Windows code" and "Linux code" at the same time, and you can use any compiler on Windows that can accept the code. Usually this happens by you sticking to standard libraries and other portable libraries, or writing shims for non-portable libraries to give them a portable interface, with the compiler supporting the C++ Standard.
You can use your preferred IDE's compiler and debugger in this case, and don't need cygwin or mingw. (Unless they're used by your preferred IDE. :P)
MinGW + MSYS
MinGW provides the functionality, MSYS gives a linux-like command prompt to use MinGW at.
When you get cygwin, install the C++ compiler/build tools, e.g., gcc, g++, make, autotools, etc. I think these are all you need, but I may be wrong. In any case the Cygwin installer is easy to use, and should bring in any dependencies.
Once you have these setup, you can configure your IDE to use g++ as your default compiler. You also need to set your library and include paths correctly such that they point to the relative /usr/include and /usr/lib directories under $CYGWIN (%CYGWIN%).
(Your other option is to use MinGW set of tools, in which case the IDE setup is more or less the same.)
Install cygwin (tutorial) and you'll have an EXE that gives you the command line prompt you're looking for.
The Cygwin installer should have an option for installing whatever compiler you're looking for (gcc?).
Here's another relevant tutorial.
Hello I am putting together a tool chain on my windows Box for Cross Platform C++ Development. I plan on using Boost.Build for building and Boost::Test for unit testing. I will be using Mercurial for my VCS because I can just throw the repo on my external HD and then pull it to either my windows or linux partition. The main thing standing in my way is editor compiler/debugger. Anyone have any suggestions?
With Boost.Build I can technically build with whatever compilers it supports easily. That means MSVC on windows and GCC on linux by using the same script with a flag.
Qt Creator using MinGW on Windows and the GNU compiler on Linux. That's what I use and it works perfectly well. Note that you don't have to use Qt when developing with Qt Creator.
May I suggest CMake on Windows and Linux as you can generate native Visual Studio projects as well as Eclipse CDT projects and plain-old makefiles.
If you are targeting multiple platforms, but find yourself primarily developing on a single platform, I highly recommend a continuous build/integration system to ensure a check-in for one platform does not break the build on the others.
Code::Blocks is a free, open source, cross platform C++ IDE. It supports the MS and GCC compilers, among others.
The main thing standing in my way is
editor compiler/debugger. Anyone have
any suggestions?
Yes: Qt Creator as one download and install will satisfy your three requests -- pick the 'LGPL' license route and download and install the SDK which even installs gcc, g++, ... for you. The integrated debugger is very good, and you get cross-platform behavior from both your code and your tools.
you can use gcc/g++ on windows as well. as for debuggers: gdb and ddd might be in cygwin. editor: vim (beware: it's really a programmable editor, not an IDE).
Vim, gdb, gcc/g++, makefile - you can use them on both - Windows and Unix :)
Yet another vote for Code Blocks or Qt Creator.
There are commercial tools too: beside Visual Studio there are MagicC++ (IDE), debuggers like TotalView, Allinea, Zero-bugs, UndoDB ... if you want to stay with VStudio check these VSBridge and WinGDB.
Anyway you can always use MSVC on Windows and other tools on Unix (gdb/DDD for debugging, vim/emacs for edition) - I've worked in this way a lot of years. Common environment for all platforms is nice, but sometimes it is very hard (almost impossible) to "force" it in company (especially big-company) ;-)