Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with adding new files to INET (<!> Error: Cannot load library) #324

Open
Meghna2069 opened this issue Mar 1, 2024 · 3 comments
Open

Comments

@Meghna2069
Copy link

Hello !

Please, I need your help with the following issue, actually, each time i create a new module under inet i get the following error: "<!> Error: Cannot load library '/home/laptop/artery/build/src/artery/envmod/libartery_envmod.so': /home/laptop/artery/build/extern/libINET.so: undefined symbol: _ZTIN4inet9ieee802114glvfE"

I do not understand what is the reason behind this error, although i enter make cleanall and make makefiles each time i add a new file, i am always getting this error and i do not think that it is a coding issue because when i put the same code in files that already exist under inet, i do not get this error, what shall i do please, it's been days now since i faced this error and i can not move on !

Thank you very much in advance for your help !

@riebl
Copy link
Owner

riebl commented Mar 1, 2024

Artery builds INET for you, i.e. you should not need to manually invoke any INET make targets. What happens when you simply build Artery after adding your new module to INET?

Also, your error occurs at runtime. Possibly the reason is actually a problem when compiling the sources. Do you see any error or warning messages during the build?

@Meghna2069
Copy link
Author

Thank you for replying !

Here are the warnings i see when i run my project:

"/home/laptop/artery/extern/inet/src/inet/common/serializer/SerializerBase.cc: In destructor ‘virtual inet::serializer::SerializerRegistrationList::~SerializerRegistrationList()’:
/home/laptop/artery/inet/src/inet/common/serializer/SerializerBase.cc:163:129: warning: throw will always call terminate() [-Wterminate]
163 | throw cRuntimeError("SerializerRegistrationList not empty, should call the SerializerRegistrationList::clear() function");
| ^
/home/laptop/artery/extern/inet/src/inet/common/serializer/SerializerBase.cc:163:129: note: in C++11 destructors default to noexcept"

"/home/laptop/artery/extern/inet/src/inet/common/serializer/ipv4/IPv4Serializer.cc: In destructor ‘virtual inet::serializer::IPv4OptionSerializerRegistrationList::~IPv4OptionSerializerRegistrationList()’:
/home/laptop/artery/extern/inet/src/inet/common/serializer/ipv4/IPv4Serializer.cc:409:129: warning: throw will always call terminate() [-Wterminate]
409 | throw cRuntimeError("SerializerRegistrationList not empty, should call the SerializerRegistrationList::clear() function");
| ^
/home/laptop/artery/extern/inet/src/inet/common/serializer/ipv4/IPv4Serializer.cc:409:129: note: in C++11 destructors default to noexcept"

"In file included from /home/laptop/artery/extern/simulte/src/stack/mac/layer/LteMacEnbD2D.cc:14:
/home/laptop/artery/extern/simulte/src/stack/mac/amc/AmcPilotD2D.h: In member function ‘virtual std::vector AmcPilotD2D::getMultiBandCqi(MacNodeId, Direction)’:
/home/laptop/artery/extern/simulte/src/stack/mac/amc/AmcPilotD2D.h:54:83: warning: no return statement in function returning non-void [-Wreturn-type]
54 | virtual std::vector getMultiBandCqi(MacNodeId id, const Direction dir) {};
| ^
"

The problem is that i do not see my modified files, neither do i see the ones i added during compilation and then i get the message error that indicates that it can not load library !

Do you think that the error might exist in the code ? Aren't they any other reasons behind this compilation error ? and why i do not see the files i added during execution of my project ? Have you got an idea about that please ?

@riebl
Copy link
Owner

riebl commented Mar 17, 2024

When adding new files to INET you will need to run the configuration stage of CMake again, i.e. go to your build directory and invoke cmake .. there. This step will search for all source files found in the extern subdirectories and add them to the build target. A follow-up build will then include also the new source files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants