MATRIXx

cancel
Showing results for 
Search instead for 
Did you mean: 

ucbhook Linking error when compiling simucb.dll

I'm trying to compile a simucb.dll and one of the linking errors is "ucbhook.obj : error LNK2001: unresolved external symbol _gstdwrt". Since ucbhook.c is generated automatically by MarixX and it presumably knows what it is doing, I'm guessing that I haven't included the library that defines gstdwrt in my C++ project. Does anyone know what this library is and where I should look for it? Thanks!

Eric
0 Kudos
Message 1 of 6
(8,683 Views)
You need to create a file , Sa_user.cmd that tells the system to compile and link your code. This file should be in your project directory.

In the file you should have

COMPILE YourFileName.c

LINKWITH YourFileName


Try this and see if it works.

TWK
Message 2 of 6
(8,683 Views)
I forgot to mention, I assume you are using a user code block, if so try the above.

If not you need to describe how you are using Xmath.
0 Kudos
Message 3 of 6
(8,683 Views)
Thanks for the reply. My first question is: What is an Sa_user.cmd file and what's it look like? Is it like a makefile?

I'm compiling an ugly mixture of C and legacy Fortran code. There is a user code block written in C (which the ucbhook function calls) which calls a Fortran function which then calls other Fortran functions. I don't know what that may do to the complexity of Sa_user.cmd. Currently, I'm learning how to use Microsoft Visual C++ to compile and link all my disparate files into a simucb.dll and I'm mired in the linking errors. Once I have the simucb.dll, I'm gonna stick that in my project directory and let MatrixX do its thing.
0 Kudos
Message 4 of 6
(8,683 Views)
The Sa_user.cmd is a text file, but sa_user.cmd is used for autocode not Usercode Blocks. If you are using autocode i could help

Did you look at the manual chapter 14 has lots of useful information. There is a template for using an user code block ( usr01.c or usr01.f)

Section 14.3 has a few tips on UCB considerations.

Sorry I can not help you further as I do not have much experience with UCB's. Most of my experience is with AutoCode.

After a quick scan of the chapter, the version of matrixx and the platform( unix vs windows) you use is an important consideration.
0 Kudos
Message 5 of 6
(8,683 Views)
Thanks anyway. Autocode is in my future so don't be surprised if you hear from me again.

Eric
0 Kudos
Message 6 of 6
(8,683 Views)