Closed tapir closed 7 years ago
May I ask what is $? Is that a macro?
Oh. Nice find. So there are a couple things going on here.
$$(JSONSerialization, objectWithContentsOfFile, ..)
is failing in a very unfriendly way../Examples/Hello
is not an executable, but rather a libtool wrapper script. The actual executable is ./Examples/.libs/Hello
."./HelloViewController.json"
This should be working now. Please close if it works for you.
Can't build Hello example
HelloViewController.c: In function ‘loadView’:
HelloViewController.c:186:21: error: invalid initializer
Outlet outlets[] = MakeOutlets(
^
Hmm.. I don't know what happened on my linux machine but in windows I could compile it
Assertion failed: read == 1, file Data.c, line 174
Err, well that's interesting, on both fronts. I tested the example on Debian Jessie, and it compiled cleanly and ran. As for Windows, that's bizarre. So it opened the file, and sought to the end of the file, but then failed to read it??
Does fread on Windows always return bytes read, rather than elements of size
read?
@tapir I updated the call to fopen
to specify "rb"
, so hopefully this returns the right value now. Could you re-test the Hello example?
I'll test this on my linux machine so it might take couple days
This after running the libtool generated Hello script
INFO: View:bindView: Instantiating View of class Panel
INFO: View:bindView: Instantiating View of class Button
INFO: View:bindView: Instantiating View of class Button
INFO: View:bindView: Instantiating View of class Button
INFO: View:bindView: Instantiating View of class Input
INFO: View:bindView: Instantiating View of class Checkbox
DEBUG: View:bindView: Replacing View Control@0x1d96770 (0,0) 0x32 with Checkbox@0x1d96ee0 (0,0) 0x32
INFO: View:bindView: Instantiating View of class TextView
INFO: View:bindView: Instantiating View of class Select
INFO: View:bindView: Instantiating View of class Slider
INFO: View:bindView: Instantiating View of class TableView
INFO: View:bindView: Instantiating View of class CollectionView
Segmentation fault (core dumped)
And this is bt of the exe produced with gcc -o Hello.bin Hello.c HelloViewController.c -lGL -lGLU -lSDL2 -lObjectively -lObjectivelyMVC
#0 0x00000000400a1e68 in ?? ()
#1 0x00007fffee88bbb4 in ?? () from /usr/lib/libnvidia-glcore.so.370.28
#2 0x00007fffee4721c8 in ?? () from /usr/lib/libnvidia-glcore.so.370.28
#3 0x00007ffff6ea8ffa in ?? () from /usr/lib/libObjectivelyMVC.so.0
#4 0x00007ffff6eaecf4 in ?? () from /usr/lib/libObjectivelyMVC.so.0
#5 0x00007ffff6ea8a77 in ?? () from /usr/lib/libObjectivelyMVC.so.0
#6 0x00007ffff70bcb13 in ?? () from /usr/lib/libObjectively.so.0
#7 0x00007ffff6ea892e in ?? () from /usr/lib/libObjectivelyMVC.so.0
#8 0x00007ffff6eb01f1 in ?? () from /usr/lib/libObjectivelyMVC.so.0
#9 0x000000000040130a in main ()
Not much info I'm afraid?
Try -O0
to see if maybe we can get some line numbers out of that backtrace?
This is strange. I can run the example on OS X and Debian, and I know Paril runs it on Win10 / VS.
Uh I forgot the -g flag for debug info, here is the culprit
#9 0x000000000040130a in main (argc=1, argv=0x7fffffffe2c8) at Hello.c:88
88 $(windowController, render);
Is this still happening?
Here is the backtrace.
This line seems to be the culprit
this->panel = (Panel *) $$(View, viewWithContentsOfFile, "HelloViewController.json", outlets);