Can't compile program with gcc-4.9

270 Views Asked by At

I downloaded gcc-4.9 via homebrew. My original goal was to get openMP to work with some code I've written (c++).

But now I can't get any of my code to compile.

Here's my makefile:

 EXE := program
 CC := g++-4.9
 CFLAGS := -std=c++11 -Wall -m64

 program_C_SRCS := $(wildcard *.cpp)
 program_C_OBJS := ${program_C_SRCS:.cpp=.o}
 all: $(EXE)

$(EXE ): $(program_C_OBJS)
     $(CC) $(CFLAGS) $(program_C_OBJS) -o $(EXE)
clean:
     rm -f $(program_C_OBJS) $(EXE)

Here's the error.

 Undefined symbols for architecture x86_64:
 "std::__1::locale::has_facet(std::__1::locale::id&) const", referenced from:
   std::__1::basic_filebuf<char, std::__1::char_traits<char> >::basic_filebuf() in matmult.o
  "std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
  readInMatrix(double*, int, int, std::__1::basic_ifstream<char, std::__1::char_traits<char> >&) in matmult.o

 ...

 ...


ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [matmult] Error 1
0

There are 0 best solutions below