1

From this page on Google Breakpad to test brekpad example

I am create a simple project like this:

#include "client/linux/handler/exception_handler.h"

int main(){
   return 0;
}

And prior to that include the header file destination as:

C_INCLUDE_PATH=$HOME/breakpad/src

export C_INCLUDE_PATH

And then compile it simply with:

gcc main.c -o main

But my code fails to find exception_handler. To be precise, it gives me this:

/home/ubuntu/breakpad/src/client/linux/handler/exception_handler.h:33:18: fatal error: string: No such file or directory
compilation terminated.

Why is that?

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
user1343318
  • 2,093
  • 6
  • 32
  • 59
  • 1
    It looks like it found exception_handler.h, but in it, on line 33, it is not happy about something called "string". If that is another #include, you may need to modify your include path and how you include exception_handler.h. – Charlie Burns Oct 16 '13 at 04:02
  • 1
    I think that include file may be C++. Try changing the name of your file from main.c to main.cpp and recompile. gcc will recognize the .cpp extension as a C++ file. – Charlie Burns Oct 16 '13 at 04:15

1 Answers1

3

Google BreakPad uses C++ inside. Check this link if you want to use it in tandem with C:

https://groups.google.com/forum/#!topic/google-breakpad-discuss/tltR5LJAKlE

asalic
  • 949
  • 4
  • 10