Author Topic: MatLab and Code::Blocks  (Read 43171 times)

Offline zergling

  • Multiple posting newcomer
  • *
  • Posts: 10
MatLab and Code::Blocks
« on: January 06, 2011, 03:33:57 am »
Good Morning Every one!
I am opening up this thread because I would like to use Matlab with Code::Blocks under Linux Debian.
Could someone please help me out with the settings?
Moreover, is it possible to create a project wizard for matlab?
Bye and thank you very much.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: MatLab and Code::Blocks
« Reply #1 on: January 06, 2011, 06:33:50 am »
Moreover, is it possible to create a project wizard for matlab?
Probably you should also start telling what version of C::B you are using. Since 10/05 (and even before) a Matlab wizard at least for S-Functions is present. What shall the wizard do exactly? What have you in mind? A little less information, don't you think?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline zergling

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: MatLab and Code::Blocks
« Reply #2 on: January 06, 2011, 07:23:54 am »
Hi, the version that I am currently using is: svn build rev 6906 (2010-12-27 15:27:55) gcc 4.3.2 Linux/unicode - 64 bit

By playing around, I was able to show the matlab's icon in the project wizard : kdesudo kate /usr/share/codeblocks/templates/wizard/config.script
by removing the if statement in RegisterWizard(wizProject,       _T("matlab_csf"),   _T("Matlab project"),        _T("Console"));

Now my question is: How do I set up the matlab environment in code::blocks?
For example, when I select the matlab location and I click next, I get

The Matlab path you entered seems valid, but this wizard
can't locate the GCC library path in the sub-directory
/extern/lib/win32/gcc

I know that the script is not correct because for what I can see, is for windows. Is there any wizard script for Linux? If not, could you please help me out to configure it out?

Bye and thank you very much.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: MatLab and Code::Blocks
« Reply #3 on: January 06, 2011, 09:51:25 am »
I know that the script is not correct because for what I can see, is for windows. Is there any wizard script for Linux? If not, could you please help me out to configure it out?
Ah - I see. Well I did the Matlab wizard for Windows but I don't have access to an Matlab on a Linux environment, that's why it's Windows only atm. However, you can really try to do it yourself (it's very easy) by adopting the script ([C::B]\share\CodeBlocks\templates\wizard\matlab_csf\wizard.script) accordingly. Have a look at other wizards (e.g. the wxWidgets wizard) to see how to detect the OS environment and set the compiler/linker flags accordingly. If you want to you can also use global variables instead of hard-coded path's and let the user make setup the base patch (i.e. installation directory) of Matlab.

If you need assistance, ask here in this forum and I'll see what I can do. I would need (however) at least a list of the Matlab related files and libraries in terms of how and where they are installed in a Linux environment.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline zergling

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: MatLab and Code::Blocks
« Reply #4 on: January 08, 2011, 02:40:20 pm »
Hi Morten,
I modified the script like this, but still, it does not work; I am still getting an error such as "The Matlab path you entered seems valid, but this wizard
can't locate the Matlab extern include path in the sub-directory /extern/include"

I have Matlab installed in /media/school/MATLAB/

Moreover, I noticed that the script is looking for /sys/lcc/. I looked in my sys and I do not have that directory I have only fonts, gs8x, jade, java, namespace, opengl, os, tex

