1. I am using VS 8
2. The program I use is
#include <LEDA/system/basic.h>
#include <LEDA/numbers/integer.h>
#include <iostream>
using namespace std;
using namespace leda;
main() {cout << "factorial of 6 is: " << factorial( 6 ) << endl; return 0;}
3.When I try and build I get
1>------ Build started: Project: ThirdLedaFactorial, Configuration: Debug Win32 ------
1>Compiling...
1>Third.cpp
1>f:\mywork\visual studio 2008\projects\thirdledafactorial\thirdledafactorial\third.cpp(7) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>Build log was saved at "file://f:\MyWork\Visual Studio 2008\Projects\ThirdLedaFactorial\ThirdLedaFactorial\Debug\BuildLog.htm"
1>ThirdLedaFactorial - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
4. When I change the return type of main to int or integer I get a mistake
5.What am I doing wrong?
Everything is compiling fine when you have int main. The problems you're having are Linker errors are are related to this LEDA lib you're using.
You're #including the LEDA headers which is good, but you're not linking to the LEDA library, which is why you're getting the above "unresolved external symbol" error.
Now I'm not familiar with this library so I can't tell you exactly how to link to it, but there's typically a .lib file that comes with it. You would add this to the linked-to libs in your project settings.
Once you link to it properly, these errors will go away.