Skip to content

Cannot compile on linux when import "net" #1602

@RudolfVonKrugstein

Description

@RudolfVonKrugstein

When trying to compile this:

package main

import (
	"fmt"
	_ "net"
)


func main() {
	fmt.Println("Hello")
}

with these comands:

# docker run --privileged --rm -v $(pwd):/src -ti tinygo/tinygo bash
> cd /src
> tinygo run main.go

I get:

# net
../usr/include/netdb.h:617:23: unexpected token ILLEGAL
../usr/include/netdb.h:618:22: unexpected token ILLEGAL
../usr/include/netdb.h:624:23: unexpected token ILLEGAL
../usr/include/netdb.h:625:25: unexpected token ILLEGAL
../usr/include/netdb.h:617:23: unexpected token ILLEGAL
../usr/include/netdb.h:618:22: unexpected token ILLEGAL
../usr/include/netdb.h:624:23: unexpected token ILLEGAL
../usr/include/netdb.h:625:25: unexpected token ILLEGAL
../usr/include/netdb.h:617:23: unexpected token ILLEGAL
../usr/include/netdb.h:618:22: unexpected token ILLEGAL
../usr/include/netdb.h:624:23: unexpected token ILLEGAL
../usr/include/netdb.h:625:25: unexpected token ILLEGAL

I get the same error, when I have included the bluetooth package (https://github.com/tinygo-org/bluetooth).

So I can not compile for linux with the bluetooth package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions