C linking fails

Ryan Schmidt ryandesign at macports.org
Wed Jul 29 06:42:34 PDT 2015

On Jul 29, 2015, at 8:18 AM, James Rome wrote:
> I am doing just C. Please see attached picture.

We should keep the conversation on the mailing list; use the Reply All function when you reply. But it's best to avoid sending attachments to the list.

I'm not familiar with netbeans so I don't know how to interpret the screenshot you sent me. But:

I see that the "Tool Collection" menu on the left has "GNU" selected.

For "base directory", "/usr/bin" is filled in. I'm not sure the significance of that.

For "C compiler", "/opt/local/bin/gcc" is filled in. That's a symlink, and what it points to depends on how you ran "sudo port select gcc". I assume you selected gcc49.

For "C++ compiler", "/usr/bin/g++" is filled in--in other words, Xcode's clang++. If there's any C++ code, this will be a mismatch of compilers which could cause problems. To ensure that doesn't happen, you should fill in "/opt/local/bin/g++" here to ensure your C and C++ compilers are matched.

Alternately, you could fill in the actual paths to the gcc49 programs: /opt/local/bin/gcc-mp-4.9 and /opt/local/bin/g++-mp-4.9.

Also consider trying gcc5 (instead of gcc49); that's the latest stable version of gcc. The development version gcc6 is also available if you want it.

For "CMake command", it looks like "/Applications/Xcode.app/Contents/Developer/usr/bin/make" is filled in. That's wrong; make is not cmake. You can get cmake in MacPorts by running "sudo port install cmake". Then you would set this value to "/opt/local/bin/cmake".

"QMake Command" is empty; if you need it, you can get it by installing the qt4-mac port and then filling in "/opt/local/bin/qmake" here.

I see that the "Tool Collection" menu also has "CLang" listed. I'm not sure how netbeans decides which tool collection to use.

More information about the macports-users mailing list