Re: cons with c++
[email protected] Tue, 25 Jan 2005 14:17:28 -0800
| Newsgroups | gmane.comp.gnu.cons.general |
|---|---|
| Message-ID | <OFA25B0928.D4ACF770-ON85256F94.007A1F07-88256F94.007A8581@philips.com> |
This is a multipart message in MIME format. --===============1286155293== Content-Type: multipart/alternative; boundary="=_alternative 007A857E88256F94_=" This is a multipart message in MIME format. --=_alternative 007A857E88256F94_= Content-Type: text/plain; charset="US-ASCII" Yes, you never specified that Configuration.cpp was part of the project. Cons does not magically go out and find source code to compile. Try: Program $env 'Configuration', 'tConfiguration.cpp', '..\classes\Configuration.cpp'; --- Rick Croote Software Engineer Environment and Tools Team Philips Medical Systems Bothell, WA [email protected] Phone: 425-487-7834 Daniel Graupner <[email protected]> 01/25/2005 01:57 PM To: Rick Croote/ATL-BTL/MS/PHILIPS@PHILIPS cc: [email protected] Subject: Re: cons with c++ Classification: Let me try to describe the situation a bit more precisely ;-) my directory structure classes Configuration.h Configuration.cpp test tConfiguration.cpp #the Programm to test the class Construct Construct contains: $env = new cons( CC => "g++", CPPPATH => "/usr/local/include/:../classes/", LIBPATH => "/usr/local/lib/", LIBS => "-lxerces-c", ); Program $env 'Configuration', 'tConfiguration.cpp'; If I call "cons Configuration" in the test directory than g++ -I/usr/local/include -I/root/studarb/devel/include/classes -c tConfiguration.cpp -o tConfiguration.o g++ -o Configuration tConfiguration.o -L/usr/local/lib -lxerces-c tConfiguration.o(.text+0x136): In function `main': : undefined reference to `Configuration::Configuration()' tConfiguration.o(.text+0x170): In function `main': : undefined reference to `Configuration::parseFile(std::string)' tConfiguration.o(.text+0x1d5): In function `main': : undefined reference to `Configuration::~Configuration()' tConfiguration.o(.text+0x1f0): In function `main': : undefined reference to `Configuration::~Configuration()' cons: *** [Configuration] Error 1 cons: errors constructing Configuration The undefined references are from the class "Configuration" which has currently only 3 functions (constructor, destructor and parseFile). Cons never included the class body therefore the errors, I suppose. This is the command which usually works for me g++ -I /usr/local/include -L/usr/local/lib/ -lxerces-c -o Configuration ../classes/Configuration.cpp tConfiguration.cpp Regads, Daniel. [email protected] schrieb: > > What you describe, of course, is the common practice, and rest assured > Cons has no difficulty compiling C++ code. Our code base that has > exceeded 7000 CPP files, and at least that in H files, for years. The > problem is that you have not provided enough information for us to > really help further. Your statement of undefined references leads me to > believe that you have a linked target that is not specifying the > expected object files. > > --- > Rick Croote > Software Engineer > Environment and Tools Team > Philips Medical Systems > Bothell, WA > [email protected] > Phone: 425-487-7834 > > > > > > > > > *Daniel Graupner <[email protected]>* > > Sent by: > [email protected] > > 01/25/2005 01:04 PM > > > To: [email protected] > cc: (bcc: Rick Croote/ATL-BTL/MS/PHILIPS) > Subject: cons with c++ > > Classification: > > > > > Hello, > > I want to use cons with C++ but have some problems. > > I divided my C++Classes in *.h and *.cpp files. The *.h includes the > class definition, the *.cpp the > body of the class and includes the corresponding *.h. > > In the main program i include the *.h of the class, thats the usual > practice I thing. Cons is not > able to resolve the class!! Cons does not compile the body of the > class...so there are errors with > undefined references. > > Thanks for Help, > Daniel. > > > _______________________________________________ > [email protected] > http://lists.gnu.org/mailman/listinfo/cons-discuss > Cons URL: http://www.dsmit.com/cons/ > --=_alternative 007A857E88256F94_= Content-Type: text/html; charset="US-ASCII" <br><font size=2 face="sans-serif">Yes, you never specified that Configuration.cpp was part of the project. Cons does not magically go out and find source code to compile. Try:</font> <br> <br><font size=2><tt>Program $env 'Configuration', 'tConfiguration.cpp', '..\classes\Configuration.cpp';</tt></font> <br><font size=2 face="sans-serif"><br> ---<br> Rick Croote<br> Software Engineer<br> Environment and Tools Team<br> Philips Medical Systems<br> Bothell, WA<br> [email protected]<br> Phone: 425-487-7834<br> </font> <br> <br> <br> <table width=100%> <tr valign=top> <td> <td> <br> <br> <br> <br> <br><font size=1 face="sans-serif"><b>Daniel Graupner <[email protected]></b></font> <p><font size=1 face="sans-serif">01/25/2005 01:57 PM</font> <td><font size=1 face="Arial"> </font> <br><font size=1 face="sans-serif"> To: Rick Croote/ATL-BTL/MS/PHILIPS@PHILIPS</font> <br><font size=1 face="sans-serif"> cc: [email protected]</font> <br><font size=1 face="sans-serif"> Subject: Re: cons with c++</font> <p><font size=1 face="sans-serif"> Classification: </font> <br> <br></table> <br> <br> <br><font size=2><tt>Let me try to describe the situation a bit more precisely ;-)<br> <br> my directory structure<br> <br> classes<br> Configuration.h<br> Configuration.cpp<br> test<br> tConfiguration.cpp #the Programm to test the class<br> Construct<br> <br> Construct contains:<br> $env = new cons(<br> CC => "g++",<br> CPPPATH => "/usr/local/include/:../classes/",<br> LIBPATH => "/usr/local/lib/",<br> LIBS => "-lxerces-c",<br> );<br> Program $env 'Configuration', 'tConfiguration.cpp';<br> <br> If I call "cons Configuration" in the test directory than<br> g++ -I/usr/local/include -I/root/studarb/devel/include/classes -c tConfiguration.cpp -o tConfiguration.o<br> g++ -o Configuration tConfiguration.o -L/usr/local/lib -lxerces-c<br> tConfiguration.o(.text+0x136): In function `main':<br> : undefined reference to `Configuration::Configuration()'<br> tConfiguration.o(.text+0x170): In function `main':<br> : undefined reference to `Configuration::parseFile(std::string)'<br> tConfiguration.o(.text+0x1d5): In function `main':<br> : undefined reference to `Configuration::~Configuration()'<br> tConfiguration.o(.text+0x1f0): In function `main':<br> : undefined reference to `Configuration::~Configuration()'<br> cons: *** [Configuration] Error 1<br> cons: errors constructing Configuration<br> <br> <br> The undefined references are from the class "Configuration" which has currently only 3 functions <br> (constructor, destructor and parseFile).<br> <br> Cons never included the class body therefore the errors, I suppose.<br> <br> This is the command which usually works for me<br> g++ -I /usr/local/include -L/usr/local/lib/ -lxerces-c -o Configuration ../classes/Configuration.cpp <br> tConfiguration.cpp<br> <br> <br> Regads,<br> Daniel.<br> <br> <br> <br> [email protected] schrieb:<br> > <br> > What you describe, of course, is the common practice, and rest assured <br> > Cons has no difficulty compiling C++ code. Our code base that has <br> > exceeded 7000 CPP files, and at least that in H files, for years. The <br> > problem is that you have not provided enough information for us to <br> > really help further. Your statement of undefined references leads me to <br> > believe that you have a linked target that is not specifying the <br> > expected object files.<br> > <br> > ---<br> > Rick Croote<br> > Software Engineer<br> > Environment and Tools Team<br> > Philips Medical Systems<br> > Bothell, WA<br> > [email protected]<br> > Phone: 425-487-7834<br> > <br> > <br> > <br> > <br> > <br> > <br> > <br> > <br> > *Daniel Graupner <[email protected]>*<br> > <br> > Sent by:<br> > [email protected]<br> > <br> > 01/25/2005 01:04 PM<br> > <br> > <br> > To: [email protected]<br> > cc: (bcc: Rick Croote/ATL-BTL/MS/PHILIPS)<br> > Subject: cons with c++<br> > <br> > Classification: <br> > <br> > <br> > <br> > <br> > Hello,<br> > <br> > I want to use cons with C++ but have some problems.<br> > <br> > I divided my C++Classes in *.h and *.cpp files. The *.h includes the <br> > class definition, the *.cpp the<br> > body of the class and includes the corresponding *.h.<br> > <br> > In the main program i include the *.h of the class, thats the usual <br> > practice I thing. Cons is not<br> > able to resolve the class!! Cons does not compile the body of the <br> > class...so there are errors with<br> > undefined references.<br> > <br> > Thanks for Help,<br> > Daniel.<br> > <br> > <br> > _______________________________________________<br> > [email protected]<br> > http://lists.gnu.org/mailman/listinfo/cons-discuss<br> > Cons URL: http://www.dsmit.com/cons/<br> > <br> <br> </tt></font> <br> --=_alternative 007A857E88256F94_=-- --===============1286155293== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ [email protected] http://lists.gnu.org/mailman/listinfo/cons-discuss Cons URL: http://www.dsmit.com/cons/ --===============1286155293==--