You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi
I got this error on compiling.
This is my code, it's in a project of visual studio 2022.
#include
#include
#ifdef _MSC_VER
#include <CodeAnalysis/Warnings.h> // ALL_CODE_ANALYSIS_WARNINGS
#pragma warning (push)
#pragma warning (disable : ALL_CODE_ANALYSIS_WARNINGS)
#endif
#include <pybind11/embed.h>
#ifdef _MSC_VER
#pragma warning (pop)
#endif
#include
#include
namespace py = pybind11;
using namespace std;
int sqrt(int n)
{
return n * n;
}
PYBIND11_EMBEDDED_MODULE(cppmath, m)
{
m.def("sqrt", &sqrt);
}
int main()
{
cout << "Hello CMake." << endl;
}
Please help
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions