[Bug c++/39884] New: undefined reference

2009-04-24 Thread nilesh dot barange at gmail dot com
hi 
I am getting following error.
Can any one knows why it is?

[clusu...@vlsiserver mod_lbm1]$ g++  -o testmain testmain.cpp
/tmp/ccQqRHb8.o(.text+0x17c): In function `main':
: undefined reference to `Preprocess(int&, int&, int&, Input*, char*)'
/tmp/ccQqRHb8.o(.text+0x18d): In function `main':
: undefined reference to `DisplayInputArray(Input*, int&)'
/tmp/ccQqRHb8.o(.text+0x1d3): In function `main':
: undefined reference to `Domain::Domain(int&, int&, int&, int, double&,
double)'
/tmp/ccQqRHb8.o(.text+0x20c): In function `main':
: undefined reference to `Domain::InitializeDomain(Input*, int&)'
/tmp/ccQqRHb8.o(.text+0x215): In function `main':
: undefined reference to `Domain::DisplayDomain()'
/tmp/ccQqRHb8.o(.text+0x22d): In function `main':
: undefined reference to `Domain::SimulateDomain()'
/tmp/ccQqRHb8.o(.text+0x236): In function `main':
: undefined reference to `Domain::DisplayDomain()'
/tmp/ccQqRHb8.o(.text+0x269): In function `main':
: undefined reference to `Domain::DisplayDomain()'
collect2: ld returned 1 exit status


-- 
   Summary: undefined reference
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
     Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: nilesh dot barange at gmail dot com
 GCC build triplet: undefined reference


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39884



[Bug c++/39884] undefined reference

2009-04-28 Thread nilesh dot barange at gmail dot com


--- Comment #2 from nilesh dot barange at gmail dot com  2009-04-29 04:24 
---
(In reply to comment #1)
> This means you don't have any definition of Preprocess or any other of the
> functions mentioned above.
> 

Following is my code...

#include 
#include 
#include 
#include "domain.h"
#include "preprocess.h"


using namespace std;

int main(){

Domain* pdomain;
int size = 100;
int total_nodes =size*size;
int dims = 2;
int nz = 1;
double tau = 0.6;
double rhozero = 1.0;
int timemax = 10;
Input_st* pInput_ar;
pInput_ar = (Input_st*) Preprocess(size, size, nz, pInput_ar,
"config_data.txt");   

//DeallocateInputArray(pInput_ar);  
DisplayInputArray(pInput_ar, total_nodes);  


pdomain = new Domain(dims, size, size, nz, tau, rhozero);

pdomain->InitializeDomain(pInput_ar, total_nodes);

pdomain->DisplayDomain();


for(int t=0; tSimulateDomain();
pdomain->DisplayDomain();   
if(t%100 == 0){ 
pdomain->DisplayDomain();
cout<PostProcess();

//pdomain->ConstructDomain()



//Lattice_Abc* pLattice = new Lattice_D2Q9();
// Lattice_Abc* qLattice = new Lattice_D3Q19();
/*
Node*** mpNode;
mpNode = new Node**[nz];
for(int z=0; zDisplayPdfs(pLattice);
double density=2.0;
Pdfs_Abc* qPdfs = new Pdfs_Fluid(qLattice,density);
qPdfs->DisplayPdfs(qLattice);
*/
//Lattice_Abc* & rpLattice = pLattice;
//Lattice_Abc** ppLattice= & pLattice;
//rpLattice->DisplayLattice();
//(*ppLattice)->DisplayLattice();

/*

pLattice->DisplayLattice();
int & speeds = pLattice->Speeds();
cout<<"speeds\t"<DisplayMoments(pLattice);

//Moments_Abc* qMoments = new Moments_Fluid(qLattice, density, vel,
nodetype);
//qMoments->DisplayMoments(qLattice);

Moments_Abc* pMoments = new Moments_Solid(pLattice, density, vel,
nodetype);
pMoments->DisplayMoments(pLattice);

Moments_Abc* qMoments = new Moments_Solid();//(qLattice, density, vel,
nodetype);
qMoments->DisplayMoments(qLattice);

*/

cout<<"\nend of main"<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39884