Skip to content

Instantly share code, notes, and snippets.

@SergXIIIth
Created November 3, 2015 16:28

Revisions

  1. SergXIIIth created this gist Nov 3, 2015.
    35 changes: 35 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    require "./sev/*"

    module Sev
    puts "Hello"

    @[Link("m")]
    @[Link("avcodec")]
    @[Link("avformat")]
    lib AvFormat
    fun av_register_all
    end

    AvFormat.av_register_all
    end

    ------

    /usr/bin/ld: /opt/crystal/bin/../embedded/lib/../lib/libgc.a(os_dep.o): undefined reference to symbol '_end'
    //usr/lib/x86_64-linux-gnu/librtmp.so.0: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status
    Error: execution of command failed with code: 1: `cc -o "/home/msa/prj/vid/sev/.crystal/crystal-run-sev.tmp" "${@}" -rdynamic -lavformat -lavcodec -levent -lrt -lpcl -lpcre -lgc -lpthread -ldl`

    ------


    // gcc src/decoder.c -lavcodec -lavformat

    #include <libavcodec/avcodec.h>
    #include <libavformat/avformat.h>
    // #include <ffmpeg/swscale.h>

    int main(int argc, char *argv[]) {
    av_register_all();
    }