# \#c

**URL:** https://discourse.julialang.org/tag/c/610.md?page=1

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 2

---

## [Line number info missing when Windows DLL gets EXCEPTION\_ACCESS\_VIOLATION](https://discourse.julialang.org/t/line-number-info-missing-when-windows-dll-gets-exception-access-violation/108353)

<div class="topic-metadata">

**Author:** [@Kirby\_Zhang](https://discourse.julialang.org/u/Kirby_Zhang)\
**Replies:** 2\
**Last updated:** [January 4, 2024, 6:32pm UTC](https://discourse.julialang.org/t/line-number-info-missing-when-windows-dll-gets-exception-access-violation/108353 "2024-01-04T18:32:53Z")

</div>

The DLL was compiled using MSVC toolchain with debug configuration. A .pdb file was generated alongside the .dll file. But it seems line number information is not being made available to Julia’s access violation handler: …

---

## [Definition of struct written from C and read-only in Julia](https://discourse.julialang.org/t/definition-of-struct-written-from-c-and-read-only-in-julia/106667)

<div class="topic-metadata">

**Author:** [@PatrickHaecker](https://discourse.julialang.org/u/PatrickHaecker)\
**Replies:** 7\
**Last updated:** [November 27, 2023, 10:57am UTC](https://discourse.julialang.org/t/definition-of-struct-written-from-c-and-read-only-in-julia/106667 "2023-11-27T10:57:45Z")

</div>

I hand over a struct to a C library which periodically will enter values in the struct’s field and then call a Julia callback function. The struct is defined and gets created (memory allocated) in Julia, but only C write…

---

## [Failing to embed Julia in C++](https://discourse.julialang.org/t/failing-to-embed-julia-in-c/106381)

<div class="topic-metadata">

**Author:** [@droodman](https://discourse.julialang.org/u/droodman)\
**Replies:** 1\
**Last updated:** [November 18, 2023, 12:49am UTC](https://discourse.julialang.org/t/failing-to-embed-julia-in-c/106381 "2023-11-18T00:49:06Z")

</div>

I’m trying to embed Julia in C++ on an M2 MacBook under MacOS Sonoma with Julia 1.9.3. I’ve succeeded in compiling the same program in Windows, with Visual Studio, and Ubuntu 22.04, with g++. But on the Mac, g++ is gener…

---

## [Odd inlining behaviour with cglobal wrapper, IS THIS A BUG? What am I doing wrong?](https://discourse.julialang.org/t/odd-inlining-behaviour-with-cglobal-wrapper-is-this-a-bug-what-am-i-doing-wrong/104562)

<div class="topic-metadata">

**Author:** [@gmcardle](https://discourse.julialang.org/u/gmcardle)\
**Replies:** 5\
**Last updated:** [October 30, 2023, 3:42pm UTC](https://discourse.julialang.org/t/odd-inlining-behaviour-with-cglobal-wrapper-is-this-a-bug-what-am-i-doing-wrong/104562 "2023-10-30T15:42:44Z")

</div>

Hi, I’m trying to make a convenience wrapper for fetching global variables from a C library. The basic wrapper function works, but multiple-dispatch variants don’t work unless I add some specific lines of debugging outpu…

---

## [Transfer/ Unbox Julia's DataFrame objects and use as C++ object](https://discourse.julialang.org/t/transfer-unbox-julias-dataframe-objects-and-use-as-c-object/105440)

<div class="topic-metadata">

**Author:** [@Ivan\_Navarro](https://discourse.julialang.org/u/Ivan_Navarro)\
**Replies:** 12\
**Last updated:** [October 27, 2023, 4:36pm UTC](https://discourse.julialang.org/t/transfer-unbox-julias-dataframe-objects-and-use-as-c-object/105440 "2023-10-27T16:36:37Z")

</div>

NOTE: Cross posting from Transfer/ Unbox Julia's DataFrame objects and use as C++ object - Stack Overflow I would like to (un)box complex objects like DataFrames created in Julia, from C++. So I can use as input data fo…

---

## [Wrapping C++ class](https://discourse.julialang.org/t/wrapping-c-class/102573)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 11\
**Last updated:** [October 4, 2023, 12:08pm UTC](https://discourse.julialang.org/t/wrapping-c-class/102573 "2023-10-04T12:08:38Z")

</div>

Okay, I have a MWE that duplicates my issue: My wrapper correctly gives me the main application. The main application manages some other classes as members, but when I get those members back - they seem to not work. This…

---

## [Convert Vector{String} to Ptr{Ptr{UInt8}}?](https://discourse.julialang.org/t/convert-vector-string-to-ptr-ptr-uint8/102793)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 5\
**Last updated:** [August 14, 2023, 6:09pm UTC](https://discourse.julialang.org/t/convert-vector-string-to-ptr-ptr-uint8/102793 "2023-08-14T18:09:29Z")

</div>

I’m aware that Julia strings are unicode things, but if I make sure that the strings are ASCII clean, I can figure out how to convert Vector{String} → Vector{Vector{UInt8}}, but not to Ptr{Ptr{UInt8}} … In \[1\]: a = \["hi…

---

## [Is there a C/C++/Rust/Go library that can do inference on Flux models?](https://discourse.julialang.org/t/is-there-a-c-c-rust-go-library-that-can-do-inference-on-flux-models/102581)

<div class="topic-metadata">

**Author:** [@tchebycheff](https://discourse.julialang.org/u/tchebycheff)\
**Replies:** 11\
**Last updated:** [August 9, 2023, 12:08pm UTC](https://discourse.julialang.org/t/is-there-a-c-c-rust-go-library-that-can-do-inference-on-flux-models/102581 "2023-08-09T12:08:39Z")

</div>

If not, is it useful to have one at least for simple layers like Dense, Conv, Scale, etc.?

---

## [JIT issues relevant to realtime applications](https://discourse.julialang.org/t/jit-issues-relevant-to-realtime-applications/67736)

<div class="topic-metadata">

**Author:** [@solaris](https://discourse.julialang.org/u/solaris)\
**Replies:** 59\
**Last updated:** [July 29, 2023, 12:58pm UTC](https://discourse.julialang.org/t/jit-issues-relevant-to-realtime-applications/67736 "2023-07-29T12:58:06Z")

</div>

First off, Julia’s performance (once JIT compiled) is insane! How?! (rhetorical). In my gaming development environment my naïve Julia code beats my naïve C++ code (clang O2 Release version). JIT is super useful for de…

---

## [Advice for wrapping c++ library that throws exceptions?](https://discourse.julialang.org/t/advice-for-wrapping-c-library-that-throws-exceptions/101855)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 0\
**Last updated:** [July 20, 2023, 9:27pm UTC](https://discourse.julialang.org/t/advice-for-wrapping-c-library-that-throws-exceptions/101855 "2023-07-20T21:27:11Z")

</div>

I have a vendor library that throws exceptions, which makes wrapping them a bit more miserable. I only have access to headers and shared libraries, and I couldn’t figure out a way to link the libraries and prevent except…

---

## [How to examine a pointer address?](https://discourse.julialang.org/t/how-to-examine-a-pointer-address/101791)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 2\
**Last updated:** [July 19, 2023, 5:11pm UTC](https://discourse.julialang.org/t/how-to-examine-a-pointer-address/101791 "2023-07-19T17:11:29Z")

</div>

I am wrapping a library that returns an opaque structure. The call that gives me my result looks like: z = @ccall mylib.returns\_opaque()::Ptr{Cvoid} If the structure is properly initialized, it will be nonzero (i.e. n…

---

## [Including a binary (a "\*.so") with a package?](https://discourse.julialang.org/t/including-a-binary-a-so-with-a-package/101626)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 6\
**Last updated:** [July 14, 2023, 4:42pm UTC](https://discourse.julialang.org/t/including-a-binary-a-so-with-a-package/101626 "2023-07-14T16:42:34Z")

</div>

We have a vendor C API that we are currently trying to wrap in Julia. I just have their headers and a dynamic library. Presently I am using \] generate to create new projects because of the way that our source is stored. …

---

## [Different output when call Fortran from Julia](https://discourse.julialang.org/t/different-output-when-call-fortran-from-julia/97688)

<div class="topic-metadata">

**Author:** [@X\_Chen](https://discourse.julialang.org/u/X_Chen)\
**Replies:** 5\
**Last updated:** [July 13, 2023, 3:29pm UTC](https://discourse.julialang.org/t/different-output-when-call-fortran-from-julia/97688 "2023-07-13T15:29:40Z")

</div>

Hello! I am trying to use a package in Fortran, and I tested it in Julia - it works perfectly well. Now I am trying to write a function in Julia that I can use it as a normal Julia function. Here is the function code: f…

---

## [Where are the C API header files when I install with juliaup?](https://discourse.julialang.org/t/where-are-the-c-api-header-files-when-i-install-with-juliaup/99151)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 2\
**Last updated:** [May 20, 2023, 9:40am UTC](https://discourse.julialang.org/t/where-are-the-c-api-header-files-when-i-install-with-juliaup/99151 "2023-05-20T09:40:12Z")

</div>

I switched from manually downloading Julia to using the juliaup installer. Now I just get a binary executable that launches Julia, but I cannot find the header files for embedding Julia in C/C++. Is this a limitation of …

---

## [Julia wrapper for hiredis](https://discourse.julialang.org/t/julia-wrapper-for-hiredis/98559)

<div class="topic-metadata">

**Author:** [@nolb](https://discourse.julialang.org/u/nolb)\
**Replies:** 2\
**Last updated:** [May 11, 2023, 8:54am UTC](https://discourse.julialang.org/t/julia-wrapper-for-hiredis/98559 "2023-05-11T08:54:36Z")

</div>

Hi everyone, I am currently trying to write a Julia wrapper for the C library hiredis, so that I can write data to and read data from a Redis Cache with Julia. There are already two Julia libraries for this, namely Red…

---

## [Julia crashes when using a @cfunction from another module](https://discourse.julialang.org/t/julia-crashes-when-using-a-cfunction-from-another-module/98576)

<div class="topic-metadata">

**Author:** [@heyx3](https://discourse.julialang.org/u/heyx3)\
**Replies:** 2\
**Last updated:** [May 9, 2023, 9:32pm UTC](https://discourse.julialang.org/t/julia-crashes-when-using-a-cfunction-from-another-module/98576 "2023-05-09T21:32:37Z")

</div>

I’m trying to define some Julia callbacks to give to a C library, but hit some strange crashes when those functions are invoked. In an attempt to pin down the problem I have created a very simple project which still cras…

---

## [Embedding Julia code in C](https://discourse.julialang.org/t/embedding-julia-code-in-c/98507)

<div class="topic-metadata">

**Author:** [@mb96](https://discourse.julialang.org/u/mb96)\
**Replies:** 4\
**Last updated:** [May 9, 2023, 12:13am UTC](https://discourse.julialang.org/t/embedding-julia-code-in-c/98507 "2023-05-09T00:13:10Z")

</div>

Hi there, I am trying to compile a simple C program that calls a Julia base function. However, it is not compiling. The C code reads as “”" #include \<stdio.h\> #include \<julia.h\> int main(){ jl\_init(); int index\_ve…

---

## [Memory management issue (malloc) on macBook Pro M2](https://discourse.julialang.org/t/memory-management-issue-malloc-on-macbook-pro-m2/97277)

<div class="topic-metadata">

**Author:** [@mmv](https://discourse.julialang.org/u/mmv)\
**Replies:** 7\
**Last updated:** [April 11, 2023, 12:19am UTC](https://discourse.julialang.org/t/memory-management-issue-malloc-on-macbook-pro-m2/97277 "2023-04-11T00:19:07Z")

</div>

Hi! I’m developing Julia wrappers to the NASA C library Mtk used to manipulate remote sensing data files, available from GitHub - nasa/MISR-Toolkit: an API facilitating the access of MISR standard product files. Here is…

---

## [Accessing json file from CoolProp.jl c interface](https://discourse.julialang.org/t/accessing-json-file-from-coolprop-jl-c-interface/96292)

<div class="topic-metadata">

**Author:** [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Replies:** 1\
**Last updated:** [March 19, 2023, 5:41am UTC](https://discourse.julialang.org/t/accessing-json-file-from-coolprop-jl-c-interface/96292 "2023-03-19T05:41:19Z")

</div>

hi. i’m trying to make a port of some CoolProp functions in julia. The idea is to use the same CoolProp JSON files that have component properties, but read those in the julia side. One problem i see is that the current C…

---

## [Is it possible to predict the serialized size of an object, without serializing it?](https://discourse.julialang.org/t/is-it-possible-to-predict-the-serialized-size-of-an-object-without-serializing-it/94769)

<div class="topic-metadata">

**Author:** [@cadaverous](https://discourse.julialang.org/u/cadaverous)\
**Replies:** 5\
**Last updated:** [February 24, 2023, 4:48am UTC](https://discourse.julialang.org/t/is-it-possible-to-predict-the-serialized-size-of-an-object-without-serializing-it/94769 "2023-02-24T04:48:18Z")

</div>

Hello all! I am pretty much brand new to Julia, and I am trying to write an interface between Julia and a C library that uses MPI. The problem I’m having is that the library needs to be able to pack Julia objects into a…

---

## [Can I export some particular C bindings for GPU drivers to see?](https://discourse.julialang.org/t/can-i-export-some-particular-c-bindings-for-gpu-drivers-to-see/94852)

<div class="topic-metadata">

**Author:** [@heyx3](https://discourse.julialang.org/u/heyx3)\
**Replies:** 0\
**Last updated:** [February 18, 2023, 8:58pm UTC](https://discourse.julialang.org/t/can-i-export-some-particular-c-bindings-for-gpu-drivers-to-see/94852 "2023-02-18T20:58:51Z")

</div>

I’m trying to use ModernGL.jl to make a graphics program. However, my NVidia driver keeps using my integrated graphics instead of my discrete card. I can manually fix this in my driver settings, but I don’t want to have …

---

## [Compile C code with Julia package](https://discourse.julialang.org/t/compile-c-code-with-julia-package/91305)

<div class="topic-metadata">

**Author:** [@PaterPen](https://discourse.julialang.org/u/PaterPen)\
**Replies:** 8\
**Last updated:** [February 13, 2023, 1:02am UTC](https://discourse.julialang.org/t/compile-c-code-with-julia-package/91305 "2023-02-13T01:02:32Z")

</div>

Hi, I am currently thinking about migrating an R package with underlying C/C++ code to a Julia package. However, in the short term the large C/C++ codebase should be reused and therefore is intended to be called from wi…

---

## [What does \`Base.@ccallable\` do?](https://discourse.julialang.org/t/what-does-base-ccallable-do/71194)

<div class="topic-metadata">

**Author:** [@cjdoris](https://discourse.julialang.org/u/cjdoris)\
**Replies:** 2\
**Last updated:** [February 9, 2023, 7:06pm UTC](https://discourse.julialang.org/t/what-does-base-ccallable-do/71194 "2023-02-09T19:06:12Z")

</div>

It’s mentioned in the docs for PackageCompiler (Apps · PackageCompiler) but is not itself documented.

---

## [Retrieving an array from a Ptr{Ptr{Cvoid}}](https://discourse.julialang.org/t/retrieving-an-array-from-a-ptr-ptr-cvoid/93611)

<div class="topic-metadata">

**Author:** [@mmv](https://discourse.julialang.org/u/mmv)\
**Replies:** 11\
**Last updated:** [January 27, 2023, 1:51pm UTC](https://discourse.julialang.org/t/retrieving-an-array-from-a-ptr-ptr-cvoid/93611 "2023-01-27T13:51:52Z")

</div>

Hi! I have a Julia wrapper function that calls a C function from a shared library. This C function updates an output structure databuf, which is an instance of mutable struct MTKt\_DataBuffer nline::Cint nsample…

---

## [Retrieving the contents of C composite types](https://discourse.julialang.org/t/retrieving-the-contents-of-c-composite-types/92749)

<div class="topic-metadata">

**Author:** [@mmv](https://discourse.julialang.org/u/mmv)\
**Replies:** 14\
**Last updated:** [January 11, 2023, 3:17pm UTC](https://discourse.julialang.org/t/retrieving-the-contents-of-c-composite-types/92749 "2023-01-11T15:17:43Z")

</div>

Hi! I wrote a wrapper to a C function that defines its output as a structure, defined as follows in the associated .h file: typedef struct { double lat; double lon; } MTKt\_GeoCoord; typedef struct { MTKt\_GeoCoor…

---

## [How to automatically load typedef and macro definition from .h files of C language?](https://discourse.julialang.org/t/how-to-automatically-load-typedef-and-macro-definition-from-h-files-of-c-language/92790)

<div class="topic-metadata">

**Author:** [@baizhan](https://discourse.julialang.org/u/baizhan)\
**Replies:** 1\
**Last updated:** [January 11, 2023, 3:42am UTC](https://discourse.julialang.org/t/how-to-automatically-load-typedef-and-macro-definition-from-h-files-of-c-language/92790 "2023-01-11T03:42:37Z")

</div>

Hello, I am learning Julia language and trying to use some external C library. Although it is easy to call C functions using ccall, it is quite difficult to handle the different typedef’s and macro define’s of a certain…

---

## [Julia equivalent of C argument \`char \*\*attrlist\[\]\`](https://discourse.julialang.org/t/julia-equivalent-of-c-argument-char-attrlist/92169)

<div class="topic-metadata">

**Author:** [@mmv](https://discourse.julialang.org/u/mmv)\
**Replies:** 8\
**Last updated:** [December 28, 2022, 10:23pm UTC](https://discourse.julialang.org/t/julia-equivalent-of-c-argument-char-attrlist/92169 "2022-12-28T22:23:33Z")

</div>

Hi! I am trying to access from Julia a C function whose header is declared as follows: MTKt\_status MtkFileAttrList( const char \*filename, int \*attrcnt, char \*\*attrlist\[\] ); where the output argument attrlist sh…

---

## [Does the function String() destroy its argument?](https://discourse.julialang.org/t/does-the-function-string-destroy-its-argument/91496)

<div class="topic-metadata">

**Author:** [@mmv](https://discourse.julialang.org/u/mmv)\
**Replies:** 9\
**Last updated:** [December 12, 2022, 9:39pm UTC](https://discourse.julialang.org/t/does-the-function-string-destroy-its-argument/91496 "2022-12-12T21:39:10Z")

</div>

Hi! I am using a C function from an existing shared library to convert a Julian day number into a date and time information in the ISO 8601 format (YYYY-MM-DDThh:mm:ssZ). This C function generates and returns a vector of…

---

## [Julia 1.8.2 message ERROR: LoadError: too many parameters for type](https://discourse.julialang.org/t/julia-1-8-2-message-error-loaderror-too-many-parameters-for-type/91330)

<div class="topic-metadata">

**Author:** [@mmv](https://discourse.julialang.org/u/mmv)\
**Replies:** 4\
**Last updated:** [December 8, 2022, 2:47am UTC](https://discourse.julialang.org/t/julia-1-8-2-message-error-loaderror-too-many-parameters-for-type/91330 "2022-12-08T02:47:16Z")

</div>

Hi! The header file (.h) of a C shared library contains the following declaration: typedef struct { int path; /\*\*\< MISR path number \*/ long long projcode; /\*\*\< GCTP projection code \*/ long long zonecode; /\*\*\< …

---

## [Calling a C function from within a Julia program](https://discourse.julialang.org/t/calling-a-c-function-from-within-a-julia-program/63643)

<div class="topic-metadata">

**Author:** [@mmv](https://discourse.julialang.org/u/mmv)\
**Replies:** 21\
**Last updated:** [December 4, 2022, 9:50am UTC](https://discourse.julialang.org/t/calling-a-c-function-from-within-a-julia-program/63643 "2022-12-04T09:50:33Z")

</div>

Hi! I’m using Julia 1.6.1 on a MacBook Pro and trying to use the MISR-Toolkit library of C functions within Julia programs. This library is maintained by NASA/JPL and available from GitHub at I was able to access func…

[Previous page](https://discourse.julialang.org/tag/c/610.md?match_all_tags=true&tags%5B%5D=c)

[Next page](https://discourse.julialang.org/tag/c/610.md?match_all_tags=true&page=2&tags%5B%5D=c)
