Microsoft (R) COFF/PE Dumper Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file SimpleMexVS.mexw32
File Type: DLL
Section contains the following exports for SimpleMex.dll
00000000 characteristics
467A8F0C time date stamp Thu Jun 21 10:45:32 2007
0.00 version
1 ordinal base
1 number of functions
1 number of names
ordinal hint RVA name
1 0 0001101E mexFunction = @ILT+25(_mexFunction)
Summary
1000 .data
1000 .idata
2000 .rdata
1000 .reloc
1000 .rsrc
4000 .text
10000 .textbss
Microsoft (R) COFF/PE Dumper Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file SimpleMexCB.mexw32
File Type: DLL
Section contains the following exports for SimpleMex.dll
00000000 characteristics
467AA204 time date stamp Thu Jun 21 12:06:28 2007
0.00 version
1 ordinal base
1 number of functions
1 number of names
ordinal hint RVA name
1 0 00001005 mexFunction = @ILT+0(_mexFunction)
Summary
1000 .data
1000 .idata
2000 .rdata
1000 .reloc
1000 .rsrc
4000 .text
Maybe he has something to share...I have. ;-)
Is there any way to capture the command terminal steps of both programs? So I can see what is actually being passed to cl.exe by VS and cl.exe by C::B?
Is there any way to capture the command terminal steps of both programs? So I can see what is actually being passed to cl.exe by VS and cl.exe by C::B?VS2005 generally creates a build log in the intermediate files directory called BuildLog.htm. In Code::Blocks, you can see the full command line in the Build Log window by changing the Compiler logging option in Settings->Compiler and debugger->Global compiler settings->Other settings to "Full command line".
Is there any way to capture the command terminal steps of both programs? So I can see what is actually being passed to cl.exe by VS and cl.exe by C::B?In Matlab there is a verbose switch (or similar) for the compiler... I don't recall exactly - but I can have a look when I'm at work if you like. For C::B have a look at my sig. It will tell you what to do... ;-)
VS2005 generally creates a build log in the intermediate files directory called BuildLog.htm.I believe he isn't compiling in VC2005 but in Matlab - but even there *could* be created a build log... if it is setup (which is the default IMHO).
Just to review, I can compile and run mex files from VS with no problems.Oh! Ok... this was my misunderstanding. I though you only use the compiler of VS2005 but compile inside Matlab. (I always did that.) Ok then... probably in this case the batch file from Matlab is incorrect. Make sure you do a "mex -setup" before (on the Matlab prompt) and configure Matlab appropriately for the VC compiler. But you can also parse the log... this should contain the most important information, too.
First the possible bug. After thoroughly scouring the build logs of both VS and C::B, I found that the link option "/DEBUG" was present in VS but not in C::B. To try and fix this, I went to C::B->Build Options->Link Settings->Other linker options and added /DEBUG. But whenever I hit "Ok" and recompiled, the "/DEBUG" option did not show up. In fact when I went back to the build options page, what I had entered disappeared?! Maybe this has already been reported? Anways, as a quick fix, I went to Settings->Compiler and debugger...->Other settings->Advanced options... and essentially hardcoded "/DEBUG" into the "Link object files to dynamic library" command. After the fix, what do you know.. The dumpbin for both the C::B compiled library and the C::B compiled mex file were identical!
link.exe /dll /nologo /LIBPATH:"C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\lib" /LIBPATH:"C:\Program Files\Microsoft Visual Studio 8\VC\lib" /out:bin\Debug\TestDLL.dll user32.lib obj\Debug\main.obj /DEBUG
I went to C::B->Build Options->Link Settings->Other linker options and added /DEBUG. But whenever I hit "Ok" and recompiled, the "/DEBUG" option did not show up.Sure not. If you enter such option by hand that is part of the "official" list of compiler/linker settings it will be "transferred" into the appropriate checkbox being activated. It works like that:
The updated wizard is in Rev 4153.
So in your case if you added "/DEBUG" by hand int he text field next time you enter the dialog the appropriate checkbox is activated -> the settings do not get lost.
This is the full commandline which C::B generates and it has /DEBUG directive.
Please note that in the new wizard, incremental linking is set to NO. This is necessary to embed the manifest in a simple way.
Great! I will give the new build a test run when it comes out.
I just had to change some of the directories the mt.exe program was looking in to find some of my files but otherwise it works great.
Is it a bug or a customisation that you needed? Please post if wizard created project doesn't work well.
I could probably make a wizard just for Matlab mex functions?It's not as easy as you may think - you will have to take a lot into account. There are at least 3 different Matlab versions (in terms of MEX files) that require different settings which itself depend on the compiler. In addition the language matters - you can have Fortran, C and C++ MEX functions. BTW: the mexw32 extension is rather new so this would break any old Matlab version - so be careful with this. BUT: I am working on that, too already. It's not yet perfect but it's btw the most complex wizard I've ever done. ;-) Any yes: It *has* to be a different wizard than the DLL one.