Advertisement

03.17.2008 at 05:16AM PDT, ID: 23246717
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

How do I use the Matlab complier correctly?

Tags: C# / Matlab
Hi,

I'm trying to follow this guide http://www.mathworks.com/support/solutions/data/1-X1PFC.html to generate a DLL so that I can access it from a C# application I have written.

When I try and run the example application (from visual studio 2005) I get the error message.

Could not initialize the library. Exception: Unable to find an entry point named
 'libtimestwoInitialize' in DLL 'C:\Documents and Settings\Drew\My Documents\MAT
LAB\libtimestwo.dll'.
Press Enter to Finish

I'm not really sure what this means, but it may be something to do with the compiler I'm using, the only options I get when I run mbuild setup are:

>> mbuild -setup
Please choose your compiler for building standalone MATLAB applications:
 
Would you like mbuild to locate installed compilers [y]/n? y
 
Select a compiler:
[1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2007a\sys\lcc
[2] Microsoft Visual C++ 2005 in C:\Program Files\Microsoft Visual Studio 8
[3] Microsoft Visual C++ 6.0 in C:\Program Files\Microsoft Visual Studio
 
[0] None

I don't think (correct me if I'm wrong) that any of these are the correct complier. Bearing in mind that this is a C# application what compiler should I be using and how do I get/install it?

Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: dsmclaughlin
Solution Provided By: itsmeandnobodyelse
Participating Experts: 1
Solution Grade: A
Views: 27
Translate:
Loading Advertisement...
03.22.2008 at 06:42AM PDT, ID: 21186253

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.22.2008 at 06:44AM PDT, ID: 21186262

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.22.2008 at 11:53AM PDT, ID: 21187333

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.23.2008 at 04:06AM PDT, ID: 21189217

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.23.2008 at 04:09AM PDT, ID: 21189221

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.23.2008 at 04:13AM PDT, ID: 21189238

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.23.2008 at 04:15AM PDT, ID: 21189250

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • Automotive
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Displays / Monitors
  • Handhelds / PDAs
  • Components
  • Peripherals
  • Laptops/Notebooks
  • Servers
  • Misc
  • Apple
  • Embedded Hardware
  • Networking Hardware
  • Storage
  • Desktops
  • New Users
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMware
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Virtualization
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • Web Computing
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Consulting
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMware
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Automation
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Web Services
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Web Computing
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Lounge
  • Business Travel
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
  • Automotive
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
03.22.2008 at 06:42AM PDT, ID: 21186253
>>>> Select a compiler:
These are all C++ compilers and as the dll where you want to access fron C# app is a C/C++ dll as well, you actually should select any of them - most probably the newest VC9 (VS 2008)  but VC6 and gcc are also valid alternatives for building a dll.

>>>> from visual studio 2005
You have a VC8 (VS2005) as well? You might get some problems building projects at the commandline if you don't properly separate all version of the VC compiler. All these VC installations have a batch command file (VCVars32.bat or similar) which would make a proper environment (PATH, INCLUDE, LIB environment variables) for commandline build. However, you still get a mix if some of the paths defined in that environment were permanently set by means of system settings. So, if you had a 'virgin' developer computer where you installed one and only *one* Visual Studio, you might have less problems...

>>>> Unable to find an entry point named
>>>> 'libtimestwoInitialize' in DLL
That most probably means that the libtimestwo.dll d oesn't fit to the version of MATLAB or to the version of your app (respectively the dll). Check your complete disk for the libtimestwo.dll, If there are more than one file, you actually need to make your PATH pointing to a different location rather than that it is pointing now.

FYI: dlls are 'dynamic loaded libraries' where the functions often were called by name. In the case above the app you started loaded a  libtimestwo.dll which it has found either in the current directory where the app resides, in a windows or windows\system directory or in a folder which was defined in the PATH environment variable (open a dos-box and type PATH). There normally were many paths defined and it would take the first of these where the dll could be found. After loading successfully (what seems to have worked) it tries to find the function 'libtimestwoInitialize' as a valid entry point but fails (what most likely means that the developers of the dll changed the name of the initialize function with a new version and the name not found is either the younger or the older name).
 
03.22.2008 at 06:44AM PDT, ID: 21186262
>>>> dlls are 'dynamic loaded libraries'
corrected: dynamic link libraries
 
03.22.2008 at 11:53AM PDT, ID: 21187333
Hi thanks for your post!

>>>> >>>> Select a compiler:
-ok great! so it doesn't matter which one I choose, that problem is sorted then!

