简体   繁体   中英

How to create library for v lang by c++

I would like to ask how to create a module on c++ for v lang. For example

int some_method() {
 return 6
}

In V every file in the root of a folder is part of the same module. Simple programs don't need to specify module name, in which case it defaults to 'main'.

Creating reusable modules is encouraged and is quite easy to do. To create a new module, create a directory with your module's name containing .v files with code:

cd ~/code/modules
mkdir mymodule
vim mymodule/myfile.v

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM