Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 04 2019 21:34
    Build #251 passed
  • Jan 03 2019 21:26
    Build #250 passed
  • Jan 02 2019 21:27
    Build #249 passed
  • Jan 01 2019 21:33
    Build #248 passed
  • Dec 31 2018 21:21
    Build #247 passed
  • Dec 31 2018 18:59
    Build #246 passed
  • Dec 30 2018 21:25
    Build #245 passed
  • Dec 29 2018 21:30
    Build #244 passed
  • Dec 28 2018 21:32
    Build #243 passed
  • Dec 27 2018 21:35
    Build #242 passed
  • Dec 26 2018 21:34
    Build #241 passed
  • Dec 25 2018 21:28
    Build #240 passed
  • Dec 24 2018 21:27
    Build #239 passed
  • Dec 23 2018 21:30
    Build #238 passed
  • Dec 22 2018 21:28
    Build #237 passed
  • Dec 21 2018 21:30
    Build #236 passed
  • Dec 20 2018 21:33
    Build #235 passed
  • Dec 19 2018 21:35
    Build #234 passed
  • Dec 18 2018 21:40
    Build #233 passed
  • Dec 15 2018 21:30
    Build #230 passed
genotrance
@genotrance
For now you can call it in the preBuild hook
Has to be rtcPreBuild
And rtcPath
And you need to specify -d:rtcGit
Does that make sense?
TensorTom
@TensorTom
to define a new hook called rtcPreBuild and in it delete makefile + run cmake
genotrance
@genotrance
You don't need to run cmake
GetHeader will do that
Just delete the makefile and run the submodules call
TensorTom
@TensorTom
Thanks for the help the other day. I think I've gotten a bit further but stuck again: TensorTom/nim-webrtc#1
TensorTom
@TensorTom
genotrance
@genotrance
@TensorTom your version of gcc is too old - 5.5
7.0 introduced format truncation
For the second one, can you check if /home/user/.nimble/pkgs/nimterop-0.6.12/nimterop/nimterop/loaf binary exists
TensorTom
@TensorTom
@genotrance it does not. Guess I'll see about upgrading gcc
genotrance
@genotrance
Cool
Or maybe remove that flag in the first place
It is a warning after all
TensorTom
@TensorTom
@genotrance which flag? I upgraded gcc to 7.5 but nothing changed
last time I wrote a line of C was 20 years ago
genotrance
@genotrance
😄 let me try locally
it is not building the static binaries
also, you need to change altNames = "datachannel"
works fine in dynamic mode but since static lib is not built, it is not being found
TensorTom
@TensorTom
@genotrance tried that as well (Changing it to "datachannel")
genotrance
@genotrance
Make isn't building libdatachannel-static.a
You need to figure that out first
KBSec
@kbsec
hello! I am trying to cross compile a program that useses monocypher nim https://github.com/markspanbroek/monocypher.nim but when i try to compile on a linux box to a windows target, it tries to execute windows cmd commds
cmd: cmd /c mkdir \home\blah.nimble\pkgs\monocypher-0.2.0\monocypher\build
result:
/bin/sh: 1: cmd: not found [AssertionError]
The project uses nimterop to wrap the monocypher c code. Does nimterop support cross compiling?
genotrance
@genotrance
Unfortunately setting os to windows makes all compile time calls use windows and that fails
D@rkR4y.
@darkr4y

Can anyone help me with this?
I have learned to use nimterop some time ago with the help of genotrance, but this time I don't need to use nimterop to compile the static library (libcurl) for me automatically, so I choose to use nimgen to help me convert the headers.
First I wrote conanfile.py to compile the static libcurl, with SSL support using wolfssl.
My nimgen related configuration is as follows.

[n.global]
output = nimcurl
filter = curl

[n.include]
nimcurl
nimcurl/include
nimcurl/include/curl

[n.prepare]
extract=curl-7.74.0.zip

[nimcurl/include/curl/curl.h]
recurse = true
preprocess = true
defines = true
ppflags = -DCURL_STATICLIB

Running nimgen produced the following error

C:\Users\dev\Desktop\NimPlayground\nimcurl>nimgen nimcurl.cfg
Extracting curl-7.74.0.zip
Processing nimcurl/include/curl/curl.h
Processing nimcurl/include/curl/curlver.h
Generating nimcurl/curlver.nim
Processing nimcurl/include/curl/system.h
Generating nimcurl/system.nim
Processing nimcurl/include/curl/easy.h
Generating nimcurl/easy.nim
Command failed: 1
cmd /c "c2nim --stdcall --header:headereasy --out:nimcurl/easy.nim temp-easy.nim.c"
C:\Users\dev\Desktop\NimPlayground\nimcurl\temp-easy.nim.c(8, 19) Error: token expected: ;

The error code of temp-easy.nim.c is this line CURL_EXTERN CURL *curl_easy_init(void); , the code snippet is as follows

#define CURL_BLOB_COPY 1
#define CURL_BLOB_NO_COPY 0
struct curl_blob {
  void *data;
  size_t len;
  unsigned int flags;
};
CURL_EXTERN CURL *curl_easy_init(void);
....

The definition of CURL_EXTERN can be found in curl.h

#ifdef CURL_STATICLIB
# define CURL_EXTERN

You can also find the definition of CURL in curl.h

#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER)
typedef struct Curl_easy CURL;
typedef struct Curl_share CURLSH;
#else
typedef void CURL;
typedef void CURLSH;
#endif

I guess it's probably because c2nim can't parse #define or typedef correctly, but I don't know how to fix it, please help me out