Could you please help me out? I really need to fix this problem :(

Code
////////////////////////////////////////////////////////////////////////////////
//
// Matlab S-Function project wizard
//
////////////////////////////////////////////////////////////////////////////////

// globals
MatlabPath <- _T("");

function BeginWizard()
{
  local intro_msg = _T("Welcome to the new Matlab C-S-Function project wizard!\n\n" +
                       "This wizard will guide you to create a new project\n" +
                       "creating a Matlab C-S-Function using the GCC\n" +
                       "or Matlab LCC compiler.\n\n" +
                       "For GCC you must have converted the Matlab DLL's into\n" +
                       "GCC compatible libraries using the DLLTOOL before.\n" +
                       "This wizard expects the GCC libraries at the location:\n" +
                       "[MATLAB]/extern/lib/win32/gcc\n\n" +
                       "When you're ready to proceed, please click \"Next\"...");

  local matlabpath_descr = _T("Please select the location of Matlab on your computer.\n" +
                              "This is the top-level folder where Matlab was installed.");

  Wizard.AddInfoPage(_T("MatlabCSFIntro"), intro_msg); // intro
  Wizard.AddProjectPathPage();
  Wizard.AddCompilerPage(_T(""), _T("gcc;lcc"), true, false); // compiler selection but no path selection
  Wizard.AddGenericSelectPathPage(_T("MatlabPath"), matlabpath_descr, _T("Please select Matlab's location:"), _T("$(#matlab)"));
  Wizard.AddPage(_T("MatlabHint"));
}

////////////////////////////////////////////////////////////////////////////////
// Matlab's path page
////////////////////////////////////////////////////////////////////////////////

function OnLeave_MatlabPath(fwd)
{
  if (fwd)
  {
    local dir         = Wizard.GetTextControlValue(_T("txtFolder")); // txtFolder is the text control in GenericSelectPathPage
    local dir_nomacro = ReplaceMacros(dir, true);
    if (!IO.DirectoryExists(dir_nomacro))
    {
      ShowError(_T("Please select a valid path to Matlab..."));
      return false;
    }
    // Verify Matlab extern includes
    if (!IO.DirectoryExists(dir_nomacro + _T("/media/school/MATLAB/R2010b/extern/include")))
    {
      ShowError(_T("The Matlab path you entered seems valid, but this wizard\n" +
                   "can't locate the Matlab extern include path in the sub-directory /extern/include"));
      return false;
    }
    // Verify Matlab extern tmwtypes.h (Simulink types)
    if (!IO.FileExists(dir_nomacro + _T("/media/school/MATLAB/R2010b/extern/include/tmwtypes.h")))
    {
      ShowError(_T("The Matlab extern path seems valid, but this wizard\n" +
                   "can't locate the Matlab twmtypes.h in it."));
      return false;
    }
    // Verify Simulink includes
    if (!IO.DirectoryExists(dir_nomacro + _T("/media/school/MATLAB/R2010b/simulink/include")))
    {
      ShowError(_T("The Matlab path you entered seems valid, but this wizard\n" +
                   "can't locate the Simulink include path in the sub-directory\n"
                   "/simulink/include"));
      return false;
    }
    // Verify Matlab extern tmwtypes.h (Simulink types)
    if (!IO.FileExists(dir_nomacro + _T("/media/school/MATLAB/R2010b/simulink/include/simstruc.h")))
    {
      ShowError(_T("The Matlab-Simulink include path seems valid, but this wizard\n" +
                   "can't locate the Matlab simstruc.h in it."));
      return false;
    }

    if (Wizard.GetCompilerID().Matches(_T("lcc")))
    {
      // Verify LCC includes
      if (!IO.DirectoryExists(dir_nomacro + _T("/sys/lcc/include")))
      {
        ShowError(_T("The Matlab path you entered seems valid, but this wizard\n" +
                     "can't locate the LCC include path in the sub-directory\n" +
                     "/sys/lcc/include"));
        return false;
      }
      // Verify LCC libraries
      if (!IO.DirectoryExists(dir_nomacro + _T("/extern/lib/win32/lcc")))
      {
        ShowError(_T("The Matlab path you entered seems valid, but this wizard\n" +
                     "can't locate the LCC library path in the sub-directory\n" +
                     "/extern/lib/win32/lcc"));
        return false;
      }
    }
    else if (Wizard.GetCompilerID().Matches(_T("gcc")))
    {
      // Verify GCC libraries
      if (!IO.DirectoryExists(dir_nomacro + _T("/extern/lib/win32/gcc")))
      {
        ShowError(_T("The Matlab path you entered seems valid, but this wizard\n" +
                     "can't locate the GCC library path in the sub-directory\n" +
                     "/extern/lib/win32/gcc"));
        return false;
      }
    }

    MatlabPath = dir;
  }
  return true;
}

// return the files this project contains
function GetFilesDir()
{
  local result = _T("matlab_csf/files");
  if (Wizard.GetCompilerID().Matches(_T("lcc")))
    result += _T(";matlab_csf/lccstub");

  return result;
}

// setup the already created project
function SetupProject(project)
{
  // enable compiler warnings (project-wide)
  if (Wizard.GetCompilerID().Matches(_T("lcc")))
  {
    if (!CompilerFactory.IsValidCompilerID(_T("lcc")))
    {
      ShowError(_T("The wizard has detected that your version of Code::Blocks does not\n" +
                   "support the LCC compiler which is required for this project.\n" +
                   "The wizard cannot continue. Please update Code::Blocks."));
      return false;
    }

    // set project options for LCC
    project.SetModeForPCH(pchSourceDir);
    project.AddCompilerOption(_T("-Zp8"));              // 8 byte alignment
    project.AddCompilerOption(_T("-noregistrylookup")); // do not query the registry for libpath

    project.AddLinkerOption(_T("-s"));
    project.AddLinkerOption(_T("-tmpdir \".\""));
    project.AddLinkerOption(_T("-libpath ") + MatlabPath + _T("\\extern\\lib\\win32\\lcc"));
    project.AddLinkerOption(MatlabPath + _T("\\extern\\lib\\win32\\lcc\\mexFunction.def"));
  }
  else if (Wizard.GetCompilerID().Matches(_T("gcc")))
  {
    // set project options for GCC
    project.SetModeForPCH(pchSourceDir);
    project.AddCompilerOption(_T("-malign-double"));    // 8 byte alignment
    project.AddCompilerOption(_T("-fno-exceptions"));   // exception free code

    project.AddLinkerOption(_T("-shared"));
    project.AddLinkerOption(_T("-Wl,--out-implib=sfuntmpl")+DOT_EXT_STATICLIB);
    project.AddLibDir(MatlabPath + _T("/extern/lib/win32/gcc"));
  }
  else
  {
    ShowError(_T("The selected compiler is not compatible with Matlab.\n" +
                 "The wizard cannot continue."));
    return false;
  }

  // set common project options (the same for both compilers)
  project.AddCompilerOption(_T("-DNDEBUG"));
  project.AddCompilerOption(_T("-DMATLAB_MEX_FILE"));

  project.AddIncludeDir(MatlabPath + _T("\\extern\\include"));
  project.AddIncludeDir(MatlabPath + _T("\\simulink\\include"));

  project.AddLinkLib(_T("libmx"));
  project.AddLinkLib(_T("libmex"));
  project.AddLinkLib(_T("libmatlb"));
  project.AddLinkLib(_T("libmat"));

  // Debug
  local target = project.GetBuildTarget(Wizard.GetDebugName());
  if (!IsNull(target))
  {
    target.SetTargetType(ttDynamicLib);
    // the s-function DLL must have the same name as the file/function
    target.SetOutputFilename(_T("sfuntmpl") + DOT_EXT_DYNAMICLIB);
    target.SetWorkingDir(_T("."));

    if (Wizard.GetCompilerID().Matches(_T("lcc")))
    {
      // It only works that way because the LCC resource compiler does not
      // support creating it's "object files" (*.res) in any sub-directory
      target.SetObjectOutput(_T(".")); //
    }
  }

  // Release
  target = project.GetBuildTarget(Wizard.GetReleaseName());
  if (!IsNull(target))
  {
    target.SetTargetType(ttDynamicLib);
    // the s-function DLL must have the same name as the file/function
    target.SetOutputFilename(_T("sfuntmpl") + DOT_EXT_DYNAMICLIB);
    target.SetWorkingDir(_T("."));

    if (Wizard.GetCompilerID().Matches(_T("lcc")))
    {
      // It only works that way because the LCC resource compiler does not
      // support creating it's "object files" (*.res) in any sub-directory
      target.SetObjectOutput(_T(".")); //
    }
  }

  return true;
}

Please let me know if you need more info about my Matlab directories.
Bye and thank you so much for everything.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: MatLab and Code::Blocks
« Reply #5 on: January 08, 2011, 03:50:37 pm »
Could you please help me out? I really need to fix this problem :(
The LCC compiler is used on Windows only, IMHO (I am not aware of any Linux LCC version). Under Linux I'd say Matlab uses the GCC. Thus you'll need to adopt the wizard in a way that it finds the default GCC compiler path and therefore also the Matlab header files for GCC, not LCC or MSVC or alike.

Can you do a recursive directory listing of the Matlab installation (probably including the files), pipe the output in a file, zip the file and attach it here? Then I can have a look where the required files are.

Thanks for your effort anyways! :-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline zergling

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: MatLab and Code::Blocks
« Reply #6 on: January 08, 2011, 05:44:28 pm »
Hi Morten,
The file is 500kb and the limit here is 128kb.
Is that ok with you if I copy the output in the forum?
Bye and thank you again!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: MatLab and Code::Blocks
« Reply #7 on: January 08, 2011, 07:20:02 pm »
You can use some pastebin service :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline zergling

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: MatLab and Code::Blocks
« Reply #8 on: January 08, 2011, 09:09:16 pm »
I just uploaded the file http://ggwvideos.altervista.org/beppe/mathlab_file_list.tar.gz

Just click where is says qui

Please let me know if you need any more info.

Thank you again!

Offline zergling

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: MatLab and Code::Blocks
« Reply #9 on: January 10, 2011, 08:48:25 am »
Hi Morten,
I was just wondering if you got the file  :o
Bye and thank you.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: MatLab and Code::Blocks
« Reply #10 on: January 10, 2011, 09:20:32 am »
I was just wondering if you got the file  :o
Yes, I got it but didn't find the time to look into...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: MatLab and Code::Blocks
« Reply #11 on: January 10, 2011, 10:10:12 am »
OK, I see here:
Quote
./R2010b/extern:
examples
include
lib
...the include folder should be [MATLAB]/extern/include, [MATLAB]/simulink/include, the library folder /extern/lib/glnxa64 and another one I am missing where all the link libraries are installed into. Most likely these have been put under /usr/local/lib/matlab or something like that... can you check that (it depends on the Linux platform unfortunately)? You can search for e.g. libmex* on your HDD and look if you find libmex.a somewhere.

Note that is seems you'll need [MATLAB]/bin/glnxa64 in the LD_LIBRARY path (if not already there).

What you can do alternatively anyways is setting up the compiler inside Matlab to be verbose and inspect what's printed on the command prompt There should be the whole command line including all flags / include folder you'll need. You'll find the option somewhere in the preferences. Not sure where on Linux.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline zergling

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: MatLab and Code::Blocks
« Reply #12 on: January 13, 2011, 04:25:28 am »
Hi,
I am still getting the message "The Matlab path you entered seems valid, but this wizard
can't locate the Matlab extern include path in the sub-directory /extern/include"
Is it possible (when you have time) to go over the code::blocks script wizard and all the settings together?
Or, would be possible to have the matlab script implemented within the next nightly build (like in the win version)?
I am really sorry for bugging you so much, but I do really love this compiler  8)
« Last Edit: January 13, 2011, 05:25:02 am by zergling »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: MatLab and Code::Blocks
« Reply #13 on: January 13, 2011, 07:32:44 am »
Hi,
I am still getting the message "The Matlab path you entered seems valid, but this wizard
can't locate the Matlab extern include path in the sub-directory /extern/include"
Is it possible (when you have time) to go over the code::blocks script wizard and all the settings together?
Or, would be possible to have the matlab script implemented within the next nightly build (like in the win version)?
I am really sorry for bugging you so much, but I do really love this compiler  8)
What I see from a quick look:
This line:
Code
if (!IO.DirectoryExists(dir_nomacro + _T("/media/school/MATLAB/R2010b/extern/include")))
...cannot work and will always return false. Notice that you enter the patch to Matlab in the wizard - so in your case it's /media/school/MATLAB/R2010b. If you combine the path entered as you do you get the following directory:
/media/school/MATLAB/R2010b/media/school/MATLAB/R2010b/extern/include
...which does not exist - that's what the wizard complains.

