I'm attempting to use inline-c-cpp to access functions from a C++ library, ATen, but am getting the above error about the library's namespace. The code looks like:
import qualified Language.C.Inline.Cpp as C
import qualified Language.C.Inline.Cpp.Exceptions as C
C.context C.cppCtx
C.using "namespace at"
Build profile: -w ghc-8.6.1 -O0
In order, the following will be built (use -v for more details):
- hasktorch-examples-0.0.1.0 (exe:aten) (file experimental/aten-cpp/ATenCpp.hs changed)
Preprocessing executable 'aten' for hasktorch-examples-0.0.1.0..
Building executable 'aten' for hasktorch-examples-0.0.1.0..
[1 of 1] Compiling Main ( experimental/aten-cpp/ATenCpp.hs, /home/stites/git/hasktorch/dist-newstyle/build/x86_64-linux/ghc-8.6.1/hasktorch-examples-0.0.1.0/x/aten/noopt/build/aten/aten-tmp/Main.o )
/tmp/ghc28778_0/ghc_1.cpp:2:17: error:
error: ‘at’ is not a namespace-name
using namespace at;
^~
|
2 | using namespace at;
| ^
/tmp/ghc28778_0/ghc_1.cpp:2:19: error:
error: expected namespace-name before ‘;’ token
using namespace at;
^
|
2 | using namespace at;
| ^
`gcc' failed in phase `C Compiler'. (Exit code: 1)
Am I missing something? Should I be including the header files in my cabal file? If so, do I need to include a link to every file or is a top-level folder sufficient?
I'm attempting to use inline-c-cpp to access functions from a C++ library, ATen, but am getting the above error about the library's namespace. The code looks like:
the cabal file looks like:
and my error is:
Am I missing something? Should I be including the header files in my cabal file? If so, do I need to include a link to every file or is a top-level folder sufficient?
Thank you!