Solved

Can anybody help me build a DLL ?

Posted on 2006-10-29
12
931 Views
Last Modified: 2012-05-05
Hi all

I am not a C++ developer. i am a Foxpro developer.

Can any one help me step by step on how to make a DLL from this open source project. There is a dll for  .net but not for C++ or VB6. Also there is a .XLL file for excel. Then i suppose it should be fairly be easy.

http://ta-lib.org/hdr_dw.html

I have Visual studio 6 installed.

Thanx in advance...


suhashegde
0
Comment
Question by:suhashegde
  • 9
  • 2
12 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 17828362
Zip file already contains ready for use library TA-Lib-Core.dll which can be find in ta-lib\dotnet\src\Release (Relaese configuration) and ta-lib\dotnet\src\Debug (Debug configuration). This is .NET library for C#/VB.NET clients. Is this what are you looking for?
There are also makefiles which build a lot of static libraries which should be used in C++ projects. How do you want to use this?
0
 
LVL 8

Author Comment

by:suhashegde
ID: 17831557
the TA-lib-core.dll is for use in .net I want a dll compiled in VC6 so that i can use in vfp6

CAn u help in posting a step by step way on how to make it into a VC6 DLL ? so that i can use in VFP ? (If the dll works in VB6 it will work in VFP6)

TIA
suhashegde
0
 
LVL 9

Assisted Solution

by:jhshukla
jhshukla earned 250 total points
ID: 17831946
Download the source code from ta-lib-0.2.0-src.zip OR ta-lib-0.2.0-src.tar.gz
There is a dsw project under ta-lib\c\ide\msvc\lib_proj.
Open the dsw file and build the entire project. I believe gen_code should be default project. It was for me on VS2003. Build failed on me with two linker errors
ta_regtest fatal error LNK1181: cannot open input file 'ta_libc_csr.lib'
gen_code fatal error LNK1181: cannot open input file 'ta_common_cmd.lib'
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 250 total points
ID: 17832016
There are lot of makefiles in this project. You need to decide which one of them to build - readme files describe the meaning of these files. To build makefile do the following steps:
1) Open Visual Studio command prompt. This is done using menu item from Start - Programs - Visual Studio menu.
2) Using DOS commands like cd go to directory which contains makefile
3) Type command
nmake

I tried this with Release version of C library, it builds a lot of static libraries which can be used in VC++ projects.
0
 
LVL 8

Author Comment

by:suhashegde
ID: 17832077
ta-lib\c\make\cdr\win32\msvc make file -- that makes it into multithread dll  but how ?

As per the info i gathered , gen_code is some kind of a code generator to add to all the .net,java etc project files .


I dont want lib files but a DLL

TIA
suhashegde
0
 
LVL 8

Author Comment

by:suhashegde
ID: 17840300
Am i asking for too much ? Is it so difiicult.? I know nothing of VC++ so my apologies . I thought when there were export functions for Execl already there the building a dll would be easy ....

Thanx for your inputs

suhashegde
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 8

Author Comment

by:suhashegde
ID: 17840503
hi,

I did run nmake but didnt get a dll file , am i missing something ?
0
 
LVL 8

Author Comment

by:suhashegde
ID: 17903734
Is it possible to include the generated .lib files into a new workspace as a DLL and export the functions of the .lib ?

If so any pointers to the same ?

thanx

suhashegde
0
 
LVL 8

Author Comment

by:suhashegde
ID: 17905845
I have been caught with the 1 that requires parameter input

it is like this

TA_RetCode TA_S_AD( int startIdx,
int endIdx,
const float inHigh[],
const float inLow[],
const float inClose[],
const int inVolume[],
int *outBegIdx,
int *outNbElement,
double outReal[] )

I put this in the .h file

