cpan Wx command failing #informational #windows


I had originally tried to run this over a week ago and I ended up closing the command prompt window because, after 20 minutes, it appeared nothing was going to fully execute. I later learned that this can take considerably more time, so I decided to try again a couple of days ago.

In the past two days I have repeatedly run "cpan Wx" at the command prompt of my Windows computer only to have it repeatedly fail. I have no idea of this information is helpful, but these are the last few lines that show up on the screen just before it ends:

C:\Strawberry\perl\site\lib\Alien\wxWidgets\msw_3_0_2_uni_gcc_3_4\include/wx/hashmap.h:121:25: note: in expansion of macro 'calloc'
         return (void **)calloc(sz, sizeof(void*));
gmake[2]: *** [Makefile:343: DocView.o] Error 1
gmake[2]: Leaving directory 'C:/STRAWB~1/cpan/build/Wx-0.9932-3/ext/docview'
gmake[1]: *** [Makefile:499: subdirs] Error 2
gmake[1]: Leaving directory 'C:/STRAWB~1/cpan/build/Wx-0.9932-3/ext'
gmake: *** [Makefile:649: subdirs] Error 2
  C:\STRAWB~1\c\bin\gmake.exe -- NOT OK
Stopping: 'install' failed for 'Wx'.

Anyone know why this isn't working?

Johan Vromans

Yes, unfortunately... The newest version(s) of perl have added a macro for calloc that conflicts with the memory allocation of Wx. Wx hasn't been upgraded for that.

A small change is required to Wx-0.9932-3\cpp\wxapi.c: somewhere around line 135, there is

  #undef malloc
  #undef open

insert between these a line with #undef calloc:

  #undef malloc
  #undef calloc
  #undef open

So, from the command shell:

cd \Strawberry\cpan\build\Wx-0.9932-3
...edit cpp\wxapi.h as shown above...
gmake install


You might as well be speaking Vulcan to me, Johan! You seem to be indicating that a file is to be edited through the addition of a single line. I could do that if I knew what file I was editing and how I might get such a file. It appears the filename is wxapi.c but I only have the filename wxapi.h presently on my computer. Please provide some succinct instructions, my friend!

Johan Vromans

Yes, cpp\wxapi.h is the right file. Sorry for the confusion.

Johan Vromans

As you may have noticed, ChordPro 0.976 has been released with new installers for Windows. You can now use all the new stuff without compiling.


Where might I find such a thing? Everything here seems to be versions prior to .976.

Johan Vromans

Development and releases are on the Github site:

Sorry for the confusion.



Thanks for that bit of info. I have successfully downloaded that latest version and have been able to run it - and am, as expected, really stymied by the GUI version and its lack of flexibility and breadth. This leads me to trying out the command line version and seeing what I can come up with from there. I'm a long-time computer guy and am somewhat familiar with such programs and how they operate. However, while your documentation is very complete in the sense that it covers all of the possible configurations and switches and such, it seems to omit any examples from which I might derive some further information. Perhaps they exist but I didn't know about them. Providing some actual example command lines and explanations of what the output might be would be very helpful to me.

I have created a single chordpro file which I can use to do my command line experimentation. It looks fine in the GUI version of the software. Each command line run generates an informative error message - which is good because it gives me enough information to learn from! My last try was:

chordpro yellow submarine.cho --output=yellow submarine.pdf

Unfortunately, this generated the error message "Undefined subroutine &File::LoadLines::croak called at C:/Strawberry/perl/site/bin/../lib/File/ line 113." which is totally mystifying. It would appear that my command line syntax - correct or not - is being stopped by something else! Perhaps you can inform me of what's going wrong here.

Looking ahead, I'm hoping that you could provide or point to an example JSON file or two so that I might use it as a reference for eventually putting some settings into a file rather than the command line.


Johan Vromans

chordpro yellow submarine.cho --output=yellow submarine.pdf

May I assume you quoted the filenames, since they contain spaces?

chordpro "yellow submarine.cho" --output="yellow submarine.pdf"

In this particular case the default output for "yellow submarine.cho" is "yellow submarine.pdf" so you can leave out the --output part.

If you have strange results with a particular input, please attach the offending input file (and config, if appropriate) so we can see what happens.


Nope. I didn't have double quotes embracing the file names, so that's why it wasn't working! Incidentally, the command chordpro "yellow submarine.cho" "yellow submarine.pdf" elicits this error message: Please use "--output" to specify the output file name 

I'm still optimistically hoping to see some example command lines and an example JSON file or two!


If you leave out the  --output parameter from the command chordpro "yellow submarine.cho" --output="yellow submarine.pdf" you leave out the entire parameter not just the parameter name, so the command becomes chordpro "yellow submarine.cho"

Johan Vromans

Attached are four font config samples.
fc1.json: Uses all built-in fonts
fc2.json: Uses truetype fonts (linux, note that your font locations may differ)
fc2w.json: Uses truetype fonts (Windows10)
fc3.json: Uses system fonts

You can use them from the command line:

chordpro --config fc1.json song.cho

If you already have your private config, put it before, e.g.

chordpro --config chordpro.json --config fc1.json song.cho