support markdown?
now in markdown
offbeat-stuff
@offbeat-stuff
@offbeat-stuff
Yo , I have a c++ type typedef slot7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7> parent_type;
How do import it into nim
Regis Caillaud
@Clonkk
Hi, I there a way to solve tree-sitter parse error: 'typedef enum {', skipped ?
Elijah
@elijahr
@genotrance Did you see that bintray is going away come May 1st? https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/
genotrance
@genotrance
@elijahr - ya need to see what we can do to move forward from there
Kyle Coffey
@Phytolizer

hi, no matter what i try i keep getting this error: Error: unhandled exception: getters.nim(174, 14)name[0] != '' and name[^1] != ''Identifier '__STDC_LIMIT_MACROS' (nskConst) has leading/trailing underscores '_' which Nim does not allow. Use toast flag '--prefix or --suffix' or 'cPlugin()' to modify. [AssertionDefect]

How can I force Nimterop to generate the file with errors so that I can go in and fix/remove them?

For completeness, here's my file:
import nimterop/[build, cimport]

static:
  cDebug()


cCompile("lex.yy.c")
cCompile("pa4.tab.c")

cImport(@["pa4.tab.h", "lex.yy.h"], nimFile = "pa4.nim",
    flags = "-p -E=C_")
Arham Jain
@ajusa
import nimterop/[build, cimport]
static:
  cDebug()
cIncludeDir("/opt/devkitpro/libctru/include")
cExclude("/opt/devkitpro/devkitARM/arm-none-eabi/include/")
cIncludeDir("/opt/devkitpro/devkitARM/arm-none-eabi/include/")
cImport("/opt/devkitpro/libctru/include/3ds.h", flags = "-E__ -F__ -E_ -F_", recurse = true)
# const 'U64_MAX' has unsupported value 'UINT64_MAX'
# const 'SSIZE_MAX' has unsupported value '((SIZE_MAX) >> 1)'
# const 'PACKED' has unsupported value '__attribute__((packed))'
# const 'DEPRECATED' has unsupported value '__attribute__ ((deprecated))'
# const 'SVC_STOP_POINT' has unsupported value '__asm__ volatile("svc 0xFF");'
# const 'WRITE_DATA_TO_HANDLER_STACK' has unsupported value 'NULL'
# const 'CONSOLE_RESET' has unsupported value 'CONSOLE_ESC(0m)'
# const 'CONSOLE_BLACK' has unsupported value 'CONSOLE_ESC(30m)'
# const 'CONSOLE_RED' has unsupported value 'CONSOLE_ESC(31;1m)'
# const 'CONSOLE_GREEN' has unsupported value 'CONSOLE_ESC(32;1m)'
# const 'CONSOLE_YELLOW' has unsupported value 'CONSOLE_ESC(33;1m)'
# const 'CONSOLE_BLUE' has unsupported value 'CONSOLE_ESC(34;1m)'
# const 'CONSOLE_MAGENTA' has unsupported value 'CONSOLE_ESC(35;1m)'
# const 'CONSOLE_CYAN' has unsupported value 'CONSOLE_ESC(36;1m)'
# const 'CONSOLE_WHITE' has unsupported value 'CONSOLE_ESC(37;1m)'
Traceback (most recent call last)
toast.nim(227)           toast
cligen.nim(770)          cligenScope
cligen.nim(692)          dispatchmain
toast.nim(150)           main
toast.nim(30)            process
ast2.nim(1944)           parseNim
ast2.nim(1829)           searchTree
ast2.nim(1807)           processNode
macros.nim(550)          addEnum
renderer.nim(1634)       $
renderer.nim(1631)       renderTree
renderer.nim(574)        gsub
renderer.nim(1619)       gsub
msgs.nim(583)            internalErrorImpl
msgs.nim(539)            liMessage
msgs.nim(406)            handleError
msgs.nim(395)            quit
 [AssertionDefect]
Anyone know why this causes an assertion defect? Is it the unsupported values that are printing or something else?
Kaushal Modi
@kaushalmodi
@ajusa I don't have an answer. But the way I debug this is by comment bisecting the header file to see where nimterop got into this failure.

@onContentStop As the error says

Use toast flag '--prefix or --suffix' or 'cPlugin()' to modify.

So add -E_ -E__ to the flags arg to cImport. Also check out https://github.com/nimterop/nimterop#preprocessing

Several C libraries also use leading and/or trailing _ in identifiers and since Nim does not allow this, the cPlugin() macro can be used to modify such symbols or cSkipSymbol() them altogether. Instead of a full cPlugin() section, it might also be preferred to set flags = "-E_ -F_" to the cImport() call to trim out such characters.

Once you have nimterop installed, the toast binary will be installed as well. To get more detail about these switches, you can do toast -h from the terminal.
Kyle Coffey
@Phytolizer
@kaushalmodi i tried the --prefix flag, and had no luck. additionally did -E_ but for some reason this macro defies nimterop.
Liam Sc
@dizzyliam
Long time no talk @genotrance, I'm finally getting back into some projects of mine. Looks like I might be getting this issue trying to wrap Nuklear: nimterop/nimterop#222
The type definition it's slipping up on looks like
#ifndef NK_BOOL
  #ifdef NK_INCLUDE_STANDARD_BOOL
    #include <stdbool.h>
    #define NK_BOOL bool
  #else
    #define NK_BOOL int /* could be char, use int for drop-in replacement backwards compatibility */
  #endif
#endif
Wait the comment is after the type, maybe it's something else...
Augustinas
@WhoAteDaCake
Has anyone made successful bindings to opencv library?