Look: I can't do a wizard for Matlab under Linux as I don't have Matlab under Linux and I won't commit things that most likely will not work as they are untested. I'll need your help for the trials. BTW: Hard-coded path's should not be in the wizard anyways. The wizard asks for a base directory. All other directories in the wizard should either be relative or in combination with the base directory.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline zergling

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: MatLab and Code::Blocks
« Reply #14 on: January 13, 2011, 09:10:42 am »
Thank you for your help!
Finally I was able to go over the script wizard :D

The only problem it that I do not know which header files I have to include...
By default I have #include <windows.h> that is for a windows system.

This is what I have done so far with the matlab script wizard.
By the way, can I remove all the lcc references in the script?
Code
////////////////////////////////////////////////////////////////////////////////
//
// Matlab S-Function project wizard
//
////////////////////////////////////////////////////////////////////////////////

// globals
MatlabPath <- _T("");

function BeginWizard()
{
  local intro_msg = _T("Welcome to the new Matlab C-S-Function project wizard!\n\n" +
                       "This wizard will guide you to create a new project\n" +
                       "creating a Matlab C-S-Function using the GCC\n" +
                       "or Matlab LCC compiler.\n\n" +
                       "For GCC you must have converted the Matlab DLL's into\n" +
                       "GCC compatible libraries using the DLLTOOL before.\n" +
                       "This wizard expects the GCC libraries at the location:\n" +
                       "[MATLAB]/extern/lib/win32/gcc\n\n" +
                       "When you're ready to proceed, please click \"Next\"...");

  local matlabpath_descr = _T("Please select the location of Matlab on your computer.\n" +
                              "This is the top-level folder where Matlab was installed.");

  Wizard.AddInfoPage(_T("MatlabCSFIntro"), intro_msg); // intro
  Wizard.AddProjectPathPage();
  Wizard.AddCompilerPage(_T(""), _T("gcc;lcc"), true, false); // compiler selection but no path selection
  Wizard.AddGenericSelectPathPage(_T("MatlabPath"), matlabpath_descr, _T("Please select Matlab's location:"), _T("$(#matlab)"));
  Wizard.AddPage(_T("MatlabHint"));
}

