avain and c++ 11

49 views
Skip to first unread message

John Bankert

unread,
Aug 17, 2016, 7:03:54 PM8/17/16
to Avian
All,

I'm having some trouble with Avian and certain C++ 11 calls, and wondering if anyone has come across them.

All of the following are causing the program to crash.

#include <iostream>
jbyte *jbyteArray = new jbyte[size];
std::copy(a, b, c);

I've added -std=c++11 to the Makefile in the extension directory which fixes compilation issues and successfully build a final executable, but when I run the executable it terminates FYI, I'm on windows pro 7 64bit, and using Cygwin 64bit v 4.9.2. Java is 1.8.0_92. 

C/C++ isn't my strong suit, so I don't know if I'm missing a compiler switch, a library, or what. Any suggestions appreciated. Thanks.

Joshua Warner

unread,
Aug 17, 2016, 8:10:42 PM8/17/16
to Avian
Hi John,

Can you be more specific as to what the crash looks like?  (i.e. post the output)  If possible, attach a debugger and grab a stack trace.  (e.g.:  `gdb --args <program> <arguments>`, followed by `run` and `backtrace` commands at the prompt.)

Also, can you clarify how avian is involved?  Is this a problem on an unmodified master version of avian, are you trying to embed avian into your own program, or perhaps link in an external C/C++ library?

We're currently using -std=c++0x, since that seems to give the broadest range of compatibility across compilers (with a special case for clang of -std=c++11, it seems).  What version of gcc are you using?  I wonder if it's time we switch to -std=c++11 across the board?

-Joshua

--
You received this message because you are subscribed to the Google Groups "Avian" group.
To unsubscribe from this group and stop receiving emails from it, send an email to avian+un...@googlegroups.com.
To post to this group, send email to av...@googlegroups.com.
Visit this group at https://groups.google.com/group/avian.
For more options, visit https://groups.google.com/d/optout.

John Bankert

unread,
Aug 19, 2016, 4:25:00 PM8/19/16
to Avian
Joshua,

I was getting a return code 127. Turns out the issue was solved by someone else I'm working with. Adding the flags --static and --static-libstdc++ during linking took care of things. Thanks for taking the time to reply!

John
Reply all
Reply to author
Forward
0 new messages