Ubuntu :: Beginner And Compiling Prgrams
Mar 25, 2010
I am a beginner and would like to know how do you compile a program in ubuntu 9.10. I would like to compile freeorion but don't know where to start in compiling any sort of program. Any instructions would be most welcome.
View 3 Replies
ADVERTISEMENT
Jun 14, 2010
I'm new to linux hence would like to know if there are any books that can be helpful in understanding linux from the scratch. Any suggestions would be greatful.
View 13 Replies
View Related
Nov 4, 2010
i have a server which was handover me, it has redhat 4 u3.but i cant find the machine model no, it is hp g4 server, so this info from linux where can i see
2nd if i want to know what is the bios version and date how can i see from linux.
3rd if any hardware failing like network card, ram memory, hard disk how we come to know hardware.
View 5 Replies
View Related
May 5, 2010
I have sendmail setup with sasl and multiple domains.I'm sure there is an easy fix for this but I can send emails to anyuser@<anyofmyvirtualdomains.dom> and it will be accepted. I'm just trying to cut down on any confusion that may occur later. Is it possible "restrict" or classify a user into a particular domain? I've setup virtusertable and aliases but no luck in accomplishing my goal.I've searched to find no particular information on this.
View 1 Replies
View Related
Feb 24, 2011
I am working on uClinux/almost same as Linux. I am new to socket programming. I have two micro controllers running on same code. Simple run with arguments mean send merged string.
run 1st micro controller (Send): ./Name "anystring"
run 2st micro controller (Recive):/Name
My code is:
int receive() {
// Create socket
int sock_fd;
struct sockaddr_in addr;
char buffer[kBufferSize];
int bytes_received=0;
int addr_len = sizeof(addr);
printf("receive start ");
sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
if ( sock_fd == -1 ) {
printf("receive Create ");
// Error occurred return 0; }
printf("Res Create sucee ");
// Create address from which we want to receive, and bind it
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = INADDR_ANY;
addr.sin_port = htons(kPortNumber);
if ( bind(sock_fd, (struct sockaddr*)&addr, sizeof(addr)) < 0 ) {
printf("receive bind "); // Error occurred return 0; }
printf("Bind Succeful sucee ");
while ( 1 ) {
// Receive a message, waiting if there's nothing there yet
bytes_received = recvfrom(sock_fd, buffer, kBufferSize-0, 0,
(struct sockaddr*)&addr, &addr_len);
if ( bytes_received < 0 ) { // Error occurred
printf("receive bytes "); return 0; }
printf(" bytes_received succeful ");
printf("Ressocketstring : %s ",buffer);
memset(Ressocketstring,0x00 , sizeof(Ressocketstring));
strcpy(buffer,Ressocketstring); printf("Ressocketstring : %s
",Ressocketstring); printf(" ");
printf("Hello Receive finished");
// Now we have bytes_received bytes of data in buffer. Print it!
fwrite(buffer, sizeof(char), bytes_received, stdout); } }
int transmit(char * data, int length) {
int sock_fds[kMaxSockets];
// Obtain list of all network interfaces
/* struct ifaddrs *addrs;
if ( getifaddrs(&addrs) < 0 ) {
// Error occurred return 0; } */
// Loop through interfaces, selecting those AF_INET devices that support broadcast, but aren't loopback or point-to-point
struct sockaddr_in addr; int number_sockets = 0; struct hostent *he;
/* const struct ifaddrs *cursor = addrs;
while ( cursor != NULL && number_sockets < kMaxSockets ) {
if ( cursor->ifa_addr->sa_family == AF_INET
&& !(cursor->ifa_flags & IFF_LOOPBACK)
&& !(cursor->ifa_flags & IFF_POINTOPOINT)
&& (cursor->ifa_flags & IFF_BROADCAST) ) {
// Create socket*/
sock_fds[number_sockets] = socket(AF_INET, SOCK_DGRAM, 0);
if ( sock_fds[number_sockets] == -1 ) // Error occurred {
printf("Error Create "); return 0; }
he = gethostbyname((char *)BCASTADDRESS) ;
if (he==NULL ) {printf("Error gethostbyname ");
herror("gethostbyname"); printf("Error host "); exit(1);
} printf("Res He ");
// Create address from which we want to send, and bind it
memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET;
addr.sin_addr = *((struct in_addr *)he->h_addr);//((struct sockaddr_in *)cursor->ifa_addr)->sin_addr; addr.sin_port = htons(kPortNumber);
if ( bind(sock_fds[number_sockets], (struct sockaddr*)&addr, sizeof(addr)) < 0 )
{ // Error occurred printf("Error bind "); return 0; }
// Enable broadcast int flag = 1;
if ( setsockopt(sock_fds[number_sockets], SOL_SOCKET, SO_BROADCAST, &flag, sizeof(flag)) != 0 ) // Err occur { printf("Error Enable "); return 0; }
number_sockets =1; printf("Succes 1 "); printf("transmit Create ");
// Initialise broadcast address memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET; addr.sin_addr.s_addr = INADDR_BROADCAST;
addr.sin_port = htons(kPortNumber);
// Send through each interface int i;
for ( i=0; i<number_sockets; i++ ) {
if ( sendto(sock_fds[i], data, length, 0, (struct sockaddr*)&addr, sizeof(addr)) < 0 )
{ printf("Error Send "); // Error occurred return 0;
} printf("Succes 2 "); } return 1; } void MergeMessage( ) {
memset(socketstring,0x00,sizeof(socketstring));
sprintf(socketstring,"%s@%s@%s@%s@%s@%s@%s@%s@%s@%s@%s
",Tmeg.s1,Tmeg.s2,Tmeg.s3,Tmeg.s4,Tmeg.s5,Tm eg.s6,Tmeg.s7,Tmeg.s8,Tmeg.s9,Tmeg.s10,Tmeg.s11);
printf(" MergeSocketMessage : %s ",socketstring); }
int main (int argc, char** argv) {
int fd=0,bdc=0; struct ifreq ifr; printf("Tsarting man ");
fd = socket(AF_INET, SOCK_DGRAM, 0);
strncpy(ifr.ifr_name, "eth0", IFNAMSIZ-1);
ioctl(fd, SIOCGIFADDR, &ifr); close(fd);
memset(MYIP,'-',sizeof(MYIP));
memset(BCASTADDRESS,'-',sizeof(BCASTADDRESS));
strcpy(MYIP, inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr));
printf("Etho: %s ,len:%d ", MYIP,strlen(MYIP));
for(bdc=strlen(MYIP);MYIP[bdc-1]!='.';bdc--) {}
strncpy(BCASTADDRESS,MYIP,bdc-1); strcat(BCASTADDRESS,".255");
printf("BCASTADDRESS: %s ,len:%d
", BCASTADDRESS,strlen(BCASTADDRESS));
printf("Initial Broad Cast message "); {
/*s0"0" (id=76)
s1"500" (id=77)s2"100" (id=78)s3"100" (id=78)s4"startVD" (id=79)
s5"lighting" (id=80)s6"reading" (id=81)s7"Anna" (id=82)s8"0" (id=76)
s9"";s10"" (id=64)s11"" (id=64)*/
strcpy(Tmeg.s0,"0"); strcpy(Tmeg.s1,"500");strcpy(Tmeg.s2,"100");strcpy(Tmeg.s3,"100");
strcpy(Tmeg.s4,"startvd");strcpy(Tmeg.s5,"lighting");strcpy(Tmeg.s6,"reading");
strcpy(Tmeg.s7,"anna");strcpy(Tmeg.s8,"0"); }
MergeMessage (Tmeg); if( strlen(argv[1]) ) {
//strcpy(socketstring,Tmeg,sizeof(Tmeg));
if(transmit(socketstring, strlen(socketstring) ) ) {
printf(""%s" transmitted. ", socketstring); } else {
printf("Error occurred: %s ", strerror(errno)); return 1; } }
else { for( ; ; ) {
if ( argc < 2 ) // No argument: Just listen {
printf("Listening... "); if ( !receive() ) {
printf("Error occurred: %s ", strerror(errno)); return 1;
} return 0; } } } printf("Finished "); return 0;
} //////////////// .h file is /////////////
//#define WIN32_LEAN_AND_MEAN// Exclude rarely-used stuff from Windows headers
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <fcntl.h>
#include <netdb.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
#define SubLen50
//#include <ifaddrs.h>
#include <errno.h>
char MYIP[20];
char BCASTADDRESS[20];
typedef struct {
char s0[SubLen];
char s1[SubLen];
char s2[SubLen];
char s3[SubLen];
char s4[SubLen];
char s5[SubLen];
char s6[SubLen];
char s7[SubLen];
char s8[SubLen];
char s9[SubLen];
char s10[SubLen];
char s11[SubLen];
}msg_struct;
msg_struct Sendmsg;
msg_struct Tmeg; //Recivemsg;
Boolean pri[6];
char socketstring[SubLen*12];
char Ressocketstring[SubLen*12];
int kBufferSize = (SubLen*12);
View 2 Replies
View Related
Dec 28, 2010
wondering which of the Linux Distro you would recommend for a beginner to start hands on with? Also, can you provide links where I can download Linux ISOs.
View 5 Replies
View Related
Aug 21, 2010
it's been a while since I logged on here! I've been trying my hand at a little perl and have hit a brick wall.I'm using the Imagemagick module to manipulate some images. I can get the following to work without issue:
Code:
$teampath = "/var/www/team1";
$player=Image::Magick->new;
[code]...
View 1 Replies
View Related
Jan 5, 2011
I have tried several times, but compiling always fails.I want to compile a litte program called dwg2dxf.I think all the needed programs are installed.First I unpack the tar.gz file on my desktop. Open Terminal, enter directory, then type"./configure"Everything fine, some files are created. config.log doesnt show errors (See config.log file)."make"Some errors occurenters some directories without doing anything, thenmain.cpp:39: fatal error: iostream.h: (translation) Doesnt exist.This is the text from the terminal:
familia@familia-laptop:~/Escritorio/dwg2dxf-2.1$ make
make all-recursive
make[1]: se ingresa al directorio /home/familia/Escritorio/dwg2dxf-2.1
[code]...
View 7 Replies
View Related
Mar 2, 2011
so I am wanting to compile my own kernel to see if i can get my laptop to run a lill better. I found the how too's to do the compile, but what I want to know is.. what is the most complete way to find all the hardware and such that is in my laptop so i can build all the support into the kernel that i need and leave out EVERYTHING i dont need.
i figured lspci is a start but there has to be more info somewhere to find the exact needs of the laptop.
View 7 Replies
View Related
Mar 7, 2010
I went from mandriva 2009 32-bit to ubuntu 9.10 64-bit and wx begins to act up..
the simple program from the wx hello world tutorial build fine on my old system, but not my new on. I got the packages installed (wx2.8.10-dev, headers and whatnot)
I've looked around a bit and it seems the compiler is not including the files correctly..
Compiler command:
Code:
g++ k.cpp `wx-config --libs` `wx-config --cxxflags` -o morten
Compiler output sample (because most of it is because of first errors):
Code:
k.cpp:9: error: invalid use of incomplete type struct wxFrame
/usr/include/wx-2.8/wx/utils.h:50: error: forward declaration of struct wxFrame
k.cpp:12: error: ISO C++ forbids declaration of wxPoint with no type
k.cpp:12: error: expected , or ... before & token
[Code].....
View 5 Replies
View Related
Jan 23, 2010
I have a wifi card that has a generic driver through ubuntu that doesn't give it near the capabilities it has with another driver I found at another website. I compiled this driver myself and installed it, but after an update all effects of that driver seem to be gone.
View 5 Replies
View Related
Jan 26, 2010
I am compiling Xchat and when I was 'make install' I get this error and yes I am root.
Code:
make[2]: *** [fe-gtk.o] Error 1
make[2]: Leaving directory `/home/mark/build/xchat-2.8.6/src/fe-gtk'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/mark/build/xchat-2.8.6/src'
make: *** [install-recursive] Error 1
View 3 Replies
View Related
Feb 21, 2010
I am fairly new to ubuntu. I have to compile some libraries under ubuntu in a directory other than the default directory and then get the shared object libs (.so) libs for building some custome kernels. I created a directory structure as follows:
/home/username/build-target
/home/username/src-<libname> =>here are the source files for the lib. I need to compile
Now I create a directory /home/username/src-openssl and download the source code and untar it under this directory and issue ./configure --prefix=/home/username/build-target --exec-prefix=/home/username/build-target and then make and make install. I was expecting that the shared object libraries created (.so) files should have gone under /home/username/build-target/libs, however I just see only libssl.a and libcrypto.a and not .so files under the build-target/lib directory. For grep also I did the same thing as above however I don't see any lib directory created under build-target directory as I was expecting.
View 1 Replies
View Related
Mar 22, 2010
I am trying to compile a simple remote procedure call program. I am getting an error:
/tmp/ccy0M5rT.o: In function 'main':
rpchighlayer.c.text+0x5c): undefined reference to 'rnusers'
collect2: ld returned 1 exit status
Code:
#include <stdio.h>
#include<stdlib.h>
main(argc, argv)
int argc;
char **argv; {
int num;if (argc != 2) {
fprintf(stderr, "usage: rnusers hostname ");
exit(1);
} if ((num = rnusers(argv[1])) < 0)
{fprintf(stderr, "error: rnusers ");
exit(-1);
} printf("%d users on %s
", num, argv[1]);
exit(0); }
View 2 Replies
View Related
Apr 18, 2010
Im having problems when compiling abgx360gui. I compiled the abgx360 and it work but I want to compile the gui now, because otherwise it is very difficult to use it.
And when I try to compile it, the following happens.
View 5 Replies
View Related
Aug 1, 2010
I would like to try and optimize my kernel a bit. Since I am doing this on a fresh install, I don't really care if the os gets bricked in the process, and I am sure I can bring it back if I can boot into a recovery console from the old kernel. So, I followed thispost. I patched it and copied and edited a config file from /boot/, saved it as .config, I tried it several times with both removing and not removing /debian and /debian.master directories from the source, yet I always get the same error when I run "make oldconfig".
Code:
$ make oldconfig
scripts/kconfig/conf -o arch/x86/Kconfig
*** Error during writing of the kernel configuration.
make[1]: *** [oldconfig] Error 1
[Code]...
View 1 Replies
View Related
Aug 13, 2010
I'm trying to compile some of the gnu utils (the version on some of the computers I work on are terribly out of date). The issue is that many machines share the same filesystem, and I'd like to not have a different executable for each machine. Anyways, I've read that
./configure CC="gcc -arch i686 -arch x86_64 " --prefix=/home/user/bin
should work. But of course it doesn't. apparently -arch is not an argument accepted by gcc.
View 1 Replies
View Related
Sep 20, 2010
I am trying to cross compile a package from source for an embedded arm board, however I am not having much luck creating an arm binary.
After running make, this is what I get:
View 3 Replies
View Related
Nov 20, 2010
I'll try to make this short, esp because I don't know if this is the right place to discuss a 3rd party program like "Avidemux" I'm running the latest version "2.5.4" or so. It started giving me this problem where no matter what settings I give it, the resulting files are so small it results in an error after almost a day of encoding. ( "XYZ" was NOT saved correctly , for example.) One day I noticed the quantisizer was at max, peaking at 48-50...which made the files tiny. So, I can avoid this sort of, by limiting the maximum and minimum quantisizer in the configurations. Problem is, I have no control over target size or bitrate this way..and sometimes the results are still unplayable.
Naturally I've uninstalled and re-installed several times, and recompiled the x264 codecs using this guide: [URL]... So, I downloaded the Tar.gz of the previous version i was using (Avidemux 2.5.3), the last known thing I know that worked for me...but I have no idea how to install it. I've tried running "Make" / "Cmake" In which I was told that an "in-tree-build" was detected. And trying to run the included "bootStrap.sh" results in : "Permission denied" or file/command not found. I don't think their old releases come in the default Ubuntu/Unix package "deb" right?
All these could be small errors on my end, but It urks me. In between reading up, and everything else that needs to be done in a day, I could have been done by now... Does anyone know where i could be going wrong?
View 6 Replies
View Related
Mar 19, 2011
I'm following the instructions here, to compile OpenSceneGraph that I got on DVDs purchased from Curtis Olsen. The instruction for this step goes like this.
Quote:
mkdir osg_build
cd osg_build
cmake -D CMAKE_BUILD_TYPE="Release" -D CMAKE_CXX_FLAGS="-O3 -march=native"
CMAKE_C_FLAGS="-O3 -march=native" -D CMAKE_INSTALL_PREFIXATH="/usr" ../src
[code]....
So, I try that, and I get the following.
Quote:
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
[code]...
View 1 Replies
View Related
Jul 20, 2011
just need to know how i would do this, I've tried it before, and I've gotten the following error, no matter what i tried:
View 2 Replies
View Related
Jul 28, 2009
I did fine with Ubuntu 9.04 for a month and then things went wrong and I could no longer compile programs though others on the same distro could so I reinstalled Ubuntu 9.04.First step is to compile wxWidgets. Before this was automatic sudo make install libgtk2.0-dev, download wxGTK from wxWidgets then compile and make wxWidgets.Now I can't even do that, I get make errors every time and as soon as I resolve one. another shows. Widgets version 2-8-10 is the same as before. Does anyone know a current address for a tutorial getting widgets to compile with Ubuntu, I don't know whether to ask you, Ubuntu or Widgets (or understand what went wrong with Ubuntu in the first place.
View 6 Replies
View Related
Sep 24, 2010
I want to run the development version of the game Battle for Wesnoth, but I'm having some problems compiling it...I downloaded the latest version (1.9.1) and followed the installation instructions;
cd /usr/src
sudo tar -xvjf wesnoth-1.9.1.tar.bz2
cd wesnoth-1.9.1
sudo ./configure --datadir=/usr/share/games/wesnoth/
I managed to get to this point, after some small problems, but 'configure' told me I needed SDL.I installed SDL (libsdl1.2-dev) using the Software Center, but now it sais;
Code:
checking for SDL - version >= 1.2.7 and SDL_ttf - version >= 2.0.8... no
configure: error: *** Please upgrade your SDL and/or SDL_ttf version
The version that was installed seems to be 1.2.14 I also looked for sdl-ttf, and that was also already installed (version 2.0.9)
View 11 Replies
View Related
May 27, 2010
I am running Ubuntu 9.04 and I would like to update the jfstools to 1.1.4. Apt-get tells me that 1.1.2 is the latest available, but there is 1.1.4 code HERE.I am not overly comfortable compiling and installing, although I have done that many times. This time, I am unsure about the installation path:Quote:
Installation Names
By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving
[code]....
View 2 Replies
View Related
Jan 2, 2010
Its about CFLAGS and -O2, and options like -march=<your architecture>. There are things I am just not sure about eg - this PC has a Intel i7, which has a wealth of powerful instructions developed since 'i386', that the gcc complier might be able to compile for - if we tell it! Where are the default options kept? Even supposing one decides not to mess with Ubuntu defaults, how does one locally compile a program, optimized for the CPU, overriding the defaults? How does one even tell if the 64-bit version got installed? In my case, it was provided by others. clicking System -> About Ubuntu can be surprisingly opaque on this little detail, even though you get the chance to choose at the site.
View 4 Replies
View Related
Mar 10, 2010
I got an error that header file sys/ddi.h , did the system is missing something
View 2 Replies
View Related
Sep 13, 2010
This is my first time compiling a software, I have successfully downloaded and extracted the "basic256_0.9.6.32.tgz" file,but There is no configure file present in the extracted contents,also make and checkinstall exit with error.What seems to be the problem Here is the output of errors I got during Installation
[Code]...
View 14 Replies
View Related
Jan 20, 2010
In regards to other distribution cds: I'd like to learn how to install a 'root' and 'grub' boot loader so that I can cleanly install other distributions. I'm new to the file system. Could I make a bootable usb with simple installers? or command line codes?
View 2 Replies
View Related
Jan 25, 2010
so I just installed code blocks after clear installing ubuntu 64 everything went fine but when I try to compile and run my .cpp files code::blocks wont do anything I dont get any messages on the build log so I dont understand whats happening I tried looking on the forums and checking other pages such as the one bellow but no luck at all. [URL]
View 1 Replies
View Related
Mar 10, 2010
I tried to compile the latest VLC as the instruction of [URL]... except that giving configure option '--enable-vaapi' when compiling ffmpeg.But, i got below error messages, and don't know what to do. My system is as follows.
[code]...
View 5 Replies
View Related