compiler: pass -shared to build a .so file from a module

pull/3994/head
Delyan Angelov 2020-03-11 18:31:20 +02:00 committed by GitHub
parent 01004bc5d8
commit dff17ee0d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -487,7 +487,7 @@ pub fn (v mut V) generate_main() {
cgen.genln('$cgen.fn_main;')
v.gen_main_end('return 0')
}
else if v.v_fmt_file=='' && !v.pref.is_repl {
else if v.v_fmt_file=='' && !v.pref.is_repl && !v.pref.is_so {
verror('function `main` is not declared in the main module\nPlease add: \nfn main(){\n}\n... to your main program .v file, and try again.')
}
}