Re: How to tell GCC where to find source code?
Re: How to tell GCC where to find source code?
- Subject: Re: How to tell GCC where to find source code?
- From: Jean-Daniel Dupas <email@hidden>
- Date: Tue, 17 Nov 2009 16:55:59 +0100
Le 17 nov. 2009 à 15:32, Jean-Denis Muys a écrit :
> Hi,
>
> I want to trace through C++ source code that I have the source code for, but which XCode's GCC says it can't find.
>
> How can I tell GCC that it needs to look in *that* directory?
>
> The warning I get when I want to trace is:
>
> warning: Could not find object file "/Volumes/MiniData/Development/mySQL/mysql-connector-c++-1.1.0/driver/CMakeFiles/mysqlcppconn.dir/nativeapi/mysql_native_resultset_wrapper.cpp.o" - no debug information available for "/Volumes/MiniData/Development/mySQL/mysql-connector-c++-1.1.0/driver/nativeapi/mysql_native_resultset_wrapper.cpp".
>
> And indeed, I had built that source library on a different machine (*). So in that precise case, I can probably rebuild it on my current machine and proceed from there, though it'll be a PITA.
>
> Yet the question stands. Is it possible to tell GCC in which directory to look for source code?
>
> Another case I have where I'd like to step through source code is the standard C++ library (and rebuilding it seems daunting to me). Here is the GCC warning:
>
> Xcode could not locate source file: basic_string.tcc (line: 430)
>
> I downloaded the entire source code for the GCC 4.2 suite and I now do have all the standard C++ library source code, including basic_string.tcc. How can I tie it to the actual library?
>
> I have that need because of a weird problem involving the C++ standard library. I may describe that problem in a future post if I can't solve it on my own.
>
> Thanks a million,
>
> Jean-Denis
>
> (*) I built that library an this other machine because my code needs to run under Leopard. When I build that library on my current Snow Leopard machine, my code doesn't run any more on a Leopard machine. That library uses a CMake-based build system. Since I don't know anything about that system, rather than spend an indeterminate amount of time learning about it to find out what the issue is, I found it quicker to simply build it on a Leopard machine once and for all.
I guess you mean GDB instead of GCC, isn't it ? GCC is the compiler, GDB the debugger.
in GDB, you can use the directory command to tell it where to search source files (type 'help directory' in gdb for details).
To build on 10.6 and be compatible with 10.5, you have to add the -mmacosx-version-min=10.5 in compiler flags (or set the MACOSX_DEPLOYMENT_TARGET env var to 10.5 before building).
-- Jean-Daniel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden