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

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 25, 2007, 02:04 AM   #1
joakimk
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:
Quote:
$ 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:
_cblas_daxpy
_cblas_dgemm
make: *** [ccount] Error 1
locate cblas.h gives me
Quote:
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/Headers/cblas.h
/System/Library/Frameworks/vecLib.framework/Versions/A/Headers/cblas.h
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:
Quote:
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

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

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Help with linking AlertView to webpage?? Ryan Burgess iPhone/iPad Programming 4 May 9, 2013 11:50 PM
linking in Mail fatmallon Mac Applications and Mac App Store 1 Mar 15, 2013 01:18 PM
problems with linking macbookOSX to pc printer 793isricheve MacBook 0 Feb 22, 2013 05:08 PM
URL Linking To Certain Page? AFPoster Web Design and Development 7 Dec 7, 2012 12:09 AM
Problems with linking to Boost dylibs in Xcode TastyCocoa Mac Programming 2 Aug 17, 2012 04:58 AM

Forum Jump

All times are GMT -5. The time now is 11:51 PM.

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

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