Giter Club home page Giter Club logo

Comments (4)

holgerschurig avatar holgerschurig commented on August 19, 2024

Hmm, GitHub doesn't allow me to attach the notmuch.h file for your convenience --- or I am too dumb. So I uploaded it to 0x0.st instead. Here is the link: http://0x0.st/o-If.h

The weird filename is from the pastebin site 0x0.st, not from me.

from c2nim.

hoyon avatar hoyon commented on August 19, 2024

I'm getting the same issue but seems to only happen when running on a header in a directory owned by root eg all the headers in /usr/include.

Seems to be an issue with c2nim trying to create the output in a directory owned by root. Running c2nim with a copy of the header in a directory owned by my local user or specifying --out:output.nim seems to work.

I guess there's missing error check when opening the output file which causes the seg fault. Would be better to exit with a useful error instead.

from c2nim.

mantielero avatar mantielero commented on August 19, 2024

I am facing this problem with the header in a directory not owned by root. In my case, it occurs with file:
https://github.com/FFmpeg/FFmpeg/blob/release/6.1/libavformat/avformat.h

I use ffmpeg.c2nim:

#ifdef C2NIM
#def av_const
#def av_always_inline 
#def av_pure
#pp AV_HAVE_BIGENDIAN
#def attribute_deprecated
#def av_warn_unused_result
#def AV_PIX_FMT_NE

#endif
#def FF_API_R_FRAME_RATE TRUE
#ifdef C2NIM
#@
template AV_PIX_FMT_NE*(be, le: untyped):untyped  =
  `AV_PIX_FMT le`
@#
#endif

If I use the following command:

c2nim --strict  --skipinclude --dynlib:libavformat --header --skipcomments --out:avformat/avformat.nim ffmpeg.c2nim ../FFmpeg-release-6.1/libavformat/avformat.h

it complains about line 2831:

FFmpeg-release-6.1/libavformat/avformat.h(2831, 1) Error: did not expect #

If execute the same line without --strict:

[warning] preprocessor ignoring option: endif
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
[1]    4858 segmentation fault (core dumped)  c2nim --skipinclude --dynlib:libavformat --header --skipcomments  ffmpeg.c2ni

from c2nim.

mantielero avatar mantielero commented on August 19, 2024

In my case, it looks like the issue is related with trying to create output file in an unexisting folder.

So by just doing:

mkdir avformat

the problem was solved.

from c2nim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.