LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   incorporating a c++ module with NS2 tcl file (https://www.linuxquestions.org/questions/linux-newbie-8/incorporating-a-c-module-with-ns2-tcl-file-4175601552/)

baig7070 03-11-2017 02:25 PM

incorporating a c++ module with NS2 tcl file
 
1 Attachment(s)
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 makefile.in, i got the multiple main error in monolithic.cc 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!

dijetlo 03-14-2017 08:06 AM

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

:)


All times are GMT -5. The time now is 02:35 PM.