Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assignment from incompatible pointer type #16121

Open
IkeVoodoo opened this issue Oct 19, 2022 · 2 comments
Open

assignment from incompatible pointer type #16121

IkeVoodoo opened this issue Oct 19, 2022 · 2 comments
Assignees
Labels
Bug This tag is applied to issues which reports bugs. Compiler: TCC Bugs/feature requests, that are related to compiling V programs with TCC. Unit: cgen Bugs/feature requests, that are related to the default C generating backend.

Comments

@IkeVoodoo
Copy link

IkeVoodoo commented Oct 19, 2022

V doctor:

OS: windows, Microsoft Windows 11 Pro v22000 64-bit
Processor: 20 cpus, 64bit, little endian, 12th Gen Intel(R) Core(TM) i7-12700H  

CC version: Error: exec failed (CreateProcess) with code 2: The system cannot find the file specified.

 cmd: cc --version

getwd: C:\Users\ike\Documents\GitHub\Viscord
vmodules: C:\Users\ike\.vmodules
vroot: C:\vlang
vexe: C:\vlang\v.exe
vexe mtime: 2022-10-19 20:58:10
is vroot writable: true
is vmodules writable: true
V full version: V 0.3.1 d781396.ffcdac4

Git version: git version 2.36.1.windows.1
Git vroot status: weekly.2022.42-10-gffcdac42
.git/config present: true
thirdparty/tcc status: thirdparty-windows-amd64 125e21e2

What did you do?
v -g -o vdbg cmd/v && vdbg main.v

module main

import vicord

fn main() {
	mut client := vicord.create_client()

	client.login('hello') or {
		eprintln(err)
		exit(1)
	}
}

What did you expect to see?

Compilation success, and upon running some debug statements (such as connection opened)

What did you see instead?

==================
C:/Users/ike/AppData/Local/Temp/v_0/main.8655114323513122917.tmp.c:1248: warning: assignment from incompatible pointer type
tcc: error: undefined symbol 'CryptAcquireContextA'
tcc: error: undefined symbol 'CryptGenRandom'
tcc: error: undefined symbol 'CryptReleaseContext'
tcc: error: undefined symbol 'gmtime_s'
...
==================
(Use `v -cg` to print the entire error message)

builder error: 
==================
C error. This should never happen.

This is a compiler bug, please report it using `v bug file.v`.

https://github.com/vlang/v/issues/new/choose

You can also use #help on Discord: https://discord.gg/vlang

@spytheman
Copy link
Member

As a workaround, compile with gcc or msvc, i.e. pass -cc gcc too.
You can download a working gcc from https://winlibs.com/ .

@spytheman spytheman self-assigned this Oct 20, 2022
@spytheman spytheman added Compiler: TCC Bugs/feature requests, that are related to compiling V programs with TCC. Bug This tag is applied to issues which reports bugs. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. labels Oct 20, 2022
@IkeVoodoo
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Compiler: TCC Bugs/feature requests, that are related to compiling V programs with TCC. Unit: cgen Bugs/feature requests, that are related to the default C generating backend.
Projects
None yet
Development

No branches or pull requests

2 participants