> For the complete documentation index, see [llms.txt](https://docs.sannybuilder.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sannybuilder.com/troubleshooting/errors/0126.md).

# 0126: Can't export a foreign function definition

Compiler found a [foreign function](/language/functions.md#foreign-functions) definition combined with the `export` keyword:

```swift
export function foo<cdecl, 0xC0DE000>() // Error: Can't export a foreign function definition foo
```

#### Possible solutions:

* remove `export` keyword

```swift
function foo<cdecl, 0xC0DE000>()
```

* make a local SCM function and export it instead:

```swift
function foo<cdecl, 0xC0DE000>()

export function foo_wrapper()
  foo()
end
```
