AMcTools Forum 
  HomeHelpSearchLogin  
 
Pages: 1 2 3 
Send Topic Print
Problem compiling userlib dll (Read 25466 times)
moderator
YaBB Administrator
*****
Offline

I love forums, don't
you?

Posts: 308
AMcTools (Spain)
Gender: male
Re: Problem compiling userlib dll
Reply #15 - 01/05/10 at 16:08:17
 
Just in case....

I believe Borland compilers always define a symbol, something like __BORLANDCPP__ or so, that can be used to detect it.
Back to top
 
 
WWW   IP Logged
Milwaukee
YaBB Newbies
*
Offline

I Love Coding!

Posts: 22

Gender: male
Re: Problem compiling userlib dll
Reply #16 - 11/30/10 at 15:04:56
 
Hello,
I have the same problem as Gif. Did some one found already a solution? I tried the same steps already without any success and I'm using VC++ 2005 too.
Thx for your answer in advance!
Back to top
 
 
  IP Logged
ThVortex
Global Moderator
*****
Offline



Posts: 160
Austin, TX, USA
Gender: male
Re: Problem compiling userlib dll
Reply #17 - 11/30/10 at 19:26:47
 
I have only tried using Visual Studio C++ Express 2008, but I was able to compile and successfully run my [url=http://sites.google.com/site/thvortex/vmlab/eeprom24]EEPROM[/url] component with it.

Have you tried using the blackbox.h file I posted in this topic? Make sure your #include uses the new blackbox.h and not the old one in VMLAB's "bin" directory.
Back to top
 
 
WWW   IP Logged
Milwaukee
YaBB Newbies
*
Offline

I Love Coding!

Posts: 22

Gender: male
Re: Problem compiling userlib dll
Reply #18 - 12/02/10 at 12:55:48
 
Hi ThVortex,
Yes, I tried to use a DLL which used your header, but it didnít work. I got back the reason 4 as before too.
Could you post an example with complete project files. That would be awesome.  :)

By the way I catched a failure in the header in general. There must be 'SET_VOLTAGE(PIN pin, double value)' instead of 'SET_VOLTAGE(PIN pin, LOGIC value) '.  ;)

Greets
-Milwaukee
Back to top
 
 
  IP Logged
ThVortex
Global Moderator
*****
Offline



Posts: 160
Austin, TX, USA
Gender: male
Re: Problem compiling userlib dll
Reply #19 - 12/06/10 at 20:45:37
 
Ok, give me a few more days and I'll try to post for you a VC++ project for a component DLL.

And, you're absolutely right about the SET_VOLTAGE() prototype. Thanks for noticing that.
Back to top
 
 
WWW   IP Logged
Milwaukee
YaBB Newbies
*
Offline

I Love Coding!

Posts: 22

Gender: male
Re: Problem compiling userlib dll
Reply #20 - 12/08/10 at 19:11:58
 
Thank you very much!  :)
Back to top
 
 
  IP Logged
ThVortex
Global Moderator
*****
Offline



Posts: 160
Austin, TX, USA
Gender: male
Re: Problem compiling userlib dll
Reply #21 - 12/14/10 at 22:16:05
 
Here is a Visual C++ 2008 Express solution/project that uses the example V2F user component. I have verified that both the Debug and Release builds work correctly.

The only project option I changed from the default is to disable precompiled headers because the original source code doesn't use the MS style stdafx.h/.cpp.

The blackbox.h in the zip file is the same as I posted earlier, plus the SET_VOLTAGE fix that you had noticed. I modified the v2f.cpp and v2f.rc files to use the local file ([tt]#include "blackbox.h"[/tt] instead of [tt]<blackbox.h>[/tt]). I also had to explicitly add [tt]#include <windows.h>[/tt] to the rc file; the Borland resource compiler must be including this file automatically.
Back to top
 
WWW   IP Logged
Milwaukee
YaBB Newbies
*
Offline

I Love Coding!

Posts: 22

Gender: male
Re: Problem compiling userlib dll
Reply #22 - 01/06/11 at 11:57:46
 
Hi,
Thanks again! Great work! :-)
... Almost everthing works fine. Just the method known() of class WORD8 is not supported by the adjusted blackbox.h.
If I will have time then I'll fix it and post it. Well, perhaps you will be faster, coz you more in to it.
Back to top
 
 
  IP Logged
ThVortex
Global Moderator
*****
Offline



Posts: 160
Austin, TX, USA
Gender: male
Re: Problem compiling userlib dll
Reply #23 - 01/07/11 at 20:47:32
 
I'm glad you got it working. The blackbox.h I put into the zip file is based on the original header that comes with VMLAB 3.15. That's why it doesn't have the known() function and various other changes. Since then I have re-written the WORD8 class to also include other sizes like 16 or 32 bits and with explicit little or big endian byte ordering.

I'm attaching a merged blackbox.h which includes both the pin declaration changes to make it work with Visual C and my own WORD8 class definitions that I've used with the ATmega168b timer code. If you could, please verify that it still works correctly with your code.

Note that there is one source incompatible difference in my own class definitions. The original WORD8 class had fields named "x" and "d". My version of the class instead has x() and d() member functions.
Back to top
 
WWW   IP Logged
Milwaukee
YaBB Newbies
*
Offline

I Love Coding!

Posts: 22

Gender: male
Re: Problem compiling userlib dll
Reply #24 - 01/09/11 at 13:31:55
 
Thank you for posting of the new merged header file.
I tried to use this new file with your posted project for vs c++, but I got a few errors relating to naming TYPE. So, I wasn't unable to further test the new header file.
Back to top
 
 
  IP Logged
ThVortex
Global Moderator
*****
Offline



Posts: 160
Austin, TX, USA
Gender: male
Re: Problem compiling userlib dll
Reply #25 - 01/09/11 at 18:32:54
 
Ok, I'll look into it.
Back to top
 
 
WWW   IP Logged
ThVortex
Global Moderator
*****
Offline



Posts: 160
Austin, TX, USA
Gender: male
Re: Problem compiling userlib dll
Reply #26 - 01/10/11 at 19:56:18
 
I fixed the compilation problems for blackbox.h when using Visual C++. The Microsoft compiler is stricter by requiring the "typename" keyword in a few places.
Back to top
 
WWW   IP Logged
Milwaukee
YaBB Newbies
*
Offline

I Love Coding!

Posts: 22

Gender: male
Re: Problem compiling userlib dll
Reply #27 - 01/10/11 at 21:21:35
 
Thanks a lot! I will use the function right tomorrow. :-)
Back to top
 
 
  IP Logged
ThVortex
Global Moderator
*****
Offline



Posts: 160
Austin, TX, USA
Gender: male
Re: Problem compiling userlib dll
Reply #28 - 01/10/11 at 23:06:10
 
Ok. Let me know if you have questions about using the WORD8 classes. There are some tricks you can do like taking a pointer to a WORD8 array and casting it to a WORD16LE or WORD16BE pointer to re-interpret the data.

Also don't forget that unknown bits behave like a third logic state. In other words, if "a" and "b" have unknown bits, then both a == b and a != b will return false.
Back to top
 
 
WWW   IP Logged
Milwaukee
YaBB Newbies
*
Offline

I Love Coding!

Posts: 22

Gender: male
Re: Problem compiling userlib dll
Reply #29 - 01/12/11 at 17:36:40
 
Ok, thank you for the hints. I'll keep it in mind. ... The new header works fine. Thank you again! :-)
Back to top
 
 
  IP Logged
Pages: 1 2 3 
Send Topic Print