lundi 21 janvier 2019

C++

I don't have formal VS training, and I usually use it to program simple tools for my research. (I'm a faculty member).

I'm currently working on a C++ library for Python using SWIG, so I followed the steps suggested in How to create a DLL with SWIG from Visual Studio 2010?

Step no. 25 says "You can't build the Debug version unless you build a debug version of Python itself", but I thought one could be able to build a Debug version of the C++ stuff by writing a main that uses the library from C++ itself, without touching Python. (Please let me know if I'm wrong.)

A while ago I tried creating two projects in one solution (one for the library, one for a testing app), but I wasn't quite convinced with the result, so I thought it was time to try configurations. So I modified the Debug config for my Swig project following the suggestions in Redifining C/C++ entry point in Microsoft Visual Studio 2015 and the comments (changed configuration type, extension, and entry point, and added additional dependencies vcruntimed.lib and ucrtd.lib).

The project compiles and runs, but the methods/functions in the standard <random> C++ library are returning non-random numbers (always the same).

I checked the code and the generator is being seeded correctly. Also the library is still working fine, so I tend to think it is not a coding but a configuration issue.

I know this would be a better question if I posted a MWE, but before investing time (which I think I don't have) on it I was wandering if there is something obvious I'm missing, that a more knowledgeable VS user could easily spot. Please don't get me wrong, if I'm mistaken and the answer is not so apparent, I'll really try to make the time.

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire