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

Add two VS2015 projects for CSharp: SWIG binding builder & sample app #3217

Merged
merged 4 commits into from Sep 29, 2022

Conversation

nanangizz
Copy link
Member

@nanangizz nanangizz commented Aug 14, 2022

Using swig_csharp_pjsua2.vcxproj for generating SWIG binding files

  1. As we are generating a DLL, set the PJPROJECT solution config to "Debug-Dynamic" or "Release-Dynamic".
  2. Add any third-party dependency in the library search path in the project setting, e.g: libh264 library path.
  3. Make sure swig.exe is in the system path.
  4. Build. This should generate .cs files and pjsua2.dll in pjsip-apps/src/swig/csharp/output/.

Using the sample app SimplePjsua2CS

  1. Copy the SWIG generated .cs files (currently ~271 files) to folder pjsip-apps/src/swig/csharp/sample/SimplePjsua2CS/pjsua2/.
  2. Add reference to pjsua2.dll in the SimplePjsua2CS project.
  3. Run.

Troubleshooting

  • Error TypeInitializationException in running and there is build warning There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "pjsua2".
    Usually this can be solved by setting platform target in SimplePjsua2CS properties (in Build > General > Platform target) to match to the CPU config used to build the PJPROJECT.

@aparsaeeyan
Copy link

I followed the steps you said.
It created all the cs files and also created some other files named pjsua2.exp, pjsua2.lib, pjsua2_wrap.cpp but did not create the pjsua2.dll file. What should I do?
Also, I get another 185 error in Visual Studio after building the solution. But even with these errors, it creates cs files.errors

@aparsaeeyan
Copy link

Can you upload and post pjsua2.dll separately? No matter what I do it doesn't give me the pjsua2.dll file.

@maradv
Copy link

maradv commented Jan 17, 2024

@aparsaeeyan
We could resolve the linking errors by excluding the ignored libraries. However, we are unaware of any valid reason for excluding 'msvcrt.lib'.

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

Successfully merging this pull request may close these issues.

None yet

5 participants