The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 ChiSquare Surface Problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

rhparker

USA
5 Posts

Posted - 01/16/2015 :  12:11:24 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Origin 9.0.0 SR2 b87
Operating System: Windows 7 64-bit

Hi all,
I'm not new to Origin, but I'm new to using Origin C. I'm trying to get Origin to generate a chisquare surface for some data I have. I found this example, but I can't get the example to run:
http://www.originlab.com/doc/OriginC/examples/ChiSquare-Space
Here's what I'm doing, step-by-step:
Open Origin 9.
Open Code Window.
Make new C file called chisquare_space.
Paste the source code for chiSqrSurf from that example after the "start your function here" line.
Save the file.
Go back to the main Origin window, open up the command window.
Paste in "run.LoadOC(Originlab\nlsf_utils.c);". There's no error message, so I guess that means it worked okay.
Go back to the code window. Click the build button. It returns:
compiling...
chisquare_space.c
Linking...
Done!
Then I make a new C file, named chiSqrSurf_ex1.
Paste the code for chiSqrSurf_ex1 from that example into this second C file.
Click the build button. This time I get three error messages:
compiling...
chiSqrSurf_ex1.c
D:\Users\Richard\Documents\OriginLab\90\User Files\OriginC\chiSqrSurf_ex1.c(55) :Error, Variable "NLFitSession FitSession" not declared
D:\Users\Richard\Documents\OriginLab\90\User Files\OriginC\chiSqrSurf_ex1.c(55) :Error, general compile error
D:\Users\Richard\Documents\OriginLab\90\User Files\OriginC\chiSqrSurf_ex1.c(32) :Error, error(s) found in compiling function chiSqrSurf_ex1

Compiling errors found, linking cannot start!

Does anyone know how to get this example program to run?

I did find an old topic on this forum about this issue, http://www.originlab.com/forum/topic.asp?TOPIC_ID=9597. The problem was eventually solved, unfortunately the link to the code that solved the problem no longer works. :(

Thanks to anyone who can help!


Castiel

343 Posts

Posted - 01/17/2015 :  08:56:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Add the following 2 lines at the beginning of chiSqrSurf_ex1.c, after #include <Origin.h>:

#include <..\originlab\NLFitSession.h>
extern BOOL chiSqrSurf(const vector& vX, const vector& vY, const vector& vParams, double dXFrom, double dXTo, int nXNumSteps, double dYFrom, double dYTo, int nYNumSteps, string strFunc = "Poly", int nVaryParamX = 0, int nVaryParamY = 1);


妾+   午旦  妹罕妾  妾伊    用仇  妾/     岫ㄞ
 妾京用 仍巨  件 侈   件戶' 甘岫平   /欠  白岫妹
   併             艮          岫  奈 白   岫
                              岫
Go to Top of Page

rhparker

USA
5 Posts

Posted - 01/18/2015 :  10:41:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Wow, thanks! Those new lines of code made it work, and I can take it from here. Thanks again!
Go to Top of Page

michelleronald

USA
1 Posts

Posted - 01/23/2015 :  06:05:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks (Castiel) for the new line.

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000