>>>> >>>>  from visual studio 2005
>>>> You have a VC8 (VS2005) as well? .......

I only have VS2005, I thought it would be backwards compatible with the code given in th example link I posted. Perhaps it is not? I don't have much experience with VS or DLL's and I don't understand much about the environment that you are talking about. Could you please tell me how to set it up or indeed where I could read up about it?

My machine as only ever had VS2005 on it.

>>>> >>>> Unable to find an entry point named
>>>> >>>>  'libtimestwoInitialize' in DLL
>>>> That most probably means ..... your PATH pointing to a different location rather than that it is pointing now.....

....ok how do I change my Path?

>>>> FYI: dlls are 'dynamic loaded libraries' where the functions often were called by name....... it tries to find the function 'libtimestwoInitialize' as a valid entry point but fails (what most likely means that the developers of the dll changed the name of the initialize function with a new version and the name not found is either the younger or the older name).

so can I do anything about this?

when i type PATH at the VS command prompt i get this:

C:\Program Files\Microsoft Visual Studio 8\VC>PATH
PATH=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Mic
rosoft Visual Studio 8\VC\BIN;C:\Program Files\Microsoft Visual Studio 8\Common7
\Tools;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\bin;C:\Program F
iles\Microsoft Visual Studio 8\VC\PlatformSDK\bin;C:\Program Files\Microsoft Vis
ual Studio 8\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Progr
am Files\Microsoft Visual Studio 8\VC\VCPackages;C:\WINDOWS\system32;C:\WINDOWS;
C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;c:\Program Files\M
icrosoft SQL Server\90\Tools\binn\

does that help at all?

Also someone else got me to do a dump of the DLL which resulted in:

C:\Documents and Settings\Drew\My
Documents\MATLAB>dumpbin/exports libtimestwo.dll
Microsoft (R) COFF/PE Dumper Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file libtimestwo.dll

File Type: DLL

Section contains the following exports for libtimestwo.dll

00000000 characteristics
47E28A4D time date stamp Thu Mar 20 16:01:17 2008
0.00 version
1 ordinal base
5 number of functions
5 number of names

ordinal hint RVA name

1 0 000014CF _libtimestwoInitialize =
_libtimestwoInitialize
2 1 00001478 _libtimestwoInitializeWithHandlers
= _libtimestwoInitializeWithHa
ndlers
3 2 000014ED _libtimestwoTerminate =
_libtimestwoTerminate
4 3 00001533 _mlfTimestwo = _mlfTimestwo
5 4 00001504 _mlxTimestwo = _mlxTimestwo

Summary

1000 .bss
1000 .data
1000 .edata
1000 .idata
1000 .rdata
1000 .reloc
1000 .text

I think that shows you what methods are contained in the dll but I'm not sure.

Many thanks again for your help!

 
03.23.2008 at 04:06AM PDT, ID: 21189217
>>>> ok how do I change my Path?

At the commandline type

   set PATH=new_path_to_folder;%PATH

Note, if the new_path_to_folder has some spaces you need to quote it with "new_path_to_folder". Don't add any spaces around the =.

Or, in system settings\System\Enhanced...\Environment Variables:

If 'Path' is already defined *insert* the new folder. You either can use System or User Settings. Windows will make the PATH from both settings. Make sure that the correct path to libtimestwo.dll was defined prior to that of the wrong path (or remove the wrong path).

 
03.23.2008 at 04:09AM PDT, ID: 21189221
>>>> so can I do anything about this?

Yes, you either need to use the libtimestwo.dll which has the correct entry point, *or* you use the MATLAB version which fits to the used  libtimestwo.dll.

You can open the libtimestwo.dll in Visual Studio as a binary and search for the entry point. If you found more than one dll I am pretty sure that one will contain the needed entry point.
 
03.23.2008 at 04:13AM PDT, ID: 21189238
>>>> PATH=C:\Program Files\Microsoft Visual Studio 8

Your paths were pointing to the installation directory of VS 2005 (== VS8). But I assume that the correct libtimestwo.dll comes with MATLAB. If I am right you had to add the path where the correct libtimestwo.dll resides at the begin of the PATH environment variable so that the right dll was loaded (and not a maybe younger one from VS2005).

 
Accepted Solution
 
03.23.2008 at 04:15AM PDT, ID: 21189250
>>>> 1 0 000014CF _libtimestwoInitialize

That looks good. That is exactly the entry point searched for (the _ prefix was added by the linker). Is there somewhere a second version of that dll?
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628