Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ VC++
I am using GDAL libraries to read tif image.. but i gor lot of errors while i build it. here is my source code :
------------------------------------------------------------------------------------------
include"gdal.h"
include"gdal_priv.h"
include"cpl_conv.h"
using namespace std;
int main()
{
    GDALDataset  *poDataset;
    const char *pszFilename = "F:\VCPP\GAILGRA1.tif";
    GDALAllRegister();
    poDataset = (GDALDataset *) GDALOpen( pszFilename, GA_ReadOnly );
    if( poDataset == NULL )
    {
        cout << "wrong file ";
    }
	return 0;
}
.............................................................................
i am using visual studio 2010 and created new project console application
 
OP's additional information moved from non-solution below
Error   1974    error LNK2019: unresolved external symbol _png_write_rows referenced in function "public: static class GDALDataset * __cdecl PNGDataset::CreateCopy(char const *,class GDALDataset *,int,char * *,int (__stdcall*)(double,char const *,void *),void *)" (?CreateCopy@PNGDataset@@SAPAVGDALDataset@@PBDPAV2@HPAPADP6GHN0PAX@Z3@Z)    C:\Users\ACER\Desktop\gdal-1.9.1\VisualStudio9\gdal\pngdataset.obj  gdal
-----------------------------------------------------------------------------
there are so many errors like this.... please help me out....
Posted 14-Dec-12 0:02am
Edited 15-Dec-12 2:36am
47.1K
v3
Comments
Jochen Arndt at 14-Dec-12 6:15am
   
The error messages usually contain useful information about what went wrong including the file and line number where the errors occured. So you should provide this information here (use the green Improve question link to add this information; if there are too many start with the first ones).
 
Without the messages, nobody here can help you.
Richard MacCutchan at 14-Dec-12 8:45am
   
Your string pszFilename is in error. The backslash character \ is used to escape the following character in the string so your path is now invalid; it should be "F:\\VCPP\\GAILGRA1.tif". As to the rest, you will have to show us the error messages and which line they are on.
Hardik Acharya at 15-Dec-12 8:29am
   
Error 1974 error LNK2019: unresolved external symbol _png_write_rows referenced in function "public: static class GDALDataset * __cdecl PNGDataset::CreateCopy(char const *,class GDALDataset *,int,char * *,int (__stdcall*)(double,char const *,void *),void *)" (?CreateCopy@PNGDataset@@SAPAVGDALDataset@@PBDPAV2@HPAPADP6GHN0PAX@Z3@Z) C:\Users\ACER\Desktop\gdal-1.9.1\VisualStudio9\gdal\pngdataset.obj gdal
----------------------------------------------------------------------------
there are so many errors like this... please help me out......
Mahdi Nejadsahebi at 24-Dec-12 8:07am
   
hi dear friend
 
if you want to use CImage, this is :
 
<pre>
CImage i;
i.Load(_T("1.tiff"));
</pre>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 15 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid