Tag Info

Hot answers tagged

11

The debtags package could be useful for this. debtags search devel::lang:c This will list all packages which have been tagged as written in C. apt-cache rdepends libc6 will show you all packages that depend on libc6.


10

Since you're running an executable in the current working directory, you should prefix it with ./. So for your program run it as ./a.out. Explanation The terminal searches for executables in $PATH. This is a Unix environment variable that lists directories containing system binaries (such as ls, echo, or gcc). If you call an executable that's not in a ...


8

I've asked the question on the ayatana mailing list and received an answer from Ted Gould: Unfortunately that's not possible today. It's been our intention to support custom menu items in dbusmenu so that you could do anything that your app needed for your application indicator (including using IDO) but I haven't found the time yet to complete it ...


8

These files are actually called stdin, stdout and stderr. The @ character is added by ls to tell you that they are symbolic links. ls -l would reveal that the targets of these symbolic links are /proc/self/fd/0, /proc/self/fd/1 and /proc/self/fd/2. /proc is a virtual filesystem provided by the kernel that shows information about the operating system. Among ...


6

You can not "convert" a program written on C or Java in order to run as a bash script. Bash uses different syntax, so most likely you will have to rewrite the logic on a bash script. Now if you are only asking about how to execute a program written on Java/C via the command line, then the answer is pretty simple. For C: Editor Choice Now in order to ...


6

Depending on library, ubuntu stores its libraries mainly in three locations /lib /usr/lib /usr/local/lib Following is from File System Hierarchy Standard /lib The /lib directory contains those shared library images needed to boot the system and run the commands in the root filesystem, ie. by binaries in /bin and /sbin. /usr/lib ...


6

When you run commands on Linux it searches all the directories listed in the PATH environment variable, and if it doesn't find the command there then you get the message you've seen. Typically it looks like this: PATH=/usr/local/bin:/usr/bin:/bin That means it will look first in /usr/local/bin. If it doesn't find it there it'll look in /usr/bin, and so ...


5

There are several issues with your test source package. My guess is that you are trying to compile using slightly older C++ standards (gcc instead of g++) and probably based on a Windows routine (using conio) I've tidied up the test program for you: #include <iostream> /* dont need .h */ using namespace std; /* use a namespace */ /* #include ...


5

Check out the Python example in the Unity developer documentation, and try hello-unity (only compatible with Ubuntu 12.04). These are good places to start. Here's some bit of Python code that will make your app's icon wiggle in the launcher. It's for Ubuntu 12.04, but looking at the API documentation, it should also work for 11.10. from gi.repository ...


5

You can install libncurses5-dev package via Software Center or: sudo apt-get install libncurses5-dev Also, you can install the package by clicking here. When you need a file or package and can't find it you can use some tools. 1. apt-file First, install apt-file and update it. sudo apt-get install apt-file apt-file update You can search with ...


5

I came to Linux from a Win32 API background. Because Windows wraps up the equivalent of the Linux window manager and desktop environment into a single container, there just isn't a one-to-one match. Gtk and Qt really are more or less the equivalent to the Win API. Keeping in mind that the Win API itself in most cases is a wrapper on lower levels, if you ...


4

Why the code generates warnings You want to pass temp_str without the & since arrays are passed by reference by default. If you need to pass a specific member i of the array, you can pass &temp_str[i] without warnings, including &temp_str[0]. Why the code compiles on openSUSE but generates a warning on Ubunutu I have both openSUSE 12.2 and ...


4

I looked at your video and saw the problem in your program source. The reason you are getting this error is because you are using: #include <stdio> #include <stdlib> You should be using: #include <stdio.h> #include <stdlib.h> ..use these corrections in your program and it should now compile.


4

The library is working just fine. The program reports the correct value even when run under gdb. The bug seems to be in the way that gdb is evaluating the expression and forcing the target program to call the function. I'm seeing this same behavior on 10.04 as well. Strangely p printf("foo\n") correctly prints 4. It seems that gdb is confused because ...


4

Valgrind is installable from repository(tested on 12.04 running kernel 3.2.x). sudo apt-get install valgrind. Also available in 11.10 according to this. Just an additional note, it's not a debugger. It's a memory fault detector.


4

