The Nonlinear Optics Web Site

Origin C - Building you Library at Startup

 

Code Builder Path

In this example, we assume that your .cpp files, .h header file and Origin C Workspace file .OCW file are all stored in the directory:

C:\MyPath\C-Code\

See Origin C - Getting Started for an example of how to create a library of C functions.

Make sure that the Origin application is not running. Next, you will need to find the Origin.ini file. The location of this file varies depending upon the directory path that you chose when you loaded Origin. Usually, the directory ends with ...\OriginData\.

Open the Origin.ini file using a text editor such as MS Notepad and search for [OriginC]. Note that you should open Notepad as an administrator in order to be able to save changes. To do so, right click the Notepad application and click on the "Run as Administrator" menu item. Your user account on Windows 7 must have administrative privileges for this to work. Right after [OriginC] add the two lines:

WorkspaceFile=C:\MyPath\C Code\LibraryWorkspace.ocw

BuildOnStart=1

The "WorkspaceFile=" indicates the path where your workspace is saved. "LibraryWorkspace.ocw" is the filename of the Origin C workspace. "BuildOnStart=1" directs Origin to compile your code and building your library upon opening Origin, making it available for immediate use. With "BuildOnStart=0" your custom C library will NOT compile at startup.

When you are done, the [OriginC] part of your Origin.ini file should look something like this:

[OriginC]
StartupCompile=0
ShowFullPath=10
WorkspaceFile=C:\MyPath\C Code\LibraryWorkspace.ocw
BuildOnStart=1
;1 = build on startup, 0 to disable, -1 to disable system files compilation and precompiled header
;BuildOnStart=0

Note that lines preceded by ";" are not executed.

Save and close the Origin.ini file. When you open Origin, your library will be available for immediate use.

<<Back to Origin C - Getting Started