Hi,
After testing
Alternative Methods:
- Providing forward declarations
Since the source file has been compiled into a DLL, all you need to do is provide the necessary declarations.
main.cpp
void myFunction();
class Test;
class Test
{
public:
Test();
};
//import test.modules;
int main()
{
myFunction();
Test();
}
Or 2. Right click project -> Add -> Existing item: your test.modules.ixx file to the project. (test.modules.cpp file is not needed)
import test.modules;
int main()
{
myFunction();
Test();
}
The compiler will generate an ifc file for use in your project.
Also, don't forget to link to the DLL.
Best regards,
Minxin Yu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.