[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#416705: marked as done (../sysdeps/i386/elf/start.S:115: undefined reference to `main')



Your message dated Thu, 29 Mar 2007 14:57:54 -0700
with message-id <20070329215754.GA22047@borges.dodds.net>
and subject line Bug#416705: ../sysdeps/i386/elf/start.S:115: undefined reference to `main'
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: g++-4.1
Version: 4.1.1-21
Severity: serious
Justification: no longer builds from source

I would compile a cpp source but when compiling with

g++ -o VelocityModel VelocityModel.cc

i receive this error

/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function `_start':
.../sysdeps/i386/elf/start.S:115: undefined reference to `main'
collect2: ld returned 1 exit status


then there is the file:
VelocityModel.cc


----------------------------------------------------------------------------------

// Esercizio 2: motion models
//
// Classe VelocityModel
//
// Implementa gli algoritmi per il modello di velocità
//
//
// Istruzioni compilazione:
// g++ -o VelocityModel VelocityModel.cc 
//


#include <time.h>
#include <stdlib.h> 
#include <unistd.h>
#include <cmath>


using namespace std; 
class VelocityModel {
 
public:
    
    //impostare a1, a2, a3, a4, a5, a6
    //sono i parametri di rumore del moto    
    double a1;
    double a2;
    double a3;
    double a4;
    double a5;
    double a6;

    //quanto è deltaT (tempo)????
    double dT;

    //costruttore semplice
    VelocityModel()
    {
    }	

    //costruttore che riceve come parametri di ingresso i valori di a e di deltaT
    VelocityModel(double aa1,double aa2,double aa3,double aa4,double aa5,double aa6, double ddT ) 
    {
	a1=aa1;
	a2=aa2;
	a3=aa3;
	a4=aa4;
	a5=aa5;
	a6=aa6;
	dT=ddT;
    }
 
    ~VelocityModel( )
    {
    }
    //algoritmo motion_model_velocity ( pg.123 tabella 5.1)
    double algoritmo(double ipotPose[], double control[], double initPose[] ) 
    {
	double mu= 0.5 * ( ((initPose[1]-ipotPose[1])*cos(initPose[3])) + 
((initPose[2]-ipotPose[2])*sin(initPose[3])) ) /
                  ( ((initPose[2]-ipotPose[2])*cos(initPose[3])) - 
((initPose[1]-ipotPose[1])*sin(initPose[3])) ); 

	double xstar= 0.5*(initPose[1]+ipotPose[1]) + mu*(initPose[2]-ipotPose[2]);

	double ystar= 0.5*(initPose[2]+ipotPose[2]) + mu*(ipotPose[1]-initPose[1]);

        double rstar= sqrt( (initPose[1]-xstar)*(initPose[1]-xstar) +(initPose[2]-ystar)*(initPose[2]-ystar) 
);

	double dTeta= atan2( (ipotPose[2]-ystar) , (ipotPose[1]-xstar) ) - atan2( (initPose[2]-ystar) 
,(initPose[1]-xstar) );

	double vC= dTeta*rstar/dT; 

        double omegaC= dTeta/dT; 

	double gammaC= ((ipotPose[3] - initPose[3]) * dT) - omegaC;  

	return ( prob( (control[1] - vC), (a1* abs(control[1]) + a2*abs(control[2]) ) )     *
		 prob( (control[2] - omegaC), (a3* abs(control[1]) + a4*abs(control[2]) ) ) *
		 prob( gammaC, (a5* abs(control[1]) + a6*abs(control[2]) ) )                );

    }

    //algoritmo di supporto al motion_model_velocity (pg. 123 tabella 5.2)
    //la funzione calcola la probabilità del suo argomento "a" sotto una distribuzione centrata
    //a zero con deviazione standard "b"
    double prob(double a, double b)
    {
	//prob_normal_distribution
	return ( (1/sqrt(2*M_PI*b*b))* exp(-0.5*a*a*(1/b)*(1/b))	);

	//prob_triangular_distribution
	// return ( max<double>( 0 , ( (1/(sqrt(6)*b)) - (abs(a)/(6*b*b)) ) ) );
    }



    //algoritmo sample_motion_model_velocity (pg.124, tabella 5.3) 
    //la funzione  ritorna un array. 
    //per prendere il valore dall'esterno: inizializzare il vettore come puntatore 
    //
    //esempio:
    //
    // double *vettore;
    // vettore=sample_algoritmo(control, initPose);
    double* sample_algoritmo(double control[], double initPose[])
    {
	static double ipotPose[3];
	double vC= control[1] + sample(a1*abs(control[1]) + a2*abs(control[2]));
	double omegaC= control[2] + sample(a3*abs(control[1]) + a4*abs(control[2]));
	double gammaC= sample(a5*abs(control[1]) + a6*abs(control[2]));
	ipotPose[1]= initPose[1] - (vC/omegaC)*sin(initPose[3]) + (vC/omegaC)*sin(initPose[3] + omegaC*dT); 
	ipotPose[2]= initPose[2] + (vC/omegaC)*cos(initPose[3]) - (vC/omegaC)*cos(initPose[3] + omegaC*dT); 
	ipotPose[3]= initPose[3] + omegaC*dT + gammaC*dT; 

	return ipotPose;
    }

    //algoritmo di supporto al sample_motion_model_velocity (pg.124 tabella 5.4)
    //la funzione genera un campione random da una distribuzione centrata a zero con deviazione standard "b"
    double sample(double b)
    {
	//--------------------------
	//sample normal distribution
	//--------------------------
  	double ran;
	double somma=0;

  	// inizializza random seed:
	srand ( time(NULL) );

	// genera numero: 
	ran = (-b) + rand() * (b - (-b)) / RAND_MAX;
//	ran = rand() % b + (-b);
	
	for (int i=0; i<12; i++)
	{
		somma=somma+ran;
		ran = (-b) + rand() * (b - (-b)) / RAND_MAX;
	}   
	return (0.5*somma);


	//------------------------------
	//sample triangular distribution
	//------------------------------
	/*
  	double ran1,ran2;
  	// inizializza random seed:
	srand ( time(NULL) );
	// genera numero: 
	ran1 = (-b) + rand() * (b - (-b)) / RAND_MAX;
	ran2 = (-b) + rand() * (b - (-b)) / RAND_MAX;

	return (sqrt(6)*(ran1+ran2)/2);

	*/

    } //end sample

};
------------------------------------------------------------------------------------


-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)

