Reputation: 238
I am using eclipse and keep getting an undefined reference to `__assert_func' error in my c/c++ code.
I am wondering if there is a way to tell what is being defined ( # define **). I can manually go through my files, but I am working with a lot of them and this would take a while. Is there a compiler option or a tool that could list these for me?
Thanks,
Sam
Upvotes: 0
Views: 748
Reputation: 129454
You can usually produce the pre-processor output from the compiler - e.g. g++ -E myprog.cpp > myprog.i
. I think CL -E
does the same thing in Visual Studio, and other compilers tend to have a similar option.
It does sound like your missing function is part of a ASSERT
or assert
macro.
Upvotes: 1
Reputation: 5855
Undefined reference has nothing to do with #define
s. It is a linker error, you may have forgotten to link against a .lib/.a file.
Upvotes: 1
Reputation: 3710
This is dependent on the compiler. You can read this if you're running GCC.
Upvotes: 3