////////////////////////////////////////////////////////////////////////////////
// Matlab's path page
////////////////////////////////////////////////////////////////////////////////

function OnLeave_MatlabPath(fwd)
{
  if (fwd)
  {
    local dir         = Wizard.GetTextControlValue(_T("txtFolder")); // txtFolder is the text control in GenericSelectPathPage
    local dir_nomacro = ReplaceMacros(dir, true);
    if (!IO.DirectoryExists(dir_nomacro))
    {
      ShowError(_T("Please select a valid path to Matlab..."));
      return false;
    }
    // Verify Matlab extern includes
    if (!IO.DirectoryExists(dir_nomacro + _T("/extern/include")))
    {
      ShowError(_T("The Matlab path you entered seems valid, but this wizard\n" +
                   "can't locate the Matlab extern include path in the sub-directory /extern/include"));
      return false;
    }
    // Verify Matlab extern tmwtypes.h (Simulink types)
    if (!IO.FileExists(dir_nomacro + _T("/extern/include/tmwtypes.h")))
    {
      ShowError(_T("The Matlab extern path seems valid, but this wizard\n" +
                   "can't locate the Matlab twmtypes.h in it."));
      return false;
    }
    // Verify Simulink includes
    if (!IO.DirectoryExists(dir_nomacro + _T("/simulink/include")))
    {
      ShowError(_T("The Matlab path you entered seems valid, but this wizard\n" +
                   "can't locate the Simulink include path in the sub-directory\n"
                   "/simulink/include"));
      return false;
    }
    // Verify Matlab extern tmwtypes.h (Simulink types)
    if (!IO.FileExists(dir_nomacro + _T("/simulink/include/simstruc.h")))
    {
      ShowError(_T("The Matlab-Simulink include path seems valid, but this wizard\n" +
                   "can't locate the Matlab simstruc.h in it."));
      return false;
    }

    MatlabPath = dir;
  }
  return true;
}

