Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

You need to wrap the C code like so

extern "C" { #include "sample1.h" } 

A better way to do it is like in this StackOverflow questionthis StackOverflow question, in the C header files.

use:

#ifdef __cplusplus extern "C" { #endif 

At the start of all C header files.

and use:

#ifdef __cplusplus } #endif 

At the end of all C header files.

You need to wrap the C code like so

extern "C" { #include "sample1.h" } 

A better way to do it is like in this StackOverflow question, in the C header files.

use:

#ifdef __cplusplus extern "C" { #endif 

At the start of all C header files.

and use:

#ifdef __cplusplus } #endif 

At the end of all C header files.

You need to wrap the C code like so

extern "C" { #include "sample1.h" } 

A better way to do it is like in this StackOverflow question, in the C header files.

use:

#ifdef __cplusplus extern "C" { #endif 

At the start of all C header files.

and use:

#ifdef __cplusplus } #endif 

At the end of all C header files.

added 213 characters in body
Source Link
nonsensickle
  • 4.6k
  • 2
  • 37
  • 64

You need to wrap the C code like so

extern "C" { #include "sample1.h" } 

See Including C Code in C++ for an example andA better way to do it is like in Combining C++ and C - how does #ifdef __cplusplus work?this StackOverflow question for details, in the C header files.

use:

#ifdef __cplusplus extern "C" { #endif 

At the start of all C header files.

and use:

#ifdef __cplusplus } #endif 

At the end of all C header files.

You need to wrap the C code like so

extern "C" { #include "sample1.h" } 

See Including C Code in C++ for an example and Combining C++ and C - how does #ifdef __cplusplus work? for details

You need to wrap the C code like so

extern "C" { #include "sample1.h" } 

A better way to do it is like in this StackOverflow question, in the C header files.

use:

#ifdef __cplusplus extern "C" { #endif 

At the start of all C header files.

and use:

#ifdef __cplusplus } #endif 

At the end of all C header files.

Source Link
nonsensickle
  • 4.6k
  • 2
  • 37
  • 64

You need to wrap the C code like so

extern "C" { #include "sample1.h" } 

See Including C Code in C++ for an example and Combining C++ and C - how does #ifdef __cplusplus work? for details