You were in your home folder (/home/law) when you issued the g++ first.cpp command. But first.cpp is located in the sourcecodescpp folder. To compile first.cpp, you must either enter the folder that contains it: cd sourcecodescpp (Then the output file will, by default, be created inside sourcecodescpp.) Or qualify its name with the name of the folder ...


4

Ok, I did intsall libc6-dbg like so sudo apt-get install libc6-dbg and valgrind seems to work fine. Thanks to the ubuntu forum link: http://ubuntuforums.org/showthread.php?t=1017692


4

This question has been asked here before: http://stackoverflow.com/questions/2306972/is-there-any-way-to-decompile-linux-so. Anyway, you can't get back your original code, or to quote Carlos GutiƩrrez: "You can make hamburgers with a cow, but you can't make a cow with hamburgers". A *.so file is a compiled shared object (roughly equivalent to a dll in ...


3

As far as I know, graphics.h is an old obsolete Borland C++ header file for graphics in Ms DOS OS. I think the last Borland C++Builder no longer supported graphics.h. However graphics.h has been simulated for Windows. Executables made using graphics.h usually don't work in newer PCs (and laptops with Windows OS). (Although graphics.h has simple to use ...


3

TL;DR: If you are running the 64-bit version of Ubuntu and you're invoking GCC as gcc (for C) or g++ (for C++), you need not be worried about the presence of libc-i386 on your system. A 64-bit system with a working compiler will produce binaries that link against the proper, 64-bit version of libc. Does libc6-i386 compile 64-bit executables? libc-i386 ...


3

Yes, you should use a text editor, for example gedit which is installed in Ubuntu by default. LibreOffice Writer is a text processor and it saves its files with some additional markup which C compiler does not understand. To run gedit, press the Super (Win logo) key and type "gedit". Apart from saving the program in plain text format, you will also need to ...


3

Essentially, the a.out is created by default because you didn't specify a name for the executable. Try this instead: gcc HelloWorld.c -o HelloWorld Once you do that, you should be able to invoke it by (as Sunil suggested) prefacing "HelloWorld" with a dot-slash(./): ./HelloWorld Here's a link to an article that explains a little bit about why the ...


3

Based on your comments to your question, I think what you are really asking is "How do I install a custom library I wrote and where should I put it?" In general, things built locally for others on the machine to user are put into the /usr/local tree. The header file should go into /usr/local/include. The compiled library should go into /usr/local/lib. ...


3

Find package from file Edit: This only works for an installed package, so is not able to answer the question. Better is heartmagic's answer To find out what package a file is part of, you can use dpkg -S <file name> For example, dpkg -S curses.h gives me this output: libncurses5-dev: /usr/include/ncurses.h libncurses5-dev: /usr/include/curses.h ...


3

Some port numbers are often/traditionally/by default used by certain services. Port 80 is for HTTP server, port 22 is SSH, port 143 is IMAP etc. Port 10000 is traditionally used by webmin to display its management interface, while port 20000 is for webmin's web mail. lsof just tries to be friendly by displaying human-readable names of services which usually ...


3

The Borland Turbo C++ compiler is no longer available. On Linux, a C++ compiler is provided by the GNU Compiler Collection, which you can get by installing the 'build-essential' package. Many Ubuntu applications are actually written in C++. You can edit your code with a simple editor (e.g. Gedit) and complile from the command line (command g++). Or you can ...


3

The wait() system call suspends execution of the calling process until one of its children terminates. wait() returns the pid of the child whose state is changed(or say terminated). It returns -1 in error ( when there is no child to wait for ). So the while loop will be executed 0 times in child (forked) process. And in parent process it will be executed n ...


3

This is really because your C code is broken, its not the fault of Ubuntu or anything else. Here's a few tips on how to fix it to work though, and how to compile it. system("pause"); don't do it. Avoid system calls, as they hard-code a requirement of the end system (which doesn't exist on Linux) gets(b[top].name); should be replaced by scanf("%s", ...


3

The difference between amd64 and i386 is that amd64 is 64-bit while i386 is 32-bit. This is the width (in bits) of registers available in the core. Basically the largest number that a 32-bit CPU core can handle in one go is a little over 4.29 billion while a 64-bit core can handle a number of a bit over 18.44 billion, billion. The cores in modern PCs ...



Only top voted, non community-wiki answers of a minimum length are eligible