Discussion:
Build failed trying to run example in tutorial
Aqil Hafizuddin
2018-11-30 13:01:15 UTC
Permalink
Hello guys,

I am trying to run the first.cc and keep getting error. Not too good at
explaining my problem but hope anyone can help me. I've been searching for
the solution at google but can't seem to solve this.

Here is the error i faced.
--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+***@googlegroups.com.
To post to this group, send email to ns-3-***@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.
'pdbarnes' via ns-3-users
2018-11-30 14:23:06 UTC
Permalink
You can only have one main() function in the files in a subdirectory of scratch. Evidently you have two, presumably in first.cc and example.cc. You can only have one.

If everything is in one file, as in the tutorial examples such as first.cc, you only need to put the file in scratch, not a subdirectory. In the case of the tutorial files you should change the name of the file as well, so rename first.cc as directed in the tutorial.

If your code is split across multiple files, for example a class header .h and implementation.cc, as well as a main, put all the files in a subdirectory.

Peter
--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+***@googlegroups.com.
To post to this group, send email to ns-3-***@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.
Aqil Hafizuddin
2018-12-01 08:51:08 UTC
Permalink
Initially I still having trouble understanding your simple explanation
because I am really new with this program. But after many times of re-read
and also google for better understanding, I managed to run the first.cc and
others .cc.

Thank you very much for the help sir.
Post by 'pdbarnes' via ns-3-users
You can only have one main() function in the files in a subdirectory of
scratch. Evidently you have two, presumably in first.cc and example.cc. You
can only have one.
If everything is in one file, as in the tutorial examples such as
first.cc, you only need to put the file in scratch, not a subdirectory. In
the case of the tutorial files you should change the name of the file as
well, so rename first.cc as directed in the tutorial.
If your code is split across multiple files, for example a class header .h
and implementation.cc, as well as a main, put all the files in a
subdirectory.
Peter
--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+***@googlegroups.com.
To post to this group, send email to ns-3-***@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.
Loading...