class CMy_dllApp : public CWinApp
{
public:
int My_Ta_Initialize();
int My_Ta_Shutdown(void);
TA_RetCode My_TA_S_AD( int startIdx,
int endIdx,
const float inHigh[],
const float inLow[],
const float inClose[],
const int inVolume[],
int *outBegIdx,
int *outNbElement,
double outReal[] );

CMy_dllApp();


and

in the .cpp

TA_RetCode CMy_dllApp::My_TA_S_AD( <== First line error points here
int startIdx,
int endIdx,
const float inHigh[],
const float inLow[],
const float inClose[],
const int inVolume[],
int *outBegIdx,
int *outNbElement,
double outReal[] )
{

TA_RetCode retCode;

retCode = TA_S_AD(
int startIdx,
int endIdx,
const float inHigh[],
const float inLow[],
const float inClose[],
const int inVolume[],
int *outBegIdx,
int *outNbElement,
double outReal[] )

return retCode;
}

Where the input parameters are the first 6 and the last 3 are output.
Return shows execution success or failure ..

I get compiler error saying

C:\WIN98\Desktop\ta-lib-0.2.0-msvc\ta-lib\my_dll\my_dll.cpp(94) : error C2144: syntax error : missing ')' before type 'int'
C:\WIN98\Desktop\ta-lib-0.2.0-msvc\ta-lib\my_dll\my_dll.cpp(94) : error C2660: 'TA_S_AD' : function does not take 0 parameters
C:\WIN98\Desktop\ta-lib-0.2.0-msvc\ta-lib\my_dll\my_dll.cpp(102) : error C2059: syntax error : ')'
Error executing cl.exe.

Please help me on doing this

suhashegde
0
 
LVL 8

Author Comment

by:suhashegde
ID: 17905861
sorry copy and paste error

TA_RetCode TA_S_AD( int startIdx,
int endIdx,
const float inHigh[],
const float inLow[],
const float inClose[],
const int inVolume[],
int *outBegIdx,
int *outNbElement,
double outReal[] )

I put this in the .h file

class CMy_dllApp : public CWinApp
{
public:
int My_Ta_Initialize();
int My_Ta_Shutdown(void);
TA_RetCode My_TA_S_AD( int startIdx,
int endIdx,
const float inHigh[],
const float inLow[],
const float inClose[],
const int inVolume[],
int *outBegIdx,
int *outNbElement,
double outReal[] );

CMy_dllApp();


and

in the .cpp

TA_RetCode CMy_dllApp::My_TA_S_AD(
int startIdx,
int endIdx,
const float inHigh[],
const float inLow[],
const float inClose[],
const int inVolume[],
int *outBegIdx,
int *outNbElement,
double outReal[] )
{

TA_RetCode retCode;

retCode = TA_S_AD( <== First line error points here
int startIdx,
int endIdx,
const float inHigh[],
const float inLow[],
const float inClose[],
const int inVolume[],
int *outBegIdx,
int *outNbElement,
double outReal[] );

return retCode;
}
0
 
LVL 8

Author Comment

by:suhashegde
ID: 17920216
.h file
TA_RetCode My_TA_AD( int startIdx,
int endIdx,
const double inHigh[],
const double inLow[],
const double inClose[],
const int inVolume[],
int *outBegIdx,
int *outNbElement,
double outReal[]);

.cpp file

TA_RetCode CMy_dllApp::My_TA_AD( int startIdx,
int endIdx,
const double inHigh[],
const double inLow[],
const double inClose[],
const int inVolume[],
int *outBegIdx,
int *outNbElement,
double outReal[] )

{


retCode = TA_AD( startIdx,
endIdx,
inHigh,
inLow,
inClose,
inVolume,
outBegIdx,
outNbElement,
outReal );

return retCode;
}

.Def
LIBRARY "my_dll"
DESCRIPTION 'my_dll Windows Dynamic Link Library'

EXPORTS
; Explicit exports can go here
My_Ta_Initialize @1
My_Ta_Shutdown @2
My_TA_S_AD @3
My_TA_AD @4


The dll builds fine with no errors.

When I call it in VFP like this

DECLARE Integer My_Ta_Initialize IN "c:\my_dll.dll"
My_Ta_Initialize()
clear dlls
DECLARE long My_TA_AD IN "c:\my_dll.dll" integer,;
integer,;
double @high1,;
double @low1,;
double @close1,;
double @vol1,;
integer @ret1,;
integer @ret2,;
double @RET3


?My_TA_AD(0,461,@high1,@low1,@close1,@vol1,@ret1,@ret2,@ret3)

where high1,low1,close1,ret3 are arrays
ret1 and ret2 are integers


Vfp throws Illegal operation error and shuts down

ANy light on the same where i am wrong
0
 
LVL 8

Author Comment

by:suhashegde
ID: 18062098
Although none of the comments were helpfull i split points between you two

i created a .fll from the same and works great

thanx you all for your help

suhashegde
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now