Mixed assemblies and enhanced instruction set

A

Andrea Sansottera

I'm using Visual C++ Express 2005. I get an error when I try to
compile code with both /arch:SSE and /clr options.

cl : Command line error D8016 : '/arch:SSE' and '/clr' command-line
options are incompatible

Why is happening? According to the documentation it should be possible
(of course SSE instructions should be used just for native code).

"When compiling with /clr (Common Language Runtime Compilation), /arch
will have no effect on code generation for managed functions. /arch
only affects code generation for native functions."

http://msdn2.microsoft.com/en-us/library/7t5yh4fd(vs.80).aspx

Of course I can work around this error by building an SSE-optimized
native DLL and then a mixed DLL which depends on the previous one and
uses just the standard instruction set, but it's going to increase
complexity with no good reason.

Anyone getting the same error? I'm also wondering if I should report
this as a bug since the documentation does not specify the correct
behavior of the compiler. Thanks in advance, Andrea.
 
B

Ben Voigt [C++ MVP]

Andrea Sansottera said:
I'm using Visual C++ Express 2005. I get an error when I try to
compile code with both /arch:SSE and /clr options.

cl : Command line error D8016 : '/arch:SSE' and '/clr' command-line
options are incompatible

Why is happening? According to the documentation it should be possible
(of course SSE instructions should be used just for native code).

"When compiling with /clr (Common Language Runtime Compilation), /arch
will have no effect on code generation for managed functions. /arch
only affects code generation for native functions."

http://msdn2.microsoft.com/en-us/library/7t5yh4fd(vs.80).aspx

Of course I can work around this error by building an SSE-optimized
native DLL and then a mixed DLL which depends on the previous one and
uses just the standard instruction set, but it's going to increase
complexity with no good reason.

You shouldn't need a second DLL. Just specify /arch for the native .cpp
files, and /clr for the managed ones.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top