[m-rev.] diff: fix "C++ calls Mercury" sample

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Feb 17 08:42:22 AEDT 2004


Estimated hours taken: 0.5
Branches: main

Get the "C++ calls Mercury" sample working again.

samples/c_interface/cplusplus_calls_mercury/cpp_main.cc:
	s/mercury_lib.h/mercury_lib.mh/

samples/c_interface/cplusplus_calls_mercury/Mmakefile:
	Link in -lstdc++, since recent versions of GNU C++ require this.
	Delete most of the mentions of mercury_lib.h, since they
	are now handled automatically by Mmake.
	s/mercury_lib.h/mercury_lib.mh/

Workspace: /home/jupiter/fjh/ws-jupiter/mercury
Index: samples/c_interface/cplusplus_calls_mercury/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/samples/c_interface/cplusplus_calls_mercury/Mmakefile,v
retrieving revision 1.7
diff -u -d -r1.7 Mmakefile
--- samples/c_interface/cplusplus_calls_mercury/Mmakefile	21 Dec 2001 06:23:01 -0000	1.7
+++ samples/c_interface/cplusplus_calls_mercury/Mmakefile	16 Feb 2004 21:38:02 -0000
@@ -32,19 +32,16 @@
 
 # tell the Mercury linker to link in cpp_main.o
 MLOBJS=cpp_main.o
+MLLIBS=-lstdc++
 
 #-----------------------------------------------------------------------------#
 
 # we also need to add header file dependencies
-cpp_main.o: cpp_main.h mercury_lib.h
+cpp_main.o: cpp_main.h mercury_lib.mh
 cpp_main_int.o: cpp_main.h
 
-# to make mercury_lib.h, just compile mercury_lib.m;
-# the Mercury compiler will create mercury_lib.h as a side-effect.
-mercury_lib.h: mercury_lib.o
-
-# make sure that `mmake clean' removes cpp_main.o and mercury_lib.h
+# make sure that `mmake clean' removes cpp_main.o
 clean_local:
-	rm -f cpp_main.o mercury_lib.h
+	rm -f cpp_main.o
 
 #-----------------------------------------------------------------------------#
Index: samples/c_interface/cplusplus_calls_mercury/cpp_main.cc
===================================================================
RCS file: /home/mercury1/repository/mercury/samples/c_interface/cplusplus_calls_mercury/cpp_main.cc,v
retrieving revision 1.4
diff -u -d -r1.4 cpp_main.cc
--- samples/c_interface/cplusplus_calls_mercury/cpp_main.cc	6 Feb 2002 09:01:36 -0000	1.4
+++ samples/c_interface/cplusplus_calls_mercury/cpp_main.cc	16 Feb 2004 21:27:00 -0000
@@ -1,5 +1,5 @@
 #include "mercury_imp.h"	/* must come first */
-#include "mercury_lib.h"	/* must come first */
+#include "mercury_lib.mh"	/* must come first */
 
 #include <stdio.h>
 

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list