Versions of packages g++-4.1 depends on:
ii  gcc-4.1                     4.1.1-21     The GNU C compiler
ii  gcc-4.1-base                4.1.1-21     The GNU Compiler Collection (base 
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared libraries
ii  libstdc++6-4.1-dev          4.1.1-21     The GNU Standard C++ Library v3 (d

g++-4.1 recommends no packages.

-- no debconf information


--- End Message ---
--- Begin Message ---
On Thu, Mar 29, 2007 at 11:22:41PM +0200, Guido Schillaci wrote:
> Package: g++-4.1
> Version: 4.1.1-21
> Severity: serious
> Justification: no longer builds from source

> I would compile a cpp source but when compiling with

> g++ -o VelocityModel VelocityModel.cc

> i receive this error

> /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function `_start':
> .../sysdeps/i386/elf/start.S:115: undefined reference to `main'
> collect2: ld returned 1 exit status

On Thu, Mar 29, 2007 at 11:24:02PM +0200, guido schillaci wrote:
> Subject: ../sysdeps/i386/elf/start.S:115: undefined reference to `main'
> Package: g++-4.1
> Version: 4.1.1-21
> Severity: serious
> Justification: no longer builds from source

> *** Please type your report below this line ***
> I would compile a cpp source but when compiling with

> g++ -o VelocityModel VelocityModel.cc

> i receive this error

> /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function 
> `_start':
> ../sysdeps/i386/elf/start.S:115: undefined reference to `main'
> collect2: ld returned 1 exit status

These are bugs in your code or in your usage of g++, they are not bugs in
g++.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
vorlon@debian.org                                   http://www.debian.org/

--- End Message ---

Reply to: