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
C:\v\examples>v run json.v
Frodo: 25
Bobby: 10
0) Frodo
Frodo is registered
1) Bobby
Cannot register Bobby, they are too young
[{"name":"Frodo","age":25,"is_registered":true},{"name":"Bobby","age":10,"is_registered":false}]
C:\v\examples>v -o main.c json.v
C:\v\examples>v run js_dom_cube
C:\v\examples>gcc main.c
| json__encode_Array_main__User
main.c:13229:40: error: invalid initializer
main.c:13230:9: warning: implicit declaration of function 'cJSON_Delete' [-Wimplicit-function-declaration]
13230 | cJSON_Delete(_t2); // del
| ^~~~~~~~~~~~
main.c:13256:9: error: unknown type name 'cJSON'; use 'struct' keyword to refer to the type
13256 | cJSON* _t5 = json__encode_Array_main__User(users);
| ^~~~~
| struct
main.c:13257:39: warning: passing argument 1 of 'json__json_print' from incompatible pointer type [-Wincompatible-pointer-types]
13257 | string _t6 = json__json_print(_t5);
| ^~~
and then get some error , because miss some library, and the correct command to build exe is
C:\v\examples>v -showcc -o main.exe json.v
to generate the correct makefile or cmakefile withc c code and without .o file with all the library source which this project depend on
because when I checked the command showcc generate it includes ".o" file in temp dir
"C:\Users\Administrator\.vmodules\cache\6a\6a1503cbfeea6dfb273b4562f3ab7513.module.builtin.o"
or could it possible just write the command down into the text file the can build and run manually,like this
Describe the feature
and then get some error , because miss some library, and the correct command to build exe is
C:\v\examples>v -showcc -o main.exe json.v
so, it is possible to add a command like this
v -generate-c-project main .
to generate the correct makefile or cmakefile withc c code and without .o file with all the library source which this project depend on
because when I checked the command showcc generate it includes ".o" file in temp dir
"C:\Users\Administrator\.vmodules\cache\6a\6a1503cbfeea6dfb273b4562f3ab7513.module.builtin.o"
or could it possible just write the command down into the text file the can build and run manually,like this
gcc main.c -fwrapv "C:\\Users\\Administrator\\.vmodules\\cache\\6a\\6a1503cbfeea6dfb273b4562f3ab7513.module.builtin.o" -I "C:\\v\\thirdparty\\libgc\\include" ... -std=c99 -D_DEFAULT_SOURCE -municode -ldbghelp ...
Use Case
generate the correct c or cpp project and know how to work with existing c and cpp project
Proposed Solution
No response
Other Information
No response
Acknowledgements
Version used
V 0.4.3 cd337e2
Environment details (OS name and version, etc.)
Windows 10
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.
The text was updated successfully, but these errors were encountered: