"hello World Example" for C++

schueffp at mskcc.org schueffp at mskcc.org
Mon May 23 16:44:36 EDT 2016


Dear OpenSlide People,

for Java and Python, there are hello world examples how to use openSlide.

But for C++, I had a hard time to find such a script, which e.g. creates a openSlide object, reads a .SVS file and outputs the SVS info in the console.

Is there anybody who has that and likes to share?

I tried following code, but it constantly gives errors:


#include "stdafx.h"
#include <iostream>
#include <sys/stat.h>
#include <string>
#include "../../../../../Downloads/openslide-win64-20150527/openslide-win64-20150527/include/openslide/openslide.h"
#include <stdio.h>

using namespace std;


int main()
{
const char *filename = "CMU-1.svs“; // file exists
openslide_t* osr = openslide_open(filename);



openslide_close(osr);

return 0;
}


The error is:

1>ConsoleApplication1.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__imp_openslide_open" in Funktion "main".
1>ConsoleApplication1.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__imp_openslide_close" in Funktion "main“.

It translates to
error LNK2019: Reference to unresolved external symbol … in function main.

I think I have to include some dll, but I dont have a clue which and how. I am using Visual Studio 2015 and the latest openSlide ( openslide-win64-20150527 ). Or shoud I use the openslide-3.4.1 download?

Thank you very much!!

Best,
 Peter

=====================================================================

     Please note that this e-mail and any files transmitted from
     Memorial Sloan Kettering Cancer Center may be privileged, confidential,
     and protected from disclosure under applicable law. If the reader of
     this message is not the intended recipient, or an employee or agent
     responsible for delivering this message to the intended recipient,
     you are hereby notified that any reading, dissemination, distribution,
     copying, or other use of this communication or any of its attachments
     is strictly prohibited.  If you have received this communication in
     error, please notify the sender immediately by replying to this message
     and deleting this message, any attachments, and all copies and backups
     from your computer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20160523/4a3454be/attachment.html>


More information about the openslide-users mailing list