How to use XCode with my program
I had a look at https://developer.mozilla.org/en/Debugging_on_Mac_OS_X
I tried to follow the steps but I got stuck just as well as with another XCode tutorial written in Italian.
My problem is that so far I developed *so to speak* a small stand-alone C++ program, made up of one file only ... for the time being.
I need to extend (keep editing and adding new code branches) and debug exactly this program.
All the XCode tutorials assume that I have an application and ask me to identify a file with extension ".app" that I do NOT have. All what I have is my CC main program "get_AllVar_matrix.cc" with some older saved versions of it, and a library, called "drl", whose functions I am trying to use with my code. There is no ".app" file, nor do I know how to generate it. So my question is where do I go from here to use XCode IDE, that is not just its editor (which I am already using) but also its builder, and above all its debugger ?
So far I have manged to compile and run my program ina terminal shell and stuffing my program with "printf" statements (well actually ... cout <<) to trace the program behaviour. But as it grows biger and bigger I feel I need a debugger.
Unluckily this mailing-list does not allow or attachments which sometimes are useful to explain the problem better.
XCode looks harder than KDevelop which is not that easy either (for me) !
Thank you in advance for your help ... I am stuck here without a debugger ...
Maura



Debug with Xcode
hi-
The answer is very simple:
(1) Click the Run > Debugger menu item in Xcode and then click the "Build and Run" button in the resulting window; or:
(2) In Terminal cd to your build folder (by default in the directory of your project) and run gdb my_program as usual.
To get the program to stop midway you need to make a bug, or set a breakpoint (standard debugging stuff) otherwise the program exits before you can use the debugger with it. There is a Breakpoints button on the debugger window.
There is no .app extension because that is for a Cocoa application, not a simple C binary. Cocoa apps are bundles (a directory with application resources and executable image) with a .app extension. A simple C program is just a flat file which is a mach-O binary file.
You can go to:
http://www.peervisual.com/manuals/VvidgetCode
and read about several different type of tutorials on Xcode and also learn how to write a graphing application to boot!
thanks!-
-lance
How to use XCode with my program
Actually whil my C++ source code is displayed (edited) through XCode,
I click on Run item from the top menu bar.
The pop-down menu contains the item Debug and Debugger but they are both grayed out therefore not selectable..
The second solution you propose launches a text debugger rather than a grephical one.
I foud out that DDD exists also for Mac. I have used DDD on Linux several times.
However, since it is free-ware, I am not sure which site to get it from in order to grab the last version.
Moreover, DDD installation on Mac requires a pre-installer ... It's not so straightforward as it is on Linux boxes.
Anyway, if I could use XCode debugger I would be better off...
Thank you,
Maura
Xcode Debugger
I just wrote this program:
#include
#include
int main (int argc, const char * argv[]) {
// insert code here...
printf("Hello, World!\n");
abort();
return 0;
}
in Xcode and Xcode broke on abort() into the debugger and I could inspect the stack, etc. It "just worked" (for me).
You have to make your project in Xcode, not just import files into it like it is a text editor. You should start from scratch and make a new project > application > Command Line Tool and then Project > "Add To Project" to add your source files. Then build and run.
thanks!-
-lance
XCode like a development environment
I created a new project that I named "Dialanine-Dipeptide"I added he only cc source file I have written so far. The only button that is available in the pop -up window is Build-and-Go. If I click it than Failed and a number (112) appear on the bottom right corner of the window entitled with my project name.
Given the following facts:
1. In my source program I call some funtions from a library called drl
2. My compilation statement that I use from terminal shell is:
# g++ -Idrl -DYA_BLAS -DYA_LAPACK -DYA_BLASMULT -lblas -llapack
-framework vecLib -o get_AllVar_matrix get_AllVar_matrix.cc
3. The executable is run with 3 input parameters from command line
My questions are:
Q1. I guess I have to include all the drl files in my project.
drl is made up of classes, template functions, members include files,
and so on ....
How can I make the Builder aware of all these s/w components? In short,
how can I include them in my project ? Do I have to discriminate against
drl c++ source files and drl classes and templates, and members, and
include files ?
Q2: Assuming I can build an executable within XCode environment (I doubt it)
then how can I run it from inside XCode and passing to it the 3 input
parameters it expects ?
Thank you ery much
Some answers ...
A1: Use the Project > "Add To Project..." menu item. But before you do that, make a new Group folder and call it "Libraries" and then click on that folder and Add To Project within that folder. Alternatively, double-click on your Project Group (the top-most icon in the upper left of the Groups & Files), Click the "Build" tab and set the Linking attributes. You proably want to use "Other Linker Flags" and also in "Search Paths" alter "Library Search Paths". Right click on an entry to toggle the display format. Esentially you are altering gcc arguments.
A2: In "Groups & Files" go to your Executables group, click it and then click on your program's name and double click your program's name. In the resulting panel, then click the "Arguments" tab and enter arguments.
I am getting a lot of errors
In the on-line documentation of drl (library Whose functions I am using) it is recommended that drl be placed in the same directory as the user source program. It works this way when compiled outside Xcode.In the folowing I have pasted my working directory structure. File "get_AllVar_matrix.cc" contains the main program which parses the command line, calls the proper drl fuctions, and plots the results.
drwxr-xr-x 72 mauede staff 2448 Feb 1 03:45 drl
-rwxr-xr-x 1 mauede staff 476768 Feb 4 06:10 get_AllVar_matrix
-rw-r--r--@ 1 mauede staff 7568 Feb 5 00:21 get_AllVar_matrix.cc
host705:CC_src-Dir mauede$ cd drl
host705:drl mauede$ ll
total 1568
drwxr-xr-x 72 mauede staff 2448 Feb 1 03:45 .
drwxr-xr-x 18 mauede staff 612 Feb 5 00:21 ..
-rw-r--r--@ 1 mauede staff 6148 Jan 30 10:55 .DS_Store
-rw-r--r-- 1 mauede staff 785 Jun 5 2009 Makefile
drwxr-xr-x 25 mauede staff 850 Jan 19 05:42 base
drwxr-xr-x 4 mauede staff 136 Jan 19 05:42 blas
drwxr-xr-x 9 mauede staff 306 Jan 19 05:42 common
drwxr-xr-x 21 mauede staff 714 Jan 19 05:42 dimred
-rw-r--r-- 1 mauede staff 4811 Jun 5 2009 f2c.h
drwxr-xr-x 270 mauede staff 9180 Jan 19 05:42 gsl_cblas
drwxr-xr-x 5 mauede staff 170 Jan 19 05:42 iters
-rw-r--r-- 1 mauede staff 3243 Jun 5 2009 listnode.h
-rw-r--r-- 1 mauede staff 3154 Jun 5 2009 mapnode.h
-rw-r--r-- 1 mauede staff 5491 Jun 5 2009 math_random.h
drwxr-xr-x 14 mauede staff 476 Jan 19 05:42 matrices
-rw-r--r-- 1 mauede staff 7397 Jun 5 2009 matrix_example.h
drwxr-xr-x 9 mauede staff 306 Jan 19 05:42 memory
drwxr-xr-x 5 mauede staff 170 Jan 19 05:42 mpi
-rw-r--r-- 1 mauede staff 7290 Jun 5 2009 namegraph.cpp
-rw-r--r-- 1 mauede staff 3627 Jun 5 2009 namegraph.h
-rw-r--r-- 1 mauede staff 818 Jun 5 2009 replace_code.sh
drwxr-xr-x 4 mauede staff 136 Jan 19 05:42 set
drwxr-xr-x 4 mauede staff 136 Jan 19 05:42 solve
-rw-r--r-- 1 mauede staff 2331 Jun 5 2009 vecmatc.cpp
-rw-r--r-- 1 mauede staff 3853 Jun 5 2009 vecmatc.h
-rw-r--r-- 1 mauede staff 11398 Jun 5 2009 vecmatconst.h
-rw-r--r-- 1 mauede staff 2178 Jun 5 2009 vecmatdiag.cpp
-rw-r--r-- 1 mauede staff 2763 Jun 5 2009 vecmatdiag.h
-rw-r--r-- 1 mauede staff 2977 Jun 5 2009 vecmatopts.cpp
-rw-r--r-- 1 mauede staff 2646 Jun 5 2009 vecmatopts.h
-rw-r--r-- 1 mauede staff 2154 Jun 5 2009 vecmatr.cpp
-rw-r--r-- 1 mauede staff 2657 Jun 5 2009 vecmatr.h
-rw-r--r-- 1 mauede staff 2260 Jun 5 2009 vecmatrei.cpp
-rw-r--r-- 1 mauede staff 2766 Jun 5 2009 vecmatrei.h
-rw-r--r-- 1 mauede staff 2639 Jun 5 2009 vecmats.cpp
-rw-r--r-- 1 mauede staff 2922 Jun 5 2009 vecmats.h
-rw-r--r-- 1 mauede staff 2192 Jun 5 2009 vecmatscalar.cpp
-rw-r--r-- 1 mauede staff 2877 Jun 5 2009 vecmatscalar.h
-rw-r--r-- 1 mauede staff 9598 Jun 5 2009 vecmatsparse.cpp
-rw-r--r-- 1 mauede staff 6487 Jun 5 2009 vecmatsparse.h
-rw-r--r-- 1 mauede staff 4337 Jun 5 2009 vecmatsym.cpp
-rw-r--r-- 1 mauede staff 3897 Jun 5 2009 vecmatsym.h
-rw-r--r-- 1 mauede staff 3300 Jun 5 2009 vecmatsymf.cpp
-rw-r--r-- 1 mauede staff 3406 Jun 5 2009 vecmatsymf.h
-rw-r--r-- 1 mauede staff 2213 Jun 5 2009 vecmattrans.cpp
-rw-r--r-- 1 mauede staff 3801 Jun 5 2009 vecmattrans.h
-rw-r--r-- 1 mauede staff 4296 Jun 5 2009 vm.h
-rw-r--r-- 1 mauede staff 22361 Jun 5 2009 vm_binary_expr.h
-rw-r--r-- 1 mauede staff 3181 Jun 5 2009 vm_cast.h
-rw-r--r-- 1 mauede staff 10386 Jun 5 2009 vm_cblas_op5.h
-rw-r--r-- 1 mauede staff 25690 Jun 5 2009 vm_cblas_wrapper.h
-rw-r--r-- 1 mauede staff 3476 Jun 5 2009 vm_concat.h
-rw-r--r-- 1 mauede staff 3481 Jun 5 2009 vm_concatr.h
-rw-r--r-- 1 mauede staff 18281 Jun 5 2009 vm_decompose.cpp
-rw-r--r-- 1 mauede staff 10826 Jun 5 2009 vm_decompose.h
-rw-r--r-- 1 mauede staff 2131 Jun 5 2009 vm_friends.h
-rw-r--r-- 1 mauede staff 43760 Jun 5 2009 vm_fun.cpp
-rw-r--r-- 1 mauede staff 12671 Jun 5 2009 vm_fun.h
-rw-r--r-- 1 mauede staff 1880 Jun 5 2009 vm_helper.h
-rw-r--r-- 1 mauede staff 2493 Jun 5 2009 vm_intel_vml.h
-rw-r--r-- 1 mauede staff 243112 Jun 5 2009 vm_lapack.h
-rw-r--r-- 1 mauede staff 11599 Jun 5 2009 vm_lapack_wrapper.h
-rw-r--r-- 1 mauede staff 14180 Jun 5 2009 vm_matrix_expr.h
-rw-r--r-- 1 mauede staff 7036 Jun 5 2009 vm_repmat.h
-rw-r--r-- 1 mauede staff 3505 Jun 5 2009 vm_reshape.h
-rw-r--r-- 1 mauede staff 5545 Jun 5 2009 vm_stat.cpp
-rw-r--r-- 1 mauede staff 3443 Jun 5 2009 vm_stat.h
-rw-r--r-- 1 mauede staff 52619 Jun 5 2009 vm_types.h
-rw-r--r-- 1 mauede staff 17258 Jun 5 2009 vm_unary_expr.h
drwxr-xr-x 9 mauede staff 306 Jan 19 05:42 wrappers
-rw-r--r-- 1 mauede staff 52161 Jun 5 2009 ya_doxygen.h
-rw-r--r-- 1 mauede staff 1147 Jun 5 2009 ya_set.h
In this case I replaced Xcode "main.cpp" with "get_AllVar_matrix.cc" and placed all drl functons (cpp) and incudes and template declarations in a new folder (Libraries) as you suggested. Now, "get_AllVar_matrix.cc" is in the Source folder of my project that I called DialanineDipeptide. Folder "drl" is inside folder Libraries which is inside folder Products.
Maybe this misplacement of the file causes at compile time a lot of errors as shown in the following ...
Line Location ya_binary.cpp:30: error: expected constructor, destructor, or type conversion before 'template'
Line Location ya_binary.cpp:43: error: expected declaration before '}' token
Line Location ya_fun.cpp:30: error: expected constructor, destructor, or type conversion before 'template'
Line Location ya_fun.cpp:60: error: expected initializer before 'copy'
Line Location ya_fun.cpp:60: error: expected nested-name-specifier before 'YA_COPY_TYPE'
Line Location ya_fun.cpp:65: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:65: error: 'YA_BaseT' was not declared in this scope
Line Location ya_fun.cpp:65: error: template declaration of 'int zero'
Line Location ya_fun.cpp:65: error: 'zero' declared as an 'inline' variable
Line Location ya_fun.cpp:65: error: variable or field 'zero' declared void
Line Location ya_fun.cpp:70: error: ISO C++ forbids declaration of 'YA_WrapperT' with no type
Line Location ya_fun.cpp:70: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:71: error: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
Line Location ya_fun.cpp:71: error: there are no arguments to 'ya_zero_matrix' that depend on a template parameter, so a declaration of 'ya_zero_matrix' must be available
Line Location ya_fun.cpp:71: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:75: error: expected primary-expression before 'const'
Line Location ya_fun.cpp:75: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:75: error: 'YA_BaseT' was not declared in this scope
Line Location ya_fun.cpp:75: error: template declaration of 'int setall'
Line Location ya_fun.cpp:75: error: 'setall' declared as an 'inline' variable
Line Location ya_fun.cpp:75: error: variable or field 'setall' declared void
Line Location ya_fun.cpp:80: error: ISO C++ forbids declaration of 'YA_WrapperT' with no type
Line Location ya_fun.cpp:80: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:81: error: there are no arguments to 'ya_copy_scalar' that depend on a template parameter, so a declaration of 'ya_copy_scalar' must be available
Line Location ya_fun.cpp:81: error: 'value' was not declared in this scope
Line Location ya_fun.cpp:81: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:85: error: ISO C++ forbids declaration of 'YA_BaseT' with no type
Line Location ya_fun.cpp:85: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:86: error: there are no arguments to 'ya_compare_matrix' that depend on a template parameter, so a declaration of 'ya_compare_matrix' must be available
Line Location ya_fun.cpp:86: error: 'two' was not declared in this scope
Line Location ya_fun.cpp:86: error: 'one' was not declared in this scope
Line Location ya_fun.cpp:90: error: 'two' was not declared in this scope
Line Location ya_fun.cpp:90: error: expected primary-expression before '&' token
Line Location ya_fun.cpp:90: error: 'one' was not declared in this scope
Line Location ya_fun.cpp:90: error: 'YA_BaseT' was not declared in this scope
Line Location ya_fun.cpp:90: error: template declaration of 'int ya_swap'
Line Location ya_fun.cpp:90: error: 'ya_swap' declared as an 'inline' variable
Line Location ya_fun.cpp:90: error: variable or field 'ya_swap' declared void
Line Location ya_fun.cpp:97: error: ISO C++ forbids declaration of 'YA_WrapperT' with no type
Line Location ya_fun.cpp:97: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:98: error: expected initializer before 'temp'
Line Location ya_fun.cpp:99: error: 'two' was not declared in this scope
Line Location ya_fun.cpp:99: error: 'one' was not declared in this scope
Line Location ya_fun.cpp:100: error: 'temp' was not declared in this scope
Line Location ya_fun.cpp:104: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:104: error: 'YA_BaseT' was not declared in this scope
Line Location ya_fun.cpp:104: error: template declaration of 'int ip_flipcm'
Line Location ya_fun.cpp:104: error: 'ip_flipcm' declared as an 'inline' variable
Line Location ya_fun.cpp:104: error: variable or field 'ip_flipcm' declared void
Line Location ya_fun.cpp:115: error: ISO C++ forbids declaration of 'YA_WrapperT' with no type
Line Location ya_fun.cpp:115: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:116: error: expected `;' before 'diff'
Line Location ya_fun.cpp:116: error: 'ya_sizet' was not declared in this scope
Line Location ya_fun.cpp:117: error: expected `;' before 'i'
Line Location ya_fun.cpp:118: error: 'i' was not declared in this scope
Line Location ya_fun.cpp:118: error: 'diff' was not declared in this scope
Line Location ya_fun.cpp:119: error: there are no arguments to 'mat' that depend on a template parameter, so a declaration of 'mat' must be available
Line Location ya_fun.cpp:119: error: there are no arguments to 'mat' that depend on a template parameter, so a declaration of 'mat' must be available
Line Location ya_fun.cpp:119: error: there are no arguments to 'mat' that depend on a template parameter, so a declaration of 'mat' must be available
Line Location ya_fun.cpp:119: error: there are no arguments to 'mat' that depend on a template parameter, so a declaration of 'mat' must be available
Line Location ya_fun.cpp:126: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:126: error: 'YA_BaseT' was not declared in this scope
Line Location ya_fun.cpp:126: error: template declaration of 'int ip_fliplr'
Line Location ya_fun.cpp:126: error: 'ip_fliplr' declared as an 'inline' variable
Line Location ya_fun.cpp:126: error: variable or field 'ip_fliplr' declared void
Line Location ya_fun.cpp:137: error: ISO C++ forbids declaration of 'YA_WrapperT' with no type
Line Location ya_fun.cpp:137: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:138: error: expected `;' before 'diff'
Line Location ya_fun.cpp:138: error: 'ya_sizet' was not declared in this scope
Line Location ya_fun.cpp:139: error: expected `;' before 'i'
Line Location ya_fun.cpp:140: error: 'i' was not declared in this scope
Line Location ya_fun.cpp:140: error: 'diff' was not declared in this scope
Line Location ya_fun.cpp:141: error: there are no arguments to 'mat' that depend on a template parameter, so a declaration of 'mat' must be available
Line Location ya_fun.cpp:141: error: there are no arguments to 'mat' that depend on a template parameter, so a declaration of 'mat' must be available
Line Location ya_fun.cpp:148: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:148: error: 'YA_BaseT' was not declared in this scope
Line Location ya_fun.cpp:148: error: template declaration of 'int ip_transpose'
Line Location ya_fun.cpp:148: error: 'ip_transpose' declared as an 'inline' variable
Line Location ya_fun.cpp:148: error: variable or field 'ip_transpose' declared void
Line Location ya_fun.cpp:162: error: ISO C++ forbids declaration of 'YA_WrapperT' with no type
Line Location ya_fun.cpp:162: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:163: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:164: error: expected `;' before 'R'
Line Location ya_fun.cpp:164: error: 'ya_sizet' was not declared in this scope
Line Location ya_fun.cpp:165: error: 'R' was not declared in this scope
Line Location ya_fun.cpp:172: error: there are no arguments to 'copy' that depend on a template parameter, so a declaration of 'copy' must be available
Line Location ya_fun.cpp:178: error: ISO C++ forbids declaration of 'YA_BaseT' with no type
Line Location ya_fun.cpp:178: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:179: error: there are no arguments to 'square' that depend on a template parameter, so a declaration of 'square' must be available
Line Location ya_fun.cpp:179: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:183: error: ISO C++ forbids declaration of 'YA_BaseT' with no type
Line Location ya_fun.cpp:183: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:184: error: there are no arguments to 'YA_DEBUG_ERROR' that depend on a template parameter, so a declaration of 'YA_DEBUG_ERROR' must be available
Line Location ya_fun.cpp:184: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:186: error: expected `(' before ',' token
Line Location ya_fun.cpp:186: error: '_ya_ufor_total' was not declared in this scope
Line Location ya_fun.cpp:186: error: 'ya_no_order_loop' was not declared in this scope
Line Location ya_fun.cpp:187: error: '::lp' has not been declared
Line Location ya_fun.cpp:187: error: expected primary-expression before '>' token
Line Location ya_fun.cpp:187: error: expected primary-expression before '>' token
Line Location ya_fun.cpp:192: error: ISO C++ forbids declaration of 'YA_BaseT' with no type
Line Location ya_fun.cpp:192: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:193: error: there are no arguments to 'YA_DEBUG_ERROR' that depend on a template parameter, so a declaration of 'YA_DEBUG_ERROR' must be available
Line Location ya_fun.cpp:193: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:195: error: 'ya_no_order_loop' was not declared in this scope
Line Location ya_fun.cpp:196: error: '::lp' has not been declared
Line Location ya_fun.cpp:196: error: expected primary-expression before '>' token
Line Location ya_fun.cpp:201: error: ISO C++ forbids declaration of 'YA_BaseT' with no type
Line Location ya_fun.cpp:201: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:202: error: there are no arguments to 'YA_DEBUG_ERROR' that depend on a template parameter, so a declaration of 'YA_DEBUG_ERROR' must be available
Line Location ya_fun.cpp:202: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:204: error: 'ya_no_order_loop' was not declared in this scope
Line Location ya_fun.cpp:205: error: '::lp' has not been declared
Line Location ya_fun.cpp:205: error: expected primary-expression before '>' token
Line Location ya_fun.cpp:210: error: ISO C++ forbids declaration of 'YA_BaseT' with no type
Line Location ya_fun.cpp:210: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:211: error: there are no arguments to 'YA_DEBUG_ERROR' that depend on a template parameter, so a declaration of 'YA_DEBUG_ERROR' must be available
Line Location ya_fun.cpp:211: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:213: error: 'ya_no_order_loop' was not declared in this scope
Line Location ya_fun.cpp:214: error: '::lp' has not been declared
Line Location ya_fun.cpp:214: error: expected primary-expression before '>' token
Line Location ya_fun.cpp:220: 'template void vstat(int)' previously declared here
Line Location ya_fun.cpp:220: 'template void vstat(int)' previously declared here
Line Location ya_fun.cpp:220: 'template void vstat(int)' previously declared here
Line Location ya_fun.cpp:220: error: ISO C++ forbids declaration of 'YA_BaseT' with no type
Line Location ya_fun.cpp:220: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:221: error: there are no arguments to 'YA_DEBUG_ERROR' that depend on a template parameter, so a declaration of 'YA_DEBUG_ERROR' must be available
Line Location ya_fun.cpp:221: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:226: error: 'ya_no_order_loop' was not declared in this scope
Line Location ya_fun.cpp:227: error: '::lp' has not been declared
Line Location ya_fun.cpp:227: error: expected primary-expression before '>' token
Line Location ya_fun.cpp:228: error: 'vmin' was not declared in this scope
Line Location ya_fun.cpp:229: error: 'vmax' was not declared in this scope
Line Location ya_fun.cpp:230: error: 'vmean' was not declared in this scope
Line Location ya_fun.cpp:235: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:236: 'template void vstat(int)' previously declared here
Line Location ya_fun.cpp:236: 'template void vstat(int)' previously declared here
Line Location ya_fun.cpp:236: error: redefinition of 'template void vstat(int)'
Line Location ya_fun.cpp:236: error: ISO C++ forbids declaration of 'YA_BaseT' with no type
Line Location ya_fun.cpp:237: error: there are no arguments to 'YA_DEBUG_ERROR' that depend on a template parameter, so a declaration of 'YA_DEBUG_ERROR' must be available
Line Location ya_fun.cpp:237: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:242: error: 'ya_no_order_loop' was not declared in this scope
Line Location ya_fun.cpp:243: error: '::lp' has not been declared
Line Location ya_fun.cpp:243: error: expected primary-expression before '>' token
Line Location ya_fun.cpp:247: error: '::lp' has not been declared
Line Location ya_fun.cpp:247: error: expected primary-expression before '>' token
Line Location ya_fun.cpp:248: error: 'vmin' was not declared in this scope
Line Location ya_fun.cpp:249: error: 'vmax' was not declared in this scope
Line Location ya_fun.cpp:250: error: 'vmean' was not declared in this scope
Line Location ya_fun.cpp:251: error: 'vstd' was not declared in this scope
Line Location ya_fun.cpp:256: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:257: 'template void vstat(int)' previously declared here
Line Location ya_fun.cpp:257: error: redefinition of 'template void vstat(int)'
Line Location ya_fun.cpp:257: error: redefinition of 'template void vstat(int)'
Line Location ya_fun.cpp:257: error: ISO C++ forbids declaration of 'YA_BaseT' with no type
Line Location ya_fun.cpp:258: error: there are no arguments to 'YA_DEBUG_ERROR' that depend on a template parameter, so a declaration of 'YA_DEBUG_ERROR' must be available
Line Location ya_fun.cpp:258: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:261: error: expected `;' before 'C'
Line Location ya_fun.cpp:261: error: 'ya_sizet' was not declared in this scope
Line Location ya_fun.cpp:262: error: expected `;' before 'R'
Line Location ya_fun.cpp:263: error: 'C' was not declared in this scope
Line Location ya_fun.cpp:263: error: 'vmin' was not declared in this scope
Line Location ya_fun.cpp:264: error: 'vmax' was not declared in this scope
Line Location ya_fun.cpp:265: error: 'vmean' was not declared in this scope
Line Location ya_fun.cpp:267: error: 'i' was not declared in this scope
Line Location ya_fun.cpp:267: error: expected `;' before 'i'
Line Location ya_fun.cpp:271: error: 'ya_no_order_loop' was not declared in this scope
Line Location ya_fun.cpp:272: error: '::lp' has not been declared
Line Location ya_fun.cpp:272: error: expected primary-expression before '>' token
Line Location ya_fun.cpp:275: error: 'R' was not declared in this scope
Line Location ya_fun.cpp:281: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:282: error: redefinition of 'template void vstat(int)'
Line Location ya_fun.cpp:282: error: redefinition of 'template void vstat(int)'
Line Location ya_fun.cpp:282: error: redefinition of 'template void vstat(int)'
Line Location ya_fun.cpp:282: error: ISO C++ forbids declaration of 'YA_BaseT' with no type
Line Location ya_fun.cpp:283: error: there are no arguments to 'YA_DEBUG_ERROR' that depend on a template parameter, so a declaration of 'YA_DEBUG_ERROR' must be available
Line Location ya_fun.cpp:283: error: 'mat' was not declared in this scope
Line Location ya_fun.cpp:286: error: expected `;' before 'C'
Line Location ya_fun.cpp:286: error: 'ya_sizet' was not declared in this scope
Line Location ya_fun.cpp:287: error: expected `;' before 'R'
Line Location ya_fun.cpp:288: error: 'C' was not declared in this scope
Line Location ya_fun.cpp:288: error: 'vmin' was not declared in this scope
Line Location ya_fun.cpp:289: error: 'vmax' was not declared in this scope
Line Location ya_fun.cpp:290: error: 'vmean' was not declared in this scope
Line Location ya_fun.cpp:291: error: 'vstd' was not declared in this scope
Line Location ya_fun.cpp:293: error: 'i' was not declared in this scope
Line Location ya_fun.cpp:293: error: expected `;' before 'i'
Line Location ya_fun.cpp:297: error: 'ya_no_order_loop' was not declared in this scope
Line Location ya_fun.cpp:298: error: '::lp' has not been declared
Line Location ya_fun.cpp:298: error: expected primary-expression before '>' token
Line Location ya_fun.cpp:299: error: 'R' was not declared in this scope
Line Location ya_fun.cpp:302: error: '::lp' has not been declared
Line Location ya_fun.cpp:302: error: expected primary-expression before '>' token
Line Location ya_fun.cpp:322: error: ISO C++ forbids declaration of 'YA_BaseT' with no type
Line Location ya_fun.cpp:322: error: expected ',' or '...' before '&' token
Line Location ya_fun.cpp:323: error: there are no arguments to 'square' that depend on a template parameter, so a declaration of 'square' must be available
Line Location ya_fun.cpp:323: error: 'two' was not declared in this scope
Line Location ya_fun.cpp:323: error: 'one' was not declared in this scope
Line Location ya_fun.cpp:328: error: expected constructor, destructor, or type conversion before 'find'
Line Location ya_fun.cpp:335: error: expected declaration before '}' token
Add library, not source code.
hi-
I meant: compile "drl" and then add the resulting library (so or ar?) to your project for linking.
Maybe drl picks up on the current directory for your process, you can look at the source code to determine that. If so, then you can stick all of the drl resource files into a directory (like /usr/drl/* ) and then in your own app change the working directory to that directory so your app can pick up the external resource files.
This is beyond simple Xcode questions and into programming. There are lots of design issues and it is very hard to describe the correct choices on a forum.
thanks!-
-lance
Add library, not source code.
Actually the name "library" is confusing as it leads you to think of the typical library format (.so, .ar).
I do not know the reason why Dr.L authors call it "library". Actually it is a collection of C++ source files (.cpp), include files (.h), organized in C++ classes and templates and members.
Dr.L documentation is available on-line at
http://www.cs.sandia.gov/~wmbrown/drl/index.htm.
From this web site all the files I have mentioned (.cpp, .h, and so on) can be downloaded for free (as a compressed .tar.gz archive) from any academic institute just clicking on the Download item from the left hand side list.
All the functions and includes etc ... can be called from any other source program as they are. That is, without pre-compilation.
If you open the web site above mentioned, click on the item API, and scroll down the text window you'll find the guidelines to embed such functions in a program.
The first thing to do is to add the following to the program source code which uses it:
#include "dimred/ya_dimred.h"
using namespace yala;
Basically the whole program is made up of my main "get_AllVar_matrix.cc" plus the DrL ".cpp" functions I call and their respective include files. There are no .so or .ar files. Everything is to be compiled and linked at the same time.
It's like a big program made up of a number of source files and includes files.
Having claryfied this misunderstanding, how can I add all such files to a project with the goal of getting one only executable that can be run from command line and accepts some input parameters ?
Thank you so much,
Maura