Visual Studio 2010 and MinGW

I have a bunch of old C code that I compiled using MinGW, and copied the generated library files into the VS C ++ DLL (C ++ / CLI) Project (named NBIS) directory and added them to Linker-> Input Files setting . The contents of this field for each configuration are shown below.

Release configuration

liban2k.a;libbozorth3.a;libcblas.a;libclapck.a;libf2c.a;libfet.a;libfft.a;libihead.a;libimage.a;libioutil.a;libjpegb.a;libjpegl.a;libmindtct.a;libmlp.a;libnfiq.a;libnfseg.a;libpca.a;libpcautil.a;libutil.a;libwsq.a;libgcc.a;libmingwex.a;libmoldname.a;libmsvcr100.a 

Debug Configuration

 liban2k.a;libbozorth3.a;libcblas.a;libclapck.a;libf2c.a;libfet.a;libfft.a;libihead.a;libimage.a;libioutil.a;libjpegb.a;libjpegl.a;libmindtct.a;libmlp.a;libnfiq.a;libnfseg.a;libpca.a;libpcautil.a;libutil.a;libwsq.a;libgcc.a;libmingwex.a;libmoldname.a;libmsvcr100d.a 

When I compile and run using the debug configuration, it succeeds. When I compile and run using the release configuration, I get this error: "Unhandled Exception: System.IO.FileLoadException: Failed to load the procedure imported by" NBIS.dll ".

If I change the C / C ++ โ†’ Generation Generation-> Runtime Library release configuration to "Multithreaded Debugging DLL (/ MDd)", the release configuration can successfully compile and run. Does anyone encounter a similar problem and have a solution or some guidance on how to fix this problem?

+2
source share
1 answer

According to http://msdn.microsoft.com/en-us/library/xe4t6fc1(v=vs.71).aspx , the Generate Debug Info (/ DEBUG) option changes the default values โ€‹โ€‹for the / OPT option from REF to NOREF and from ICF to NOICF. "This may be the removal of characters that you really need. Install it in NOREF and see what happens (Configuration Properties / Ruler / Optimization page).

+2
source

Source: https://habr.com/ru/post/1275809/


All Articles