Help solve a problem with importing a function from a dll - page 8

 

Read Google and it looks like I've got it right about stdafx.h :-))

Well... yeah... live and learn... :-)

 

Yes, yes.

Quite often the first link contains everything you need.

 

Interesting... and in Bilder 6 no one really swears at stdafx.h file, only 17 warnings and the file weighs half as much.

Hmmm...yeah...

I now have 2 seemingly working libraries :-). I'll be checking them out as they work with the data. Really hope for a positive result :-)))

 
jartmailru писал(а) >>

Um... Well, I kind of have to stick all the files in the project

that you sent me.

.

It honestly wouldn't even occur to me to think about

which one file from the set of files in the *library*

to add to the project.

I thought they were automatically pulled up the chain via the h-files. The first time I compiled and linked using only the svd.cpp file, however, there were no errors until I added extern. The svd.cpp has a link to its h file, and it refers to other h files, and those use cpp files with the same name. Seems to make as much sense as I thought. I just want to justify myself a bit, so that you won't get an idea that I'm completely stupid :-)). It's a shame when you get that kind of opinion :-)). Just kidding :-))

 
boysn >> :

I thought they were automatically pulled up the chain via h files. The first time, however, using only svd.cpp file, I compiled and slinked, there were no errors until I added extern. The svd.cpp has a link to its h file, and it refers to other h files, and those use cpp files with the same name. Seems to make as much sense as I thought. I just want to justify myself a bit, so that you won't get an idea that I'm completely stupid :-)). It's a shame when you get that kind of opinion :-)). Just kidding :-))

In order not to make such a mistake, you need to know this:

* Why divide files into .CPP / .H

* The difference between a function declaration and a declaration

* Why do we need inline / template- keywords?

* What happens if you declare functions inside a class declaration

* Purpose of compilation and linking

* Distinction and purpose of .OBJ / .LIB / .DLL / .EXE

* Static and dynamic linking

* What is Linker error = Unresolved function

* What is Linker error = Multiple symbol

* How the linker builds a binary file

* What is extern

.

So there you have it somewhere.

 
jartmailru >> :
* The difference between a declaration of a function and a declaration.

Well, declaration and declaration are the same thing :).

declaration -- definition.

 

Yes... I realised I was wrong... That's OK, we'll learn...

About the received dll... Unfortunately it hasn't lived up to my expectations so far :-), i.e. it certainly didn't work out right away. In principle it would be very nice to get it right away.

Alas, miracles never happen... :-)

I tried to give it as input a 3x3 square matrix. I know what the output should be, I know from the example. Unfortunately, the output has singular values of zeros, and the output matrices of vectors are singular.

I.e. something seems to be done, but I don't know what it is. As far as I understood it, it's impossible to write output information inside the dll... like print("a["+i+"]", a[i]), because it won't print it... This is what I judge from the very first example in this thread...

There it was the printf("GetDoubleValue takes %.8lf\n",dpar) function;

No information was printed to the meta-trader's logs, only the returned function value (return) was shown

So, as I understand it, I can't debug it this way, right? Or did I screw up again?

Now I'm trying to create an exe instead of dll project, because you told me that it's easier to debug eche projects...

Although the WinMain function appears there and I can't figure out how to dock my project to an exe project correctly...

And I did not understand yet which functions of output and which tools is better for me to debug... I'm reading Arkhangelsky now...

 
TheXpert >> :

Well, the declaration and announcement are the same thing :).

declaration -- definition.

Thanks for the mistake. I know it in English :-).

 
boysn >> :

However, the WinMain function appears there and I have not yet figured out how to dock my project correctly for the eche project...

And I have not yet figured out which output functions and tools I should debug... I am reading Arkhangelsky now...

And you, comrade, write a test code with your matrix 3 on 3 and debug output - and everything will work out.

The main thing is that you need a *console* application for printf().

 
Yes, I will try...