I'm using a library from github to help speed up building my program. I'm coding in C++, and have been having some linking issues.
For one .cpp, I kept getting the "undefined reference" error. I wrapped the header link:
extern "C" {
#include "foo.h"
}
and the errors were resolved.
But now I have a bunch of "error: template with C linkage" errors in one of my other header files:
#ifndef _STRINGFWD_H
#define _STRINGFWD_H 1
#pragma GCC system_header
#include <bits/c++config.h>
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Alloc>
class allocator;
/**
* @defgroup strings Strings
*
* @{
*/
template<class _CharT>
struct char_traits;
template<typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_string;
template<> struct char_traits<char>;
typedef basic_string<char> string; /// A string of @c char
#ifdef _GLIBCXX_USE_WCHAR_T
template<> struct char_traits<wchar_t>;
typedef basic_string<wchar_t> wstring; /// A string of @c wchar_t
#endif
#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
&& defined(_GLIBCXX_USE_C99_STDINT_TR1))
template<> struct char_traits<char16_t>;
template<> struct char_traits<char32_t>;
typedef basic_string<char16_t> u16string; /// A string of @c char16_t
typedef basic_string<char32_t> u32string; /// A string of @c char32_t
#endif
/** @} */
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
#endif // _STRINGFWD_H
I'm new to coding, so I'm not sure how to resolve these linking issues. Any help is greatly appreciated!