EmperorArthur / VBA-M

The VBA-M project at http://vba-m.com/ is rarely updated. This is a version that will run without requiring old, unsupported libraries. Please treat it as a testing branch before (some) of the changes filter into the main code base.
Other
8 stars 2 forks source link

gvbam will compile but not run in out of tree builds #2

Closed andoruB closed 9 years ago

andoruB commented 9 years ago

Tried compiling myself but only got the CLI executable. Went under ./src/gtk and tried to cmake from there but got this:

CMake Error at CMakeLists.txt:59 (INSTALL): install DIRECTORY given no DESTINATION!

CMake Warning (dev) in CMakeLists.txt: No cmake_minimum_required command is present.

Is there some way to compile the GUI executable?

EDIT: Found GTK and wxWidgets binaries, the GTK one gives this in the terminal:

terminate called after throwing an instance of 'Glib::FileError'

wxWidgets runs, but get notified that it cannot find the configuration file (don't know where to place it actually) and when I try to open any option from the menus I get this:

../src/gtk/scrolwin.cpp(205): assert "scrolled" failed in DoShowScrollbars(): window must be created /usr/include/wx-3.0/wx/object.h(160): assert "wxDynamicCast(ptr, T)" failed in wxCheckCast(): wxStaticCast() used incorrectly Segmentation fault

EmperorArthur commented 9 years ago

You need to build from the top level. That CMakeLists.txt has options for which binary you want to build. If you don't then the shared libraries never get built, and you're probably going to have some issues.

The whole purpose of the CMakeLists.txt files in the src directory is to make the binaries modular. In an ideal world we could rip out any three of the gui binaries by only deleting the directory and removing two or three lines from the top level CMakeLists.txt.

EmperorArthur commented 9 years ago

Also, what platform are you working on? I haven't done any testing on anything but my Linux machine, and there are some platform specific parts in the cmake files.

andoruB commented 9 years ago

Thanks for the answer :)

In CMakeLists.txt I have:

option( ENABLE_GTK "Build the GTK+ GUI" ON ) option( ENABLE_WX "Build the wxWidgets port" ON )

Is that what you were referring to?

And I'm using CrunchBang Linux 11 "Waldorf" with unstable Debian repos.

EmperorArthur commented 9 years ago

Yes, that's what I'm referring to. I'll try to create a readme file with build instructions sometime soon. For now look here: http://vba-m.com/forum/Thread-how-to-build-vba-m-from-the-svn-code-in-linux

One other thing is if you're doing out of tree builds: mkdir build;cmake ..;make then gvbam will not work. I honestly just noticed the issue, and will figure out what's causing the problem asap.

For now you can manually run cmake .;make when you want to clean up all your files you can run git clean -fdX

EmperorArthur commented 9 years ago

I've added more error checking. Now I know that it's looking for '/usr/local/share/vbam/ui/vbam.ui' in out of tree builds. Now I just have to figure out what it's doing for regular builds and fix the issue.

EmperorArthur commented 9 years ago

Problem is in sGetUiFilePath from src/gtk/window.cpp:1540 I'm going to see if cmake exports the source directory to a compiler definition. If it does, then I'll just use that.

EmperorArthur commented 9 years ago

Out of tree builds should now work. Please test and let me know if it works.

andoruB commented 9 years ago

I wish I could check, but git doesn't want to play nice:

$ git clone https://github.com/EmperorArthur/VBA-M.git Cloning into 'VBA-M'... remote: Counting objects: 10568, done. remote: Compressing objects: 100% (8/8), done. remote: Total 10568 (delta 0), reused 0 (delta 0), pack-reused 10560 Receiving objects: 100% (10568/10568), 9.85 MiB | 1.64 MiB/s, done. Resolving deltas: 100% (8054/8054), done. fatal: did not receive expected object 465b3fc65f9bf502e719a5a5c558c797c3a4bc7b fatal: index-pack failed

Any idea what's causing this?

EmperorArthur commented 9 years ago

You managed to catch things at just the wrong time. I occasionally use git gui's amend last commit feature, and force push to the repository. You were probably cloning the thing just as I was making changes.

Just delete the whole directory and try again. I think I'm pretty much done for the night so there shouldn't be any more issues.

andoruB commented 9 years ago

Thanks for the answers, this fix, and all your endeavours :D Retried and now it works :) I the compilation went flawlessly, the GTK flavour of VBA-M works but the wx one doesn't, still get the same errors.

Also when doing a make install I get this:

CMake Error at cmake_install.cmake:48 (file): file INSTALL cannot copy file "/home/andoru/sources/VBA-M/src/sdl/vbam.cfg-example" to "/etc/vbam.cfg".

Makefile:66: recipe for target 'install' failed make: *\ [install] Error 1

So I'm guessing somewhere you hardcoded the paths to install stuff, as I set a custom prefix at the cmake step, set it to install in my home folder.

Also seems that the graphics settings seem a lot less thorough than the VBA-M I remember (under Windows), for example I have no ability to choose a custom scaler for fullscreen (so I would chose 3x and instead have black borders fill the rest of the screen). But I guess this might be due to the limits imposed by the OS. Also the sound settings seem to be lacking as well.

And another issue is that the animations are a bit jerky and there are quite a few frames that are dropped, this is fixed only if I go in fullscreen or turn off compositing, but I guess this is due to the crap integrated video that I use ATM...

Anyway, thanks again for everything :)

EDIT: Forgot to mention that when running the GTK flavour, when the emulator is inactive (no ROM loaded) it takes about 5-10% CPU, any reasons for that?

EmperorArthur commented 9 years ago

Glad to help.

use sudo make install to get around your OS installation issue. (Hope that's the problem)

Honestly gvbam is the worst version. See Bug #4 for more details.

If you'll go ahead and open a new bug report for the wxvbam issue I'll try to find the problem, or at least come up with a nice script to build and install everything for you.

andoruB commented 9 years ago

use sudo make install to get around your OS installation issue. (Hope that's the problem)

Not really, running that with root will only copy those files in their respective folders under / instead of /home/andoru/

Should I make a separate issue for the strange CPU usage too? :)

EmperorArthur commented 9 years ago

Yep. That's the expected behavior of make install. vbam.cfg is the default configuration file for vbam, individual users are supposed to overide it using the -c option. gvbam is also pretty bad in that it doesn't have use the proper icon unless it's installed in the system icon themes directory, and really wants a folder with all its ui elements in its system data directory as well.

wxvbam doesn't need a default and automatically generates a config file in ~/.wxvbam/wxvbam.conf gvbam creates ~/.config/gvbam/config

Don't ask me why it's all set up that way. I just picked all this up a couple of months ago after the original maintainer abandoned it.

EmperorArthur commented 9 years ago

Also if you disable the SDL version it won't install that file.