I spent all day battling this issue so I might as well share some of the findings and hope for some feedback on how to do this more efficiently.
First, I updated to the AR software to ARPro 4.5.4 and ARNFT 3.50.0 (with OpenCV2.2)
Ran the VBScript; Saved a copy of bin and example folders.
(the installed simpleLite.exe worked. Simple.exe file did not, out of the box...?? The previoous version's had)
That aside, my goal was simply to be able to compile the most basic example in the AR-Pro suite - simpleLite.c.
In VC++ 2010, I created a "New -> Project from existing code" project and used the .c file from examples-SimpleLite,
which created project files and a Debug folder under examples-SimpleLite.
First Build: Couldn't find (glut.h, config.h)
Added these paths to the Property -> VC++ Directories -> Include and Library Directories:
Under Include:
C:\Program Files\ARToolKit4\include\
C:\Program Files\ARToolKit4\include\win32-i386
C:\Program Files\ARToolKit4\include\AR
C:\OpenCV2.2\include;
C:\OpenCV2.2\include\opencv2;
C:\OpenCV2.2\include\opencv;
Under Libraries:
C:\OpenCV2.2\lib;
C:\Program Files\ARToolKit4\lib;
C:\Program Files\ARToolKit4\lib\win32-i386;
C:\Program Files\ARToolKit4\lib\SRC;
Next Build:
I got 44 LNK2019 errors.
e.g., "error LNK2019: unresolved external symbol _arUtilTimerReset referenced in function _main"
I added these .lib files to the Properties - Linker - Input - Additional Dependencies folder.
opencv_core220d.lib
opencv_highgui220d.lib
opencv_video220d.lib
opencv_ml220d.lib
opencv_legacy220d.lib
opencv_imgproc220d.lib
AR.lib
ARvideo.lib
ARgsub_lite.lib
ARICP.lib
ARMulti.lib
glut32.lib
I probably didn't need the last two.
Note the connection between the header files in the .c file and the files above:
#include <AR/config.h>
#include <AR/video.h>
#include <AR/param.h>
#include <AR/ar.h>
#include <AR/gsub_lite.h>
Next Build:
Error: "warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs..."
.: Go to your project properties->C/C++->Code Generation->Runtime Library and change it to Multi-threaded DLL.
Next Build:
Error:
"MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup"
.: Go to Properties-> Linker-> System-> SubSystem.
Change the "subsystem" in your linker settings from "Windows" to "Console".
Next Build:
Compiles now. .exe starts but fails.
"ARvideo.dll can't be found."
.: Had to copy all DLLs from \bin to my project's Debug folder.
Next Build:
Got many "Cannot find or open the PDB file" errors.
.: Under Tools-> Options-> Debugging-> Symbols, Checkmark the Microsoft Symbol Servers.
It slows things down, though.
Ran Debug:
in DOS window, "Error (2): unable to open camera parameters file "Data/camera_para.dat" for reading."
.: Copy the whole bin\Data folder to the "simpleLite" folder.
And... It finally ran and I got to see my fancy, multicolored cube!
Something else that could help if problems continue:
Increase the information in the Build output:
"Tools - Options - Projects and Solutions - Build and Run - MS..build output verbosity"
to something higher than Minimal.
I am pretty sure that I am doing something wrong if I have to go through these many steps.
Please feel free to point out everything I could be doing differently!
Thank you,
AG