Visual Studio 2013 Unicode libraries

Post Reply
maikelnai
Posts: 21
Joined: Thu May 22, 2014 1:25 am

Visual Studio 2013 Unicode libraries

Post by maikelnai »

Dear all,

I'm developing a new application using VS2013 and Unicode configuration. I'm having problems (randomly crashes) and I suspect that is because I'm linking a non Unicode library (CameraLibrary2010D.dll) in a Unicode application. Make this sense?.

In a previous version of the application, developed with VS2008 and multibyte configuration (non Unicode), very close to this version, we used that library without any problem.

Thanks,
steven.andrews
NaturalPoint Employee
NaturalPoint Employee
Posts: 737
Joined: Mon Jan 19, 2015 11:52 am

Re: Visual Studio 2013 Unicode libraries

Post by steven.andrews »

Hello maikelnai,

The Camera SDK builds are set to compile with Unicode. It is important to note that there are almost no strings used in the Camera Library, which is what the Unicode setting is for.

One just needs to keep in mind that the few functions involving strings in the Camera SDK are always multi-byte and not Unicode. This could affect anything regarding stability. You can try reviewing any string processing to/from the Camera SDK and make sure you are assuming Camera SDK methods are using multi-byte, and convert to Unicode as needed.

I hope this information helps. If you require any further assistance, please feel free to open a Support ticket with us at help.naturalpoint.com

Best regards,
Steven
--
Steven Andrews
OptiTrack | Customer Support Engineer
maikelnai
Posts: 21
Joined: Thu May 22, 2014 1:25 am

Re: Visual Studio 2013 Unicode libraries

Post by maikelnai »

Dear Steven,

thanks for the answer.

I have reviewed the code and the methods from the SDK that use strings are not used.

May be the VS libraries (2013 instead of 2010) the origin of the problem?

Regards,
steven.andrews
NaturalPoint Employee
NaturalPoint Employee
Posts: 737
Joined: Mon Jan 19, 2015 11:52 am

Re: Visual Studio 2013 Unicode libraries

Post by steven.andrews »

Hello maikelnai,

In most cases, you can mix and match build platforms when linking against DLLs like the Camera SDK. Since we include builds for VS2008 -> VS2013, you should be able to utilize a matching build.

The one critical thing is if you are using the "D" version of the .LIB/.DLL, this stands for dynamic run-time linkage (/MD), and the "S" version is for static run-time linkage (/MT). This must match your application because the two heap managers are incompatible and will cause application instability on memory allocation/de-allocation.

Best,
Steven
--
Steven Andrews
OptiTrack | Customer Support Engineer
maikelnai
Posts: 21
Joined: Thu May 22, 2014 1:25 am

Re: Visual Studio 2013 Unicode libraries

Post by maikelnai »

Dear,

this is the configuration of the CodeGeneration:
DebugCodeGeneration.png
DebugCodeGeneration.png (91.81 KiB) Viewed 6986 times
and this is the link configuration:
DebugLinkerInput.png
DebugLinkerInput.png (84.85 KiB) Viewed 6986 times
I think we are doing everything OK but it still fails.
The error that usually reports VS is a problem in the heap, so I understand that is related with your description.

In the released SDK, there is no libraries for VS2013, just for 2008 and 2010:
Libraries.png
Libraries.png (7.68 KiB) Viewed 6986 times
Have you got any idea about the problem?

Kind regards
steven.andrews
NaturalPoint Employee
NaturalPoint Employee
Posts: 737
Joined: Mon Jan 19, 2015 11:52 am

Re: Visual Studio 2013 Unicode libraries

Post by steven.andrews »

Hi maikelnai,

It looks like the 2013 additions were made after our latest publish to the website. They should become available in the next round of releases.

If you submit a Support ticket at help.naturalpoint.com and address it to me, I can provide you with a nightly build that includes VS2013. To be honest, this may not resolve the issue for you. We have not seen a situation where building in VS2013 and linking to VS2010 Camera SDK has caused a problem.

Your project settings appear to be correct and you are linking to the correct library, so the Camera SDK may not be causing your instability. Are you incorporating any other third party libraries that might be problematic?

Cheers,
Steven
--
Steven Andrews
OptiTrack | Customer Support Engineer
maikelnai
Posts: 21
Joined: Thu May 22, 2014 1:25 am

Re: Visual Studio 2013 Unicode libraries

Post by maikelnai »

Hello Steven,

I don't use third party libraries, we just use your SDK in that project.

I have already submitted a ticket in the web related with this issue.

Kind regards,

Eduardo
Post Reply