Open ccpplinux opened 2 years ago
Hi; are you using Linux ? Windows ?
I am using Manjaro Linux.
First of all, sorry for the delay. Then I can confirm the error. This is a new message, maybe related to a recent change in V "builder" part ? Thanks for your report, more investigation is needed..
In the meantime I figured out that the same mainig example seems to build and run fine, when used within my other sdl test repo (vig is a submodule there)
Could you please try the following ?
Just clone sdl2test: git clone https://github.com/nsauzede/sdl2test.git
And try it : cd sdl2test ; make mrproper all ; ./mainig_v.exe
If that works for you too, then that may indicate that the local build failure within vig has been overlooked because I mostly developed vig as a submodule
Thanks for reply. When I am running the command make mrproper all then I am getting following error:
cc -std=gnu99 -w -I ./thirdparty/stdatomic/nix -o v1.exe ./vc/v.c -lm -lpthread
./v1.exe -no-parallel -o v2.exe cmd/v
cmd/v/v.v:6:1: builder error: bad module definition: cmd/v/v.v imports module "help" but /home/ccpplinux/Nextcloud/VLang/vig/examples/mainig/sdl2test/v/cmd/v/help/help.v is defined as module examples.mainig.sdl2test.v.cmd.v.help
4 | module main
5 |
6 | import help
| ~~~
7 | import os
8 | import term
make[1]: [GNUmakefile:94: all] Error 1
make[1]: Leaving directory '/home/ccpplinux/Nextcloud/VLang/vig/examples/mainig/sdl2test/v'
/home/ccpplinux/Nextcloud/VLang/vig/examples/mainig/sdl2test
touch nsauzede/vsdl2/v.mod
./v/v install nsauzede.vsdl2
make: ./v/v: No such file or directory
make: [Makefile:150: /home/ccpplinux/.vmodules/nsauzede/vsdl2/v.mod] Error 127
Now that is strange. It means that you don't manage to build the same (recent'ish) V version as me..
🤔
Are you able to clone https://github.com/vlang/v.git
and build it manually ? (ie: cd v ; make
)
Yes I am able to install v properly. Even when I am running command v install nsauzede.vsdl2 as per instruction given on the page then it is also installing properly and I am able to run the example with command v run ~/.vmodules/nsauzede/vsdl2/examples/tvintris/tvintris.v. Similarly when I executed the command v install nsauzede.vig then it also worked. However when I am trying to run the command v run ~/.vmodules/nsauzede/vig/examples/mainig/mainig.v then I am getting following error message:
builder error: 'cimgui.h' not found
I think something is wrong with cimgui installation. Can you please give me a hint?
Thanks for reply. When I am running the command make mrproper all then I am getting following error:
cc -std=gnu99 -w -I ./thirdparty/stdatomic/nix -o v1.exe ./vc/v.c -lm -lpthread ./v1.exe -no-parallel -o v2.exe cmd/v cmd/v/v.v:6:1: builder error: bad module definition: cmd/v/v.v imports module "help" but /home/ccpplinux/Nextcloud/VLang/vig/examples/mainig/sdl2test/v/cmd/v/help/help.v is defined as module
examples.mainig.sdl2test.v.cmd.v.help
4 | module main 5 | 6 | import help |~~~ 7 | import os 8 | import term make[1]: [GNUmakefile:94: all] Error 1 make[1]: Leaving directory '/home/ccpplinux/Nextcloud/VLang/vig/examples/mainig/sdl2test/v' /home/ccpplinux/Nextcloud/VLang/vig/examples/mainig/sdl2test touch nsauzede/vsdl2/v.mod ./v/v install nsauzede.vsdl2 make: ./v/v: No such file or directory make: [Makefile:150: /home/ccpplinux/.vmodules/nsauzede/vsdl2/v.mod] Error 127
I think I now understand what happens : you seem to have cloned sdl2test
within vig
, which is itself a V module.
Don't do that. Because that seems to interfere with V compiler modules handling (unrelated to my actual vig
project)
Please rather do this:
$ cd /home/ccpplinux/Nextcloud/VLang
$ git clone https://github.com/nsauzede/sdl2test.git
$ cd sdl2test ; make mrproper all ; ./mainig_v.exe
=> This is to ensure that my current vig
project is working within sdl2test
(which is the primarily dev setup), somewhere else than in my environment.
Then, I could try and figure out what's wrong with other use cases of vig
.
Thanks.
Thanks. Now it is working. I am able to run and view the output of the program mainig_v.exe. Thanks a lot.
Great. Next, I have to investigate more why vig doesn't work when used standalone..
I have been able to get closer, but it appears that the V compiler has indeed changed and will not compile vig.v. See my issue on V's GitHub. I changed the header paths to the full path. I also switched #include <SDL.h>
to `
I should note that I am also on Manjaro Linux too because it's the best ; ).
Hello all.
I pushed some commit to try and fix the issue
Please test & report
Forgot to mention that you should git clone vig and try as below:
$ mkdir -p ~/.vmodules/nsauzede
$ cd ~/.vmodules/nsauzede
$ git clone https://github.com/nsauzede/vig
$ cd vig
$ make
$ v run examples/mainig/mainig.v
Note that separate nsauzede/vsdl2
should first be installed in .vmodules, too..
INFO: compile with
v -live examples/mainig/mainig.v `, if you want to use the [live] function imgui_frame .(Use v -cg
to print the entire error message)
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 `
Thanks!
(sdl2 is installed)
Wow, that did not format correctly 😂, sorry!
@Jah-On can you please perform the following and put back the result ?
$ pwd
$ ls -l
Just to see where you run your command from and whether you have obtained the proper files..
@nsauzede
pwd:
/home/jah-on/.vmodules/nsauzede/vig
ls -l: `total 2424 -rw-r--r-- 1 jah-on jah-on 1072 Nov 13 23:59 LICENSE
-rw-r--r-- 1 jah-on jah-on 1691 Nov 13 23:59 Makefile
-rw-r--r-- 1 jah-on jah-on 820 Nov 13 23:59 README.md
drwxr-xr-x 1 jah-on jah-on 280 Nov 13 23:59 cimgui
-rw-r--r-- 1 jah-on jah-on 169990 Nov 13 23:59 cimgui.h
-rwxr-xr-x 1 jah-on jah-on 1660576 Nov 13 23:59 cimgui.so
drwxr-xr-x 1 jah-on jah-on 12 Nov 13 23:59 examples
-rw-r--r-- 1 jah-on jah-on 3443 Nov 13 23:59 imgui_impl_opengl3.h
-rw-r--r-- 1 jah-on jah-on 30736 Nov 13 23:59 imgui_impl_opengl3.o
-rw-r--r-- 1 jah-on jah-on 1677 Nov 13 23:59 imgui_impl_sdl.h
-rw-r--r-- 1 jah-on jah-on 15456 Nov 13 23:59 imgui_impl_sdl.o
-rw-r--r-- 1 jah-on jah-on 563286 Nov 13 23:59 libcimgui.a
-rw-r--r-- 1 jah-on jah-on 58 Nov 13 23:59 v.mod
-rw-r--r-- 1 jah-on jah-on 4909 Nov 13 23:59 vig.v`
hmm now this is strange; I've got the same kind of results on my Ubuntu 21.10... I'm sorry but I'm afraid I have no clues...
hmm now this is strange; I've got the same kind of results on my Ubuntu 21.10... I'm sorry but I'm afraid I have no clues...
I have an issue on the V repository for cimgui. You should post your findings there and maybe they can tweak the compiler.
I am getting a similar error trying to make on msys2 Windows 10
~/.vmodules/nsauzede/vig
$ make
[ -d cimgui ] || git clone --recursive https://github.com/cimgui/cimgui.git
Cloning into 'cimgui'...
remote: Enumerating objects: 4283, done.
remote: Counting objects: 100% (1014/1014), done.
remote: Compressing objects: 100% (420/420), done.
remote: Total 4283 (delta 742), reused 784 (delta 587), pack-reused 3269
Receiving objects: 100% (4283/4283), 9.57 MiB | 16.99 MiB/s, done.
Resolving deltas: 100% (3117/3117), done.
Submodule 'imgui' (https://github.com/ocornut/imgui.git) registered for path 'imgui'
Cloning into '/c/Users/phcre/.vmodules/nsauzede/vig/cimgui/imgui'...
remote: Enumerating objects: 49563, done.
remote: Counting objects: 100% (10348/10348), done.
remote: Compressing objects: 100% (405/405), done.
remote: Total 49563 (delta 10078), reused 10037 (delta 9943), pack-reused 39215
Receiving objects: 100% (49563/49563), 76.12 MiB | 4.24 MiB/s, done.
Resolving deltas: 100% (38370/38370), done.
Submodule path 'imgui': checked out 'dc3e531ff28450bff73fde0163b1d076b6bb5605'
(export CFLAGS= CXXFLAGS= ; cd cimgui ; mkdir bld ; cd bld ; cmake .. ; make)
-- Building for: Ninja
-- The C compiler identification is GNU 13.1.0
-- The CXX compiler identification is GNU 13.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (2.1s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/phcre/.vmodules/nsauzede/vig/cimgui/bld
make[1]: Entering directory '/c/Users/phcre/.vmodules/nsauzede/vig/cimgui/bld'
make[1]: *** No targets specified and no makefile found. Stop.
make[1]: Leaving directory '/c/Users/phcre/.vmodules/nsauzede/vig/cimgui/bld'
make: *** [Makefile:42: cimgui/bld/cimgui.so] Error 2
\vig\examples\mainig> v run mainig.v
builder error: 'cimgui.h' not found
Solved my issue
I had to change
cmake .. && make
to cmake .. && cmake --build . --target all
When I am trying to run the program vig/examples/mainig/mainig.v then I am getting the error message "builder error: 'cimgui.h' not found" although I have installed imgui as well as cimgui. The file cimgui.h is in the same folder in which mainig.v is saved. So what could be error? How to specify the path of the header file cimgui.h while running program of https://github.com/nsauzede/vig? Please help me so that I can start using this package.