Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread Display Modes
Old Jun 25, 2007, 02:04 AM   #1
macrumors newbie
Join Date: Jun 2007
Linking (ld) problems (g++)

Trying to compile a small software package I've downloaded from the web. It uses CBLAS (linear algebra library), which, as I understand, is pre-installed on OSX. Btw, I'm running 10.3.9.

The package contains .cpp and .h files, but no Makefile. Within my experience with compiling, I've tried to set up a Makefile (see below), but I get problems during linking:
$ make
g++ -c main.cpp
g++ -c Short_Cycle_Counter.cpp
g++ -c Short_Cycle_Matrix.cpp
g++ -o ccount main.o Short_Cycle_Counter.o Short_Cycle_Matrix.o
ld: Undefined symbols:
make: *** [ccount] Error 1
locate cblas.h gives me
I've tried changing the include to cblas.h in many possible ways, but (as long as the path to the file cblas.h is valid), I always get the same error.

Hope someone can help (and that the error is not too obvious)
Here's the Makefile I've made:
CXX = g++

ccount: main.o Short_Cycle_Counter.o Short_Cycle_Matrix.o
$(CXX) -o ccount main.o Short_Cycle_Counter.o Short_Cycle_Matrix.o

main.o: Short_Cycle_Counter.h Short_Cycle_Matrix.h main.cpp
$(CXX) -c main.cpp

Short_Cycle_Counter.o: Short_Cycle_Counter.h Short_Cycle_Counter.cpp
$(CXX) -c Short_Cycle_Counter.cpp

Short_Cycle_Matrix.o: Short_Cycle_Matrix.h Short_Cycle_Matrix.cpp
$(CXX) -c Short_Cycle_Matrix.cpp

rm *.o ccount
joakimk is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Why do many people have problems with the min display port to dual link DVI adapter? Nostromo Mac Peripherals 3 Jul 7, 2011 10:40 AM
Right Clicking on Links in Safari doesn't display "Open Link in New Tab" Option iPud OS X 0 Jan 30, 2011 07:03 PM
Linker (ld) problems fabrizi0 Mac Programming 5 Feb 18, 2009 04:48 PM
Link style problem Brendon Bauer Web Design and Development 7 Feb 12, 2009 04:12 PM
Live links a problem here? mikulashek Community 2 Mar 12, 2003 01:16 AM

All times are GMT -5. The time now is 10:26 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013,, LLC