Overview
Features
Download
Documentation
Community
Add-Ons & Services

[newbie] Some problems with my first application using POCO

Please post support and help requests here.

[newbie] Some problems with my first application using POCO

Postby petrux » 10 Sep 2007, 13:55

Hi there,

I'm almost a newbie and I'm getting into some troubles (just like this guy). I've built the POCO library under winXP using VisualStudio 2008 and I'm trying to create a test application (using Vim+gcc on cygwin). My (stupid) application code is:

# include
# include

using Poco::DateTime;
using namespace std;

int main(int argc, char** argv)
{
DateTime t = DateTime::DateTime();
cout << "Ciao!
";
return 0;
}

Which command should I type to build this application? Which library shoud I link? The /lib/* ones or the /bin/*.dll ones?

Thanks in advance,
petrux - a future POCO enthusiastic user (let's hope! ;-) )


petrux
 
Posts: 17
Joined: 07 Sep 2007, 15:30

Re: [newbie] Some problems with my first application using POCO

Postby alex » 10 Sep 2007, 14:30

http://www.appinf.com/poco/wiki/tiki-index.php?page=First+Steps
alex
 
Posts: 1086
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: [newbie] Some problems with my first application using POCO

Postby petrux » 10 Sep 2007, 18:17

alex,

thank you for your reply. I've already read the tutorial but it's absolutely "VisualStudio oriented", while I'm using Vim+g++(under cygwin). Anyway, let me ask you some questions about the issue you suggested me...

I copied and pasted the example onto a testpoco.cpp file. This is the command I used to compile:

>> g++ testpoco.cpp -o testpoco.exe -I D:MyPathToPOCOFoundationinclude

and that's what I had:

/cygdrive/c/DOCUME~1/Giulio/IMPOST~1/Temp/ccTpFk86.o:testpoco.cpp:(.text+0x170):undefined reference oPoco::DateTime::DateTime()'
/cygdrive/c/DOCUME~1/Giulio/IMPOST~1/Temp/ccTpFk86.o:testpoco.cpp:(.text+0x182):undefined reference to `Poco::DateTime::julianDay() const' cygdrive/c/DOCUME~1/Giulio/IMPOST~1/Temp/ccTpFk86.o:testpoco.cpp:(.text+0x1b3):undefined reference to `Poco::DateTime::dayOfYear() const' /cygdrive/c/DOCUME~1/Giulio/IMPOST~1/Temp/ccTpFk86.o:testpoco.cpp:(.text+0x1e1):undefined reference to `Poco::DateTimeFormat::MONTH_NAMES'
/cygdrive/c/DOCUME~1/Giulio/IMPOST~1/Temp/ccTpFk86.o:testpoco.cpp:(.text+0x1f7):undefined reference to `Poco::DateTime::dayOfWeek() const'
/cygdrive/c/DOCUME~1/Giulio/IMPOST~1/Temp/ccTpFk86.o:testpoco.cpp:(.text+0x1ff):undefined reference to `Poco::DateTimeFormat::WEEKDAY_NAMES
'
/cygdrive/c/DOCUME~1/Giulio/IMPOST~1/Temp/ccTpFk86.o:testpoco.cpp:(.text+0x311):undefined reference to `Poco::DateTime::~DateTime()'
/cygdrive/c/DOCUME~1/Giulio/IMPOST~1/Temp/ccTpFk86.o:testpoco.cpp:(.text+0x344):undefined reference to `Poco::DateTime::~DateTime()'
collect2: ld returned 1 exit status

Should I explicitly link aything? I tried with "-l D:MyPathToPOCOlibPocoFoundationd" but I got the same errors

Thanks in advance,
petrux

p.s. is there any bug in the post renderization engine or my browser got crazy?
--
petrux
 
Posts: 17
Joined: 07 Sep 2007, 15:30

Re: Re: [newbie] Some problems with my first application using POCO

Postby alex » 10 Sep 2007, 18:52

> thank you for your reply. I've already read the tutorial but it's absolutely "VisualStudio oriented", while I'm using Vim+g++(under cygwin).

I recommend you use Poco build framework. Besides Windows, there is Linux/Solaris guide which should work w/ Cygwin:

http://www.appinf.com/poco/wiki/tiki-index.php?page=FirstStepsLinux

> Should I explicitly link aything?

Yes, you hould link libPocoFoundation.so - that is where DateTime resides.

> I tried with "-l D:MyPathToPOCOlibPocoFoundationd" but I got the same errors

On POSIX platforms, the libraries can be found in $POCO_BASE/lib/$OSNAME/$OSARCH/

I have no experience w/ Cygwin, so I can't give you the exact path.

> p.s. is there any bug in the post renderization engine or my browser got crazy?

It's not bug, it's a feature. Two ::'s mean centered text. See http://doc.tikiwiki.org/tiki-index.php?page_ref_id=268#_Quick_Reference_Basic_Text_Formatting for reference.

Alex
alex
 
Posts: 1086
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron