Tag Info

Hot answers tagged

28

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.


17

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


16

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


15

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


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


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.


11

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


10

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


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


7

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


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


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


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

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.


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

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

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


5

I hope this is what you are looking for: http://developer.ubuntu.com/resources/platform/api/


5

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


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


5

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


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

the "Official" gnome IDE for C/GTK development is anjuta, though many like the alternatives


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

That folder includes the header files for C compilers. Such as "stdio.h", "stdlib.h" etc. When you type header information in the C source file such #include <stdio.h> the compiler will look for the file in /usr/include directory by default. big_endian.h and little_endina.h files are included, because though your computer may be of only one kind, you ...


4

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



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