// return the files this project contains
function GetFilesDir()
{
  local result = _T("matlab_csf/files");
  if (Wizard.GetCompilerID().Matches(_T("lcc")))
    result += _T(";matlab_csf/lccstub");

  return result;
}

// setup the already created project
function SetupProject(project)
{

  if (Wizard.GetCompilerID().Matches(_T("gcc")))
  {
    // set project options for GCC
    project.SetModeForPCH(pchSourceDir);
    project.AddCompilerOption(_T("-malign-double"));    // 8 byte alignment
    project.AddCompilerOption(_T("-fno-exceptions"));   // exception free code

    project.AddLinkerOption(_T("-shared"));
    project.AddLinkerOption(_T("-Wl,--out-implib=sfuntmpl")+DOT_EXT_STATICLIB);
    project.AddLibDir(MatlabPath + _T("/extern/lib/win32/gcc"));
  }
  else
  {
    ShowError(_T("The selected compiler is not compatible with Matlab.\n" +
                 "The wizard cannot continue."));
    return false;
  }

  // set common project options (the same for both compilers)
  project.AddCompilerOption(_T("-DNDEBUG"));
  project.AddCompilerOption(_T("-DMATLAB_MEX_FILE"));

  project.AddIncludeDir(MatlabPath + _T("\\extern\\include"));
  project.AddIncludeDir(MatlabPath + _T("\\simulink\\include"));

  project.AddLinkLib(_T("libmx"));
  project.AddLinkLib(_T("libmex"));
  project.AddLinkLib(_T("libmatlb"));
  project.AddLinkLib(_T("libmat"));

  // Debug
  local target = project.GetBuildTarget(Wizard.GetDebugName());
  if (!IsNull(target))
  {
    target.SetTargetType(ttDynamicLib);
    // the s-function DLL must have the same name as the file/function
    target.SetOutputFilename(_T("sfuntmpl") + DOT_EXT_DYNAMICLIB);
    target.SetWorkingDir(_T("."));

    if (Wizard.GetCompilerID().Matches(_T("lcc")))
    {
      // It only works that way because the LCC resource compiler does not
      // support creating it's "object files" (*.res) in any sub-directory
      target.SetObjectOutput(_T(".")); //
    }
  }

  // Release
  target = project.GetBuildTarget(Wizard.GetReleaseName());
  if (!IsNull(target))
  {
    target.SetTargetType(ttDynamicLib);
    // the s-function DLL must have the same name as the file/function
    target.SetOutputFilename(_T("sfuntmpl") + DOT_EXT_DYNAMICLIB);
    target.SetWorkingDir(_T("."));

    if (Wizard.GetCompilerID().Matches(_T("lcc")))
    {
      // It only works that way because the LCC resource compiler does not
      // support creating it's "object files" (*.res) in any sub-directory
      target.SetObjectOutput(_T(".")); //
    }
  }

  return true;
}
« Last Edit: January 13, 2011, 09:14:42 am by zergling »