Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-11-2017, 02:25 PM   #1
LQ Newbie
Registered: Nov 2016
Posts: 6

Rep: Reputation: Disabled
incorporating a c++ module with NS2 tcl file

Hi everybody,
I am trying to incorporate a new C++ module with NS2 tcl file and i am getting an error of multiple mains. I have my main c++ file which runs my desired code using my .cpp file and .h files. When I tried to incorporate it with tcl file in, i got the multiple main error in file. If I dont add my main file and the incorporation takes place.But without my main file of c++, the incorporating is useless to me.
Can anyone can guide me how to fix this error. The error is shown in the attachment.
I ll be obliged!
Attached Thumbnails
Click image for larger version

Name:	12.PNG
Views:	20
Size:	92.8 KB
ID:	24465  
Old 03-14-2017, 08:06 AM   #2
Senior Member
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Hi Baig,

If it's a 'module' then you'll probably leverage it as an #include which doesn't need a main. Take a look at some of your other header files, what you are normally using from them are the methods and classes they contain. Think of the new c++ module as an extension of the tcl.cpp, not a separate app that passes data back and forth with the tcl app ( 'cause it doesn't do that). It only gets compiled as part of the tcl.cpp, not as a separate new_module.cpp.

Hope that helps

Last edited by dijetlo; 03-14-2017 at 08:08 AM.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
a tcl file that run RWP in ns2 Alkindi Linux - Newbie 3 06-30-2016 11:21 AM
[SOLVED] error while executing a tcl file in ns2 Zahraa Ayad Linux - General 3 12-24-2014 10:20 AM
how to pass an argument from .cc file to tcl file in ns2 pon Linux - Newbie 0 12-11-2014 08:44 AM
aomdv.tcl file 4 ns2.34 puru45 Linux - Newbie 2 11-20-2014 08:06 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:56 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration