Tag Info

Hot answers tagged

37

apt-get install libcurl4-gnutls-dev or apt-get install libcurl4-openssl-dev depending on whether you want to use gnutls or openssl for SSL.


35

If you are on an amd64 installation, you can try to install the package libc6-dev-i386. This helped me solve the same issue you encountered while trying to compile smm from i8kutils.


22

I got essentially the same message (except that ld-linux-x86-64.so.2 was replaced by ld-linux.so.2). I had installed Valgrind using apt-get so libc6-dbg was already included as a dependency. I haven't fully resolved this yet, but a clue is that the error correlates with my use of -m32 when building. So it would seem that, in my case, the problem is the ...


20

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 ...


19

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 ...


15

The semi colon after the if statement ends the statement so: if ( num1 == num2 ); { printf( "%d is equal than %d\n", num1, num2 ); } is the same as if ( num1 == num2 ){ ; /* Do nothing */ } printf( "%d is equal than %d\n", num1, num2 ); An if statement does the bit following the condition if the condition is met This will work if ( ...


14

Run sudo apt-get install build-essential to install the C compiler.


12

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.


11

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 ...


10

Ubuntu is based on debian. This is an abridgment of Wikipedia: On 6 May 2009, it was announced that Debian would move from the GNU C Library to EGLIBC, citing problems with the development process of glibc. Debian and several of its derivatives now ship EGLIBC instead of glibc. EGLIBC is free software licensed under the GNU LGPL. These are the ...


9

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


9

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 ...


9

You need to qualify your include #include <python2.7/Python.h> Or tell gcc where to find Python.h with the gcc -I /usr/include/python2.7/ program.c


7

You need to install the lapack and libblas. sudo apt-get install build-essential sudo apt-get install liblapack* sudo apt-get install libblas* The real trick lies in calling the library functions and link them. LAPACK Header No special header is required, Only usual headers will be there. #include <stdio.h> #include <math.h> Function ...


7

ls is aliased by default as: ls --color=auto so when ls is in a terminal that supports colour, it uses colour codes. A system() call doesn't happen in a bash session so your aliases aren't evaluated. I'm also not sure what would happen with the automatic detection so I would make it force colourised output by hotwiring the command: system("ls ...


7

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 ...


7

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. ...


7

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 ...


6

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 ...


6

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.


6

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 ...


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

gcc uses the file extension (suffix) to determine the type - did you name your file with a .c suffix? If not, try renaming it - for example if I have a file called 'testc' $ cat testc #include<stdio.h> int main() { printf("THIS is a C-file\n"); return 0; } Then $ gcc -o test testc testc: file not recognized: File format not recognized collect2: ld ...


6

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 ...


6

If you have the vim editor installed, open the file with vim file.c and type ==G to indent the file from begin to end. Then save it with :wq. On default installations, vi (not vim) is installed, this requires the ident package mentioned by karel.


6

(does this really belong here)? Example: using the math library. Create this file with your preferred editor: #include <stdio.h> #include <math.h> //this declare the math library int main() { printf("%f\n", sin(1.0)); // using math and stdio library return 0; } Then you compile: gcc -o test test.c -lm -lc Read: ...


5

You need to provide GCC with the include path for the Python.h header. This can be done with the -I flag: gcc -c -I/usr/include/python2.7 sourcefile.c However, there is a better way: use pkg-config : pkg-config --cflags python This will output the flags that need to be passed to GCC in order to compile applications that use the Python headers and ...


5

Desktop is not located at /Desktop rather it is located at ~/Desktop. Thus execute these commands. cd ~/Desktop (for changing directory to Desktop) gcc hello.c -o hello (for compiling C program) Then execute your application by ./hello , if it shows any error change its permissions with chmod +x hello


5

If you use Ubuntu on 64-bit (I can't text exactly right now on a 32-bit system), then the directory from the question is: /usr/include/x86_64-linux-gnu/sys Now, having this information, you can create symbolic links to those files if you really need them at that location (/usr/include/sys) using this on a terminal: sudo ln -s ...


5

This is probably the wrong site to ask such questions. Nevertheless, here is the answer: *address is pointing to array[0] which you fill with 2. Then, you put the content of address, which is array[0]=2 into array[2], and print it. As a result, you get 2.



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