I'm trying to port something to FreeBSD, and the original source bundle uses
When I installed FreeBSD's
But before using that on the software I'm porting, as a test I tried compiling this file 1.cpp:
... using this command:
Directory /usr/local/lib/gcc48 has tons of files in it, incidentally, leading me to think that I had probably installed
I'm sure it's something really simple. What am I doing wrong?
gcc
, and (among other things) compiles a few .cpp files.When I installed FreeBSD's
gcc
package, I noticed this text:
Code:
---------- Message for gcc-4.8.4_3:
To ensure binaries built with this toolchain find appropriate versions
of the necessary run-time libraries, you may want to link using
-Wl,-rpath=/usr/local/lib/gcc48
Code:
int main(void)
{
int *something;
something=new int[8];
return 0;
}
Code:
gcc -Wl,-rpath=/usr/local/lib/gcc48 1.cpp -o 1
gcc
correctly. But the compilation attempt generated this message:
Code:
/tmp//ccBrMZU7.o: In function 'main':
1.cpp:(.text+0x11): undefined reference to `operator new[](unsigned int)'
collect2: error: ld returned 1 exit status