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. &nbsp;Cons does not magically go out and find
source code to compile. &nbsp;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 &lt;[email protected]&gt;</b></font>
<p><font size=1 face="sans-serif">01/25/2005 01:57 PM</font>
<td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To:
&nbsp; &nbsp; &nbsp; &nbsp;Rick Croote/ATL-BTL/MS/PHILIPS@PHILIPS</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc:
&nbsp; &nbsp; &nbsp; &nbsp;[email protected]</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject:
&nbsp; &nbsp; &nbsp; &nbsp;Re: cons with c++</font>
<p><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Classification:
&nbsp; &nbsp; &nbsp; &nbsp;</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>
 &nbsp;Configuration.h<br>
 &nbsp;Configuration.cpp<br>
test<br>
 &nbsp;tConfiguration.cpp #the Programm to test the class<br>
 &nbsp;Construct<br>
<br>
Construct contains:<br>
$env = new cons(<br>
 &nbsp; &nbsp; &nbsp; &nbsp; CC &nbsp; &nbsp; &nbsp;=&gt; &quot;g++&quot;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; CPPPATH =&gt; &quot;/usr/local/include/:../classes/&quot;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; LIBPATH =&gt; &quot;/usr/local/lib/&quot;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; LIBS &nbsp; &nbsp;=&gt; &quot;-lxerces-c&quot;,<br>
);<br>
Program $env 'Configuration', 'tConfiguration.cpp';<br>
<br>
If I call &quot;cons Configuration&quot; 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 &quot;Configuration&quot; 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>
&gt; <br>
&gt; What you describe, of course, is the common practice, and rest assured
<br>
&gt; Cons has no difficulty compiling C++ code. &nbsp;Our code base that
has <br>
&gt; exceeded 7000 CPP files, and at least that in H files, for years.
&nbsp;The <br>
&gt; problem is that you have not provided enough information for us to
<br>
&gt; really help further. &nbsp;Your statement of undefined references
leads me to <br>
&gt; believe that you have a linked target that is not specifying the <br>
&gt; expected object files.<br>
&gt; <br>
&gt; ---<br>
&gt; Rick Croote<br>
&gt; Software Engineer<br>
&gt; Environment and Tools Team<br>
&gt; Philips Medical Systems<br>
&gt; Bothell, WA<br>
&gt; [email protected]<br>
&gt; Phone: 425-487-7834<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; *Daniel Graupner &lt;[email protected]&gt;*<br>
&gt; <br>
&gt; Sent by:<br>
&gt; [email protected]<br>
&gt; <br>
&gt; 01/25/2005 01:04 PM<br>
&gt; <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp; &nbsp;[email protected]<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; &nbsp;(bcc: Rick
Croote/ATL-BTL/MS/PHILIPS)<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;cons
with c++<br>
&gt; <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; Classification: &nbsp; &nbsp; &nbsp; &nbsp;<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; Hello,<br>
&gt; <br>
&gt; I want to use cons with C++ but have some problems.<br>
&gt; <br>
&gt; I divided my C++Classes in *.h and *.cpp files. The *.h includes the
<br>
&gt; class definition, the *.cpp the<br>
&gt; body of the class and includes the corresponding *.h.<br>
&gt; <br>
&gt; In the main program i include the *.h of the class, thats the usual
<br>
&gt; practice I thing. Cons is not<br>
&gt; able to resolve the class!! Cons does not compile the body of the
<br>
&gt; class...so there are errors with<br>
&gt; undefined references.<br>
&gt; <br>
&gt; Thanks for Help,<br>
&gt; Daniel.<br>
&gt; <br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; [email protected]<br>
&gt; http://lists.gnu.org/mailman/listinfo/cons-discuss<br>
&gt; Cons URL: http://www.dsmit.com/cons/<br>
&gt; <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==--