Click here to Skip to main content
15,891,925 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using GDAL libraries to read tif image.. but i gor lot of errors while i build it. here is my source code :
------------------------------------------------------------------------------------------
C++
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
VB
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
Updated 15-Dec-12 2:36am
v3
Comments
Jochen Arndt 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 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 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......
[no name] 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900