IRC Logs

Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2015/05/30)20150531 
rnd5233 hello10:10.14 
ghostbot Welcome to #ghostscript, the channel for Ghostscript and MuPDF. If you have a question, please ask it, don't ask to ask it. Do be prepared to wait for a reply as devs will check the logs and reply when they come on line.10:10.14 
Robin_Watts rnd5233: You were asking about mujs the other day?10:17.40 
  The main developer for it has just disappeared on an extended holiday.10:19.30 
  So while we can try to help you with questions, truly authoratitive answers may take a while.10:20.08 
rnd5233 yeah i did, ok, thank you Robin_Watts 10:32.02 
  im still trying to figure out how it works to be able to implement it10:32.39 
  what is the function that defines the console behaviour?10:32.57 
  nevermind, sorry, jsdump.c10:34.17 
sebras Robin_Watts: agh! the jpegxr reference implementation is not so fun. even gs uses a temporary file for it. :(10:51.26 
  Robin_Watts: the library assumes that you have a FILE* that you can read from.10:51.46 
rnd5233 waw.....11:37.11 
Robin_Watts rnd5233: Sorry, had stepped afk.11:37.23 
rnd5233 do you use codeblocks Robin_Watts ?11:37.34 
Robin_Watts I don't use js :)11:37.44 
  At least, not when I can avoid it.11:37.52 
  sebras: I would imagine that it would be relatively easy to hack/wrap the lib so that the FILE * stuff can be made a void *.11:38.18 
rnd5233 Robin_Watts: what have you used to build mujs on windows?11:39.41 
Robin_Watts rnd5233: It builds as part of the standard mupdf build.11:40.00 
  so there is a msvc project for it.11:40.10 
rnd5233 im using mingw through codeblocks and its autobuild11:40.15 
  ah, right, but i dont have msvc compiler :(11:40.33 
Robin_Watts rnd5233: Well, I don't think there is any magic to it.11:40.47 
  You can get MSVC 2013/2015 for free - see the 'community editions'.11:41.10 
rnd5233 i managed to build the mujs alone, but when im trying to embed it into my project am getting an undefined reference to `js_newstate(vo that shouldn't be there!11:42.03 
  no i cant use msvc :(11:42.20 
Robin_Watts ah, now a direct question like that I may be able to answer :)11:42.39 
  gimme a mo.11:42.50 
rnd5233 ill upload the output, do you want to check the tree?11:43.27 
  the autobuild thing bases the linking in it11:44.02 
  well.. if you check the output it just compiles what's in the tree display11:44.51 
  ill upload both two outputs / standalone and embed11:45.14 
Robin_Watts mujs/jsstate.c contains a definition of js_newstate11:45.27 
rnd5233 this is the standalone http://pastebin.com/5kdrgTiQ11:53.19 
  this another one, my project http://pastebin.com/2CUFd23a11:53.30 
  linking order seems ok, but im getting undef errors!11:53.52 
  going to ask in codeblocks wish they know whats going on cause i have no idea...11:54.22 
sebras Robin_Watts: it is relatively easy, but I wonder why they didn't design it to take both FILE * and void *11:56.23 
  Robin_Watts: I got it working of course.11:56.34 
  rnd5233: can you fins js_newstate() in jsstate.c and js_freestate() in jsgc.c?12:03.35 
  fins -> find12:03.43 
rnd5233 yeah they are there12:04.27 
  im using the same "untouched" files off the standalone test12:04.43 
sebras rnd5233: does mingw have the nm tool?12:04.49 
  rnd5233: you can use it to find out if a symbol is present in an object file.12:05.09 
rnd5233 let me check the bin/12:05.26 
  sec12:05.27 
sebras rnd5233: might be called something like mingw32-nm.exe in your case.12:05.27 
rnd5233 found nm.exe12:07.54 
sebras rnd5233: run nm obj/Debug/one.o12:10.14 
rnd5233 mingw32-gcc-nm.exe12:10.26 
sebras rnd5233: same, same. :)12:10.33 
  rnd5233: in the output you ought to find the js_newstate and js_freestate functions.12:10.51 
  rnd5233: if everything is good and well they ought to be preceeded by a 'T'12:11.29 
  rnd5233: this means that the function is in the object file and that it is exported so that you can link the object file into your stuff and use the function12:12.00 
rnd5233 http://pastebin.com/5j6Yiajp12:12.24 
sebras rnd5233: if you _do_ find 'T' then the problem must be that you are not linking one.o properly into your project.12:12.29 
rnd5233 000112c7 T _js_freestate12:13.17 
  i think i will finally have to craft a makefile.....12:13.35 
sebras rnd5233: right, and in that last pastebin output you will find js_newstate. so it is not the compilation of one.c that is the problem.12:13.38 
  rnd5233: if you look at the link command in http://pastebin.com/2CUFd23a12:13.51 
rnd5233 lib" -o bin\Debug\milanouncer.exe obj\Debug\main.o obj\Debug\one.o 12:14.17 
  etc...12:14.29 
sebras rnd5233: oh.. I notice that my dear browser has some rendering problems. :) the raw output and the rendered output from pastebin do not match!12:16.16 
rnd5233 :S12:16.48 
  they gave me this link http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F12:17.15 
  do a re-build (or clean before build) really important12:17.48 
  ive manually deleted the obj folders also12:18.02 
sebras rnd5233: in your main.cpp, what header files do you include?12:19.09 
  rnd5233: are they declared extern "C"?12:19.14 
rnd5233 no they are static12:19.45 
sebras rnd5233: from main.cpp you call js_newstate(), right?12:20.05 
rnd5233 ah wait12:20.13 
  http://pastebin.com/1NhK36W712:20.54 
sebras rnd5233: try extern "C" { #include "mujs.h" };12:21.21 
rnd5233 sec12:21.33 
  E:\CB_Projects\milanouncer\main.cpp|1399|error: stray '#' in program|12:23.42 
sebras rnd5233: I think we got a pull request about this recently https://github.com/ccxvii/mujs/commit/4dbda84b9de1024c1a7aa8c2e4b7e214f71f1708#commitcomment-1143943212:24.05 
rnd5233 ah alright12:24.35 
  gonna try12:24.38 
sebras rnd5233: but as was mentioned before the main developer is on an extended leave so I think he never had the time to do anything about that.12:24.39 
  rnd5233: I guess this may affect symbol name mangling but I rarely dabble in C++ so don't take my word for it. ;)12:25.23 
rnd5233 i just have a few c++ classe could refactor them to c struts and try, going to try the flag first12:27.36 
  brb12:27.37 
  sebras: compiled without errors, thank you12:30.50 
  who has posted that patch? is he/she here?12:31.06 
sebras rnd5233: no I don't think so.12:33.25 
rnd5233 ok12:34.14 
sebras rnd5233: judging by the name I guess it is someone in china that attempted to use mujs in a C++ project.12:34.40 
rnd5233 hehe12:35.09 
  i think im missunderstanding what js_dostring do, pushes string, sets global pointer, calls the compiler, pops result. is that right?20:34.18 
  should i use it to compile a script that im storing within a std::string? should i otherwise use the js_dofile to run a script previously saved in a .js?20:36.11 
  should i use js_trap? how do you use to debug the stack?20:39.57 
  am kind of lost lol20:40.24 
  ive tried something like the configuration file example http://mujs.com/docs/examples but can't even get a pointer to the result and convert it and print it20:41.47 
  ill try pushing the script from a file in the standalone tomorrow20:44.33 
  if someone wants to answer me ill check the logs tomorrow in the morning20:45.01 
  gn everyone, thanks a lot!20:45.12 
 Forward 1 day (to 2015/06/01)>>> 
ghostscript.com
Search: