So i have installed the latest version of polyml on my mac . How can I run the compiler to start using it??
for sml it is farily simple, i just type 'sml' and it starts working?
rlwrap poly
will make your life easier
Related
I've got an error ".gdbinit: No such file or directory." when trying to debugging in Omnet++ 4.2.2 in Ubuntu 12.4. It seems that the debugger cannot find ".gdbinit", or the find the one not compatible. So where can I find ".gdbinit" in my PC, or where should I find the right version of it to replace? Any idea would be appreciated!
Danh
Hi all, I have alternative solution for my problem and would like to write here for those who need to refer later. Instead of using gdb we can use valgrind. As my understanding, it is pretty good tool to detect bug related to memory allocation. To use valgrind in Omnet, you must make sure to have it installed in your OS (e.g., in Ubuntu, just type sudo apt-get install valgrind). Then in Omnet IDE, simply choose Profile As.. instead of Debug As.. then choose Omnet++Simulation, then trace bugs in valgrind windows. I did find where my bug is by this way.
Thanks.
Danh
I am trying to view the contents of C++ STL Containers. I read here that the recent versions of gcc and gdb support pretty printing by default but when I tried to display a map I got the following:
Then, I tried to set up pretty printing according to this answer but still it shows the same output. Can someone please help me out? Thanks.
I am using Ubuntu 16.04, g++ 5.4.1, GDB 7.11.1 and python 2.7.12 (installed from their official sources).
It was stated in the other thread you mentioned that some versions of GDB work with Python 3 only.
That can be ruled out as possible reasons since you don't receive any errors as far as your description says.
Over at sourceware.org it is suggested that
You can extend gdb using the Python programming language. This feature is available only if gdb was configured using --with-python.
Not sure if you did because the guides you used don't mention it directly.
Mark was correct. I built my own version of gdb 8.0 with --with-python option but still I was not able to see container contents. gdb was showing all complex structure. So I followed Mark's suggestion.
You need to create a soft link (auto-load) in your gdb install directory.
If your gdb install directory is $HOME/gdb_install then
cd $HOME/gdb_install/share/gdb
ln -s /usr/share/gdb/auto-load auto-load
/usr/share/gdb/auto-load already exists on my Ubuntu installation. It's the gdb version 7.11.1.
After that gdb is showing container contents. Thanks Mark.
The gdb native to Ubuntu 16.04 should be able to pretty print a std::map; the python code which handles that is class StdMapPrinter in the following file from the libstdc++6 package:
/usr/share/gcc-5/python/libstdcxx/v6/printers.py
If your goal is to accomplish this with binaries you build from source, it might still be useful to get this working with the native Ubuntu packages first, as a basis for comparison. The likely reason pretty printers are not working in a gdb you built yourself is that libstdcxx/v6/printers.py (libstdcxx.v6.printers in the python namespace) is not where gdb expects to find it.
Also, the gdb native to Ubuntu 16.04 is linked against python3, not python2; one way to see that is in the output of
ldd /usr/bin/gdb
It appears that the libstdcxx.v6.printers native to Ubuntu 16.04 is intended to work with either python2 or python3.
If your native gdb binary is not already installed, you can use this:
apt install gdb
I have a macbook and i'm studying C++ myself. I cant practice it because i don't know how to get eclipse working. Can someone show me exact steps to install eclipse on mac(preferred pictures with notes). Thanks
Download Eclipse CDT, unzip it, then "double click" on the "Eclipse" icon in the unzipped folder. This should do it. If you want the debugger to work, that's a different story, you have to use g++ with gdb (Eclipse doesn't work with lldb), so you need to install g++ and gdb and code-sign the latter. Easiest way to install them is via macports.
PS: to get Eclipse working you need a Java virtual machine, see here how to install it for Yosemite.
BTW: check out the CLion IDE from JetBrains, I find it quite nice. Or, if you want to stick to clang++ use XCode. The only downside in that case is the IDE (I'm not super excited about XCode) and clang++'s lack of OpenMP (which for me was extremely important). You can make OpenMP work with clang++, but it is a pain.
I got a new Macbook Air and installed XCode 5 on it. To my surprise Apple does no longer ship gdb with the command line tools. As I am doing lots of c++ coding I am dependent on a good debugger.
What I tried so far:
Install gdb 7.6 via macports and signed the binary.
Debugging from QT-Creator is possible. It stops at the breakpoints but I see no information at all about the stack. Using lldb not possible, I get a weird python error.
Debugging from Netbeans is not possible at all. The Debugger is not stopping at any breakpoint. Apart from that Netbeans is not working with lldb.
Working with XCode is no problem. Everything works as expected.
Problem is I need an IDE that can do remote debugging as I have several Raspberry Pi projects. Developing software directly on the pi with vim is fun but not suitable for bigger projects.
So the question is, has anyone a working debugger on Mountain Lion with XCode 5 installed? IDE in question needs to support remote debugging (eg QT-Creator, Netbeans, Eclipse)
Thank you!
Install Xcode 4.6.3. If you have a developer's account it's available for download at http://developer.apple.com
Encountered the same problem. Finally installed command line tools from xcode 4.6.1 on ML. This package is available on Apple site. It installed GCC-LLVM 4.2.1 and GDB 6.5. Qt Creator was able to build application and start debugging. Debugging is not stable too much; but i can to see call stacks, values and stop on breakpoints. I use it for 32bits build - maybe it matters.
You could also switch from GDB to using the LLDB debugger (although the Qt support is early for this).
See http://stanford.edu/~rawatson/lair/mac.html
how do you use the terminal on mac os 10 to write and compile c++ code?
I have a power mac with the power pc chip/with leopard.
First, make sure you've got Apple's developer tools installed. They may be on your Mac OS X install disk as well, if you don't feel like downloading. (although you may get an older version) After that, cd to where your code is and do something similar to this:
g++ -o my_executable my_cpp_code.cpp
You can then run it like this:
./my_executable
The simplest text editor included with Mac is nano. It's pretty self-explanatory. Once you've saved the source file, just run g++ my_source_file.cpp -o my_program_name to compile.
However, I recommend using the XCode IDE. The old version 3.2 is a 600 MB download, or the new 4.0 is $5. Even though it's not the best, you will have a much better time with it than learning the command line from scratch. And if you install the compiler using Apple's installer in the first place, you already have it.