简体   繁体   中英

xcode 6.3.2 external build

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.

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM