Function declared but not defined

Hi.
I’m getting the following error when running my program:

The function Value() is part of a class (FinalNeuralNet) that gets recognized by Root. I have included “FinalNeuralNet.h” at the beggining of my script
Here is the part where I’m declaring the class and where I’m calling the function in the code:

As I said, Root recognizes FinalNeuralNet but has an issue running the function. Here is what it looks like:

Anyone knows where might the issue come from?

Thank you!

Is the implementation of double FinalNeuralNet::Value(int,double,double) on the same script you are loading on the interpreter? Otherwise, you will need to compile the .cxx file for your class as a shared library and load it at runtime using .L library.so in root.

No, it is not on the same script.
I’ve tried to compile it before, but probably used the wrong syntax. Could you tell me what to write exactly?

Thank you!

Hi,

could you share the code you are dealing with and the procedure you use to run it?

Cheers,
D

Here is the main code I’m running.
FirstNN.c (9.3 KB)

As you can see line 256, I use mlp->export(“FinalNeuralNet”,“C++”), this will create a .cxx and .h file where the function Value() is declared.
All the code related to my problem is located between line 256 and line 275, don’t bother reading the rest.

Thank you very much!

Hi,

if I understand correctly your code, you have a C++ macro which dumps on disk sources. You then want to use the entities defined in these sources in the macro which dumped them: is this correct?

If yes, this is not possible.
This is not a limitation of ROOT but rather something logically not well defined. I think the best option you have is to break your code in two pieces: one that generates the NN and the other that picks up (somehow) the code.

If no, I think I need more information.

Cheers,
D

Yes, this is correct.
I will do that, thank you very much for your time.

Cheers!

Great. Let us know how it goes.

I get the following error: Error: << Illegal operator for pointer 3 C:\root\Source1.cpp(126)
I have just copied and pasted the second part of the code to a new file and ran it. I have included all the libraries (probably more than I need but too lazy to put them off now).

Here is my code in case:
Source1.cpp (5.1 KB)

#include "FinalNeuralNet.h"
{
FinalNeuralNet *f = new FinalNeuralNet; //Declare FinalNeuralNet

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.