1

I'm trying to compile an existing c++ project, originally developed on linux with gcc. The only external library is GSL (GNU Scientific Library). I have created an external build tool project to use xcode's debugger, but I currently have two issues.

1) When I try to build in xcode it fails with the error 'gsl/gsl_matrix.h' file not found. I have added /usr/local/include to the HEADER_SEARCH_PATHS and confirmed that there is a gsl folder in that location, which contains all of the header files (installed with brew). However, if I type make in the CL then the project compiles without any errors, so I know there isn't an issue with my GSL, the makefile or the switch from gcc to clang.

I've looked at Xcode 6.3.2 unable to build or run projects, and updated my xcode CL tools just in base, but I was already on the latest (2339).

2) While it would be nice to build from within xcode, it's not the end of the world if I have to build from the CL everytime. Once I've compiled everything I can run it from xcode, however, none of my breakpoints are hit. I have set the executable and the custom working directory in my debug scheme (as indicated by Run C program in Xcode 4 using makefile). I've also looked through Why aren't my breakpoints working? and haven't found anything that works.

I thought it might be operator error since I'm running the target with Product->Run, but I don't see any option to specifically start debug mode like intellij. I'm also able to pause the code and the debugger view comes up, but when I pause it just shows me the assembly instructions.

Vanquish46
  • 494
  • 1
  • 5
  • 15
  • I'm having the same type of problem, can someone post the answer? I've tried turning it off and on again – user1835351 Jun 18 '15 at 05:27
  • I'm stuck on this too. I want to create a Makefile so I can compile this on a Mac and on a linux box. I added under 'Build Settings' `-I/usr/local/include/igraph` to OHTER_CFLAGS and `-L/usr/local/lib` to OTHER_LDFLAGS. Where do I add `-l graph` ? – sAguinaga Jun 19 '15 at 16:36

1 Answers1

0

Well I've figured out both of my issues.

1) In the external build tool configuration I had to uncheck 'Pass build settings in environment'.

2) I'm a bit of an idiot here...I'd tried adding -g to my $(FLAGS) variable, but realized that was only applying to my executable. I modified the makefile to compile every single source file with -g and then breakpoints stopped on the source code (as opposed to disassembly).

Vanquish46
  • 494
  • 1
  • 5
  • 15