Note that there are some explanatory texts on larger screens.

plurals
  1. POMakefile is not working
    primarykey
    data
    text
    <p>I am trying to get my makefile working, but it is giving me some errors and I can't get it to work.</p> <pre><code> OBJS = Kmeans.o cluster.o data.o CC = g++ DEBUG = -g CFLAGS = -Wall -c $(DEBUG) LFLAGS = -Wall $(DEBUG) clustering : $(OBJS) $(CC) $(LFLAGS) $(OBJS) -o clustering Kmeans.o : Kmeans.h Kmeans.cpp cluster.h data.h $(CC) $(CFLAGS) Kmeans.cpp cluster.o : cluster.h cluster.cpp data.h $(CC) $(CFLAGS) cluster.cpp data.o : data.h data.cpp $(CC) $(CFLAGS) data.cpp clean: \rm *.o *~ clustering </code></pre> <p>And the files are:</p> <pre><code>clustering.cpp -&gt; #include "Kmeans.h" Kmeans.cpp -&gt; #include "Kmeans.h" Kmeans.h -&gt; #include "cluster.h" cluster.cpp -&gt; #include "cluster.h" cluster.h -&gt; #include "data.h" data.cpp -&gt; #include "data.h" </code></pre> <p>What am I doing wrong?</p> <p>Edit: Sorry, I forgot to include the errors:</p> <pre><code>Kmeans.o: In function `Kmeans::read(char*)': Kmeans.cpp:(.text+0x53c): undefined reference to `Data::~Data()' cluster.o: In function `Cluster::Cluster(int, int, int)': cluster.cpp:(.text+0x45): undefined reference to `Data::~Data()' cluster.cpp:(.text+0x80): undefined reference to `Data::~Data()' cluster.o: In function `Cluster::Cluster()': cluster.cpp:(.text+0xca): undefined reference to `Data::~Data()' cluster.cpp:(.text+0x110): undefined reference to `Data::~Data()' cluster.o: In function `Cluster::setData(int, int, int)': cluster.cpp:(.text+0x158): undefined reference to `Data::~Data()' collect2: ld devolvió el estado de salida 1 make: *** [clustering] Error 1 </code></pre> <p>Thanks!</p> <p>I compile each file and the problem is in the last line:</p> <pre><code>g++ -c -o clustering.o clustering.cpp g++ -c -o data.o data.cpp g++ -c -o Kmeans.o Kmeans.cpp g++ -c -o cluster.o cluster.cpp g++ -o clustering clustering.o data.o Kmeans.o cluster.o &lt;---- </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload