You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After running any program with gcc, I received this error.
Reproduction Steps
fnmain() {
print("HERE")
}
v -cc gcc run .\main.v
Expected Behavior
Prints "HERE"
Current Behavior
================== C compilation error (from gcc): ==============
cc: C:\\Users\\nikit\\AppData\\Local\\Temp\\v_0\\TE2216~1.C: In function 'builtin___memory_panic':
cc: C:\\Users\\nikit\\AppData\\Local\\Temp\\v_0\\TE2216~1.C:1952:17: error: implicit declaration of function 'fprintf' [-Werror=implicit-function-declaration]
cc: 1952 | fprintf(stderr, "%p", ((voidptr)(size)));
cc: | ^~~~~~~
cc: C:\\Users\\nikit\\AppData\\Local\\Temp\\v_0\\TE2216~1.C:1257:1: note: include '<stdio.h>' or provide a declaration of 'fprintf'
cc: 1256 | #include <float.h>
cc: +++ |+#include <stdio.h>
cc: 1257 | #else
cc: C:\\Users\\nikit\\AppData\\Local\\Temp\\v_0\\TE2216~1.C:1952:17: warning: incompatible implicit declaration of built-in function 'fprintf' [-Wbuiltin-declaration-mismatch]
cc: 1952 | fprintf(stderr, "%p", ((voidptr)(size)));
cc: | ^~~~~~~
cc: C:\\Users\\nikit\\AppData\\Local\\Temp\\v_0\\TE2216~1.C:1952:17: note: include '<stdio.h>' or provide a declaration of 'fprintf'
...
cc: cc1.exe: some warnings being treated as errors
(note: the original output was 36 lines long; it was truncated to its first 12 lines + the last line)
=================================================================
Try passing `-g` when compiling, to see a .v file:line information, that correlates more with the C error.
(Alternatively, pass `-show-c-output`, to print the full C error message).
builder error:
==================
C function `C.fprintf` was declared in V, but the C compiler did not see a matching C declaration for `fprintf`.
A declaration like `fn C.fprintf()` only tells V about an external C symbol; it does not define that symbol or include its header.
Include the C header that declares `fprintf` and add any needed `#flag -I`, `#flag -l`, or C source file.
If there is no header but the symbol is provided by a linked library/object, mark the V declaration with `@[c_extern]`.
Describe the bug
After running any program with gcc, I received this error.
Reproduction Steps
Expected Behavior
Prints "HERE"
Current Behavior
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.5.1 a3c8c55
Environment details (OS name and version, etc.)
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.