netbeans for c/c++ saying "no compiler found" - c++

I have tried the this tutorial but it did not help me out. I have installed Cygwin and added its C:\cygwin\bin path in my environment variables but nothing happened, still the same error.
and its not even recognizing cout.

The configuration page lists the required cygwin packages:
gcc
g++ (gcc-g++ package)
gdb
make
Make sure those packages are installed by re-running the Cygwin Setup and checking those packages in the Select Packages step. Look under the Devel category or search for the packages in the Search field.
If the packages are marked "Skip" then they are not installed. Click the skipped packages until a version number appears where "Skip" did.
Then, click Next, let Cygwin install any dependencies, and click Next again to download and install the packages.

Related

Install libsodium on macOS

I am trying to incorporate libsodium into my C++ project in Xcode. I am following the Installation instructions here: https://libsodium.gitbook.io/doc/installation
However, I'm not sure where the "installed" files go on my machine or how to then incorporate them in my Xcode project. The libsodium website is not helpful. Could someone help clarify for me please?
I have downloaded the latest stable release, unzipped it, and typed the following code into the shell:
./configure
make && make check
sudo make install
It seems that the configure, make and install processes go smoothly. I expected the next steps to link to Xcode would be clear, but they are not, and I am lost. Can someone point me in the right direction?
When you perform the sudo make install step, the library files will be installed into the location the ./configure step designated. By default, this is usually /usr/local/lib.
You will still need to add the library files to your XCode project.
Try reading Link a target to libraries and frameworks about how to add the libsodium libraries. Pay attention to the "Add Other..." button which will allow you to navigate to the location you installed the libraries.
Hope this helps!

Fixing MinGW Installation on Windows 8

