c and cc+ files in one project

W. Tasin tasin at fhm.edu
Wed Mar 28 17:55:16 BST 2001


Lars Güsmar wrote:

> Hello,
> 
> I started a c project and everything works fine.
> I added one cpp-file with header and after some compilations
> and a last "rebuild" commmand make stopps with the error
> @CXX@ command not found.
> 
> the strange thing for me is that the compilation a few times
> succeded until the "rebuild" command.
> 
> my env contains the CXX(g++) and CC variables. So whats wrong?
> 
> Thanks, Lars
> lagegu at yahoo.de

Hello,

a c-project (autoconf frame) doesn't set the needed values for g++.
If you want to create a cpp source you have to make a C++ project.
There you can have mixed sources (either C or C++).

You will notice this only on the first "Rebuild" after 
including/deleting a new file (means changing Makefile.am), because 
there a new Makefile is attempted to be created.
And there automake will complain that you have a C++ source, but no
CXX, CXXFLAGS, etc. setting (INSIDE Makefile not outside).

After this compiling would still run (depending on the automake and make 
version), because a make call has default values of CXX (i. e. g++).

But your project will not be in sync, because automake already failed 
(as mentioned above) and so the Makefiles were not updated correctly.


We keep C-project to guarantee a c compiling (w/o certain cpp language 
extensions).
The real disadvantage on that is that make already has a default CXX 
value defined and the Makefile-template of automake has a standard rule 
for .cpp to .o .


Ciao

Walter
-- 
-- 
oohhh sveglia.... il mondo e' ammalato, ma x colpa di chi.........
(Zucchero)
:-------W. Tasin, FB 04,
FHM-------------------PGP-KeyID:0x7961A645----------:
<Key-Fingerprint: 1610 835F 0080 32F4 6140  6CF7 A7D0 44CD 7961A645>
<http://wwwkeys.pgp.net:11371/pks/lookup?op=index&search=0x7961A645&fingerprint=on>


-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list