|
|
|
|
|
|
|
|
|
Re: Undefined reference to problem [message #787956 is a reply to message #730786] |
Wed, 01 February 2012 07:03 |
Faez Shingeri Messages: 2 Registered: January 2012 |
Junior Member |
|
|
I am using eclipse IDE with MinGw installed. I copied all the libxl C libraries into the C:\MinGw\include but when I try to compile the program, I get the below errors :
D:\Faez\Software & Download\ExcelFilePgm\Debug/../MyFirstExcelFile.c:14: undefined reference to `xlCreateBookCA'
D:\Faez\Software & Download\ExcelFilePgm\Debug/../MyFirstExcelFile.c:17: undefined reference to `xlBookAddSheetA'
D:\Faez\Software & Download\ExcelFilePgm\Debug/../MyFirstExcelFile.c:20: undefined reference to `xlSheetWriteStrA'
D:\Faez\Software & Download\ExcelFilePgm\Debug/../MyFirstExcelFile.c:21: undefined reference to `xlSheetWriteNumA'
D:\Faez\Software & Download\ExcelFilePgm\Debug/../MyFirstExcelFile.c:23: undefined reference to `xlBookSaveA'
D:\Faez\Software & Download\ExcelFilePgm\Debug/../MyFirstExcelFile.c:24: undefined reference to `xlBookReleaseA'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 515 ms.
Here is the program I am trying to compile:
#include <stdio.h>
#include <libxl.h>
int main()
{
BookHandle book = xlCreateBook(); // xlCreateXMLBook()
if(book)
{
SheetHandle sheet = xlBookAddSheet(book, L"Sheet1", 0);
if(sheet)
{
xlSheetWriteStr(sheet, 2, 1, L"Hello, World !", NULL);
xlSheetWriteNum(sheet, 3, 1, 1000, NULL);
}
xlBookSave(book, L"example.xls");
xlBookRelease(book);
}
return 0;
}
Thanks,
Faez
|
|
|
Powered by
FUDForum. Page generated in 0.05244 seconds