While helping my friend spin up MinGW and a C++ environment on his Windows 8 computer, I ran the get-mingw script and waited as it ran through all the mirrors for required downloads. However, three downloads completely failed:
libltdl - installer script hung and then moved on after pressing "OK"
automake-1.11 - installer script tried finding 1.10, then 1.9, then 1.8, then 1.7 (all of which failed) until finally settling on 1.6
mktemp - script hung and moved on after pressing "OK"
In all three cases, the script gave me a nice error log upon completion, showing that a majority of packages had been downloaded and installed except for these three, which showed up as errors. However during the installation process I had simply gone to the MinGW sourceforge page and manually found and downloaded each .bin.tar.lzma file that was missing.
Now that I have them, is there a good accepted way to unpack and plug them into my friend's existing MinGW install? In case it's tough, I'm comfortable with unix and dos command line so I'll be able to move executables into the MinGW/bin folder if that's what's needed, I just want to check for the best way to 'fix' the install.
As a side note - even though the error log says these are required packages, adding MinGW/bin/ to the PATH still allows for use of gcc and g++, although not make (possibly because of automake failure?). Is this standard behavior?
Firstly, the package issue can be fixed by using the MinGW installer - keep the packages selected and go to "apply changes" and the script will probably try to redownload the missing packages. I think the original problem was probably just a shoddy wifi connection during repository connection.
However, I then ran into a problem where I tried to run gcc and it gave me a missing -lpthread error ... but this question was able to help me fix that, and gcc and g++ are working fine now (haven't opened and tested Eclipse yet though). Just in case of link decay, the issue I cited arises from the MinGW installer script not downloading the lpthread library upon installation. To fix that issue, quoted from link:
Just run and open MinGW Installation Manager, which should be pre-installed with MinGW, select "All Packages" on the left panel, and on the right panel, search for "mingw32-pthreads-w32" packages and install them.
I think the Installation Manager has libpthread and pthread available for install, and pthread libs were the ones that seemed to solve it for me.

How do I install Eclipse with C++ in Ubuntu 12.10 (Quantal Quetzal)?

I just installed Ubuntu 12.10, and I tried to install Eclipse and C++, but I failed miserably.
I started with an installation from the Software Center, Eclipse worked, but only in Java. Then I started googling for installation guides and tutorials, but after hours of downloads and installations, the C++ in Eclipse still doesn't work.
So now I have two questions:
How do I clean up this mess?
Actually, how do I know if there is a mess?
According to the Ubuntu Software Center, Eclipse is installed and has three add-ons.
How do I know if the other installations of other Eclipse versions/packagings overwrote each other or if I have multiple installations?
How do I install the latest version of Eclipse and C++ in Ubuntu 12.10?
There is a package called eclipse-cdt in the Ubuntu 12.10 repositories, this is what you want. If you haven't got g++ already, you need to install that as well, so all you need is:
sudo apt-get install eclipse eclipse-cdt g++
Whether you messed up your system with your previous installation attempts depends heavily on how you did it. If you did it the safe way for trying out new packages not from repositories (i.e., only installed in your home folder, no sudos blindly copied from installation manuals...) you're definitely fine. Otherwise, you may well have thousands of stray files all over your file system now. In that case, run all uninstall scripts you can find for the things you installed, then install using apt-get and hope for the best.
I used (the suggested answer from above)
sudo apt-get install eclipse eclipse-cdt g++
but ONLY after then also doing
sudo eclipse -clean
Hope that also helps.
I also tried http://www.eclipse.org/cdt/ in Ubuntu 12.04.2 LTS and works fine!
First, I downloaded it from www.eclipse.org/downloads/, choosing Eclipse IDE for C/C++ Developers.
I save the file somewhere, let´s say into my home directory. Open a console or terminal, and type:
>>cd ~; tar xvzf eclipse*.tar.gz;
Remember for having Eclipse running in Linux, it is required a JVM, so download a jdk file e.g jdk-7u17-linux-i586.rpm (I cann´t post the link due to my low reputation) ... anyway
Install the .rpm file following http://www.wikihow.com/Install-Java-on-Linux
Find the path to the Java installation, by typing:
>>which java
I got /usr/bin/java. To start up Eclipse, type:
>>cd ~/eclipse; ./eclipse -vm /usr/bin/java
Also, once everything is installed, in the home directory, you can double-click the executable icon called eclipse, and then you´ll have it!. In case you like an icon, create a .desktop file in /usr/share/applications:
>>sudo gedit /usr/share/applications/eclipse.desktop
The .desktop file content is as follows:
[Desktop Entry]
Name=Eclipse
Type=Application
Exec="This is the path of the eclipse executable on your machine"
Terminal=false
Icon="This is the path of the icon.xpm file on your machine"
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE
Name[en]=eclipse.desktop
Best luck!
I was in the same boat. Installed Eclipse, realized need CDT.
sudo apt-get install eclipse eclipse-cdt g++
This just adds the CDT package on top of existing installation - no un-installation etc. required.
http://www.eclipse.org/cdt/
^Give that a try
I have not used the CDT for eclipse but I do use Eclipse Java for Ubuntu 12.04 and it works wonders.

Installing g++ to terminal from files on my mac

When I try to compile a c++ program in my Mac terminal, I get the following error:
-bash: g++: command not found
but I believe I have all the files I need on my Mac to run the compiler. I have the Developer folder, which contains Xcode in Applications, g++ in the usr/bin folder, and a bunch of other folders.
How can I use these files to install the g++ compiler. Thank you!
Assuming you have the latest Xcode, go to Xcode Preferences, Downloads, and click on the Install button next to Command Line Tools. This should install and put everything into your PATH automatically.
houbysoft's answer above is correct, but the OP needs a little more detail.
The basic idea is that you need the "Command Line Tools" environment installed. But the name for that environment, and how you install it, has changed multiple times over the years. So, houbysoft's steps work for 4.3.3, but not for 3.2.6.
In the 3.2 era, the tools were called "UNIX Development". And, rather than being downloaded and installed from within Xcode, they came as part of the Xcode mpkg and were installed as part of the initial Xcode install. In most versions, there was a checkbox named "UNIX Development", usually checked by default, but in some versions it was a separate step. Looking at the "Xcode 3.2.6 and IOS SDK 4.3" disk image currently available from Apple, it's a checkbox. Anyway, that's the only officially-supported way to get them, but lots of other ways work… Here are your options:
Throw away Xcode 3.2.6 (just trash the whole /Developer) and install 4.3.3, then follow houbysoft's steps to get the Command Line Tools. Unless there's a good reason you can't use 4.3, this is almost certainly the best answer.
Throw away Xcode 3.2.6 and reinstall it, and this time make sure the "UNIX Development" checkbox is on.
Just re-run the 3.2.6 installer, and make sure the "UNIX Development" checkbox is on.
Log into developer.apple.com and look through the downloads for a package named "UNIX Development Tools", "Developer Tools CLI", "CLI Developer Environment", "Command Line Tools", or similar that corresponds to 3.2.6. There is such a package for most, but not all, versions of Xcode, and can be used to set up a command-line build environment either with or without Xcode.
Look at the invisible packages on the Xcode disk image. I don't remember whether you need just DeveloperToolsCLI.pkg, or that plus a few others, but a bit of trial and error or googling should get you there.
If everything is installed correctly, it sounds like all you need to do is get your "PATH" environment variable modified.
This closely related SuperUser question should provide the answers you need, at least if you're running under Snow Leopard. Here's another question about setting environment variables for Lion.

Mac OS X Lion and Xcode upgraded: missing headers and libs

After upgrading to Lion, and upgrading Xcode, make can't seem to locate headers and libs. I looked in /usr/include. The only thing in there was 'parallels-server'. So, I renamed /usr/include to /usr/include.old, and made a symlink to:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/
This is pretty evil. But, make can now find headers. Still can't locate libs (e.g., lcrt1.10.6.o).
What is the correct way to solve both the include and lib problems?
Thanks!
After downloading Xcode 4 from the App Store, try running "/Applications/Install Xcode.app".
From me, just downloading the Xcode Command line tools did the trick. (For that, of course, I had first to install Xcode itself, which I installed trough App Store.
Start Xcode
Open Xcode→Preferences...
Select the Downloads tab
Install the Command line tools
That installs a few packages, see /var/db/receipts. The package that contains /usr/include is com.apple.pkg.DevSDKLeo.
I don't think xcode-select is needed, but I had run that command before I downloaded the Command line tools, so I don't know for sure.
To get Xcode to populate the /usr/include directory, run the following command:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/
You may need to install the Xcode Command Line Tools within Xcode for this to work. Open the Preferences menu, then under Downloads install Command Line Tools.
The above answer by njamesp also addresses the following error:
configure: error: C compiler cannot create executables
I received this error when trying to compile code on my 10.7 system after setting it up from a 10.5 time machine, so I assume the wrong version of xcode was installed on my system.