logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
NWNX4 source code compilation issues
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sat Nov 25, 2006 13:56    Post subject: NWNX4 source code compilation issues Reply with quote

Please ask your questions and post your solutions concerning the NWNX4 source code in this thread.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sun Nov 26, 2006 0:04    Post subject: Reply with quote

Got Tortoise SVN, downloaded the source set.
When compiling the Linking step fails... (see below)

My guess is my wxWidgets configuration/installation is messed up. Confused
I'll try again, any suggestions?

**NWNX4 GUI project seems to be missing(?)

Cheers
Gryphyn

Code:
Linking...
wxbase26d.lib(log.obj) : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function "void __cdecl wxSafeShowMessage(class wxString const &,class wxString const &)" (?wxSafeShowMessage@@YAXABVwxString@@0@Z)
wxbase26d.lib(appbase.obj) : error LNK2001: unresolved external symbol __imp__MessageBoxA@16

...<snip>...

wxbase26d.lib(crashrpt.obj) : error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function "public: __thiscall BusyCursor::BusyCursor(void)" (??0BusyCursor@@QAE@XZ)
D:\NWNX4\src\..\bin\Debug\NWNX4_Hookd.dll : fatal error LNK1120: 49 unresolved externals
 
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sun Nov 26, 2006 11:43    Post subject: Reply with quote

Do you have the Platform SDK set up and configured as described on the VS Express page (assuming that you are using Express) ?

MessageBoxA for example is a Win32 function.

The GUI project is missing, because it is not ready yet.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
kungfoowiz



Joined: 12 Oct 2006
Posts: 61

PostPosted: Mon Nov 27, 2006 16:05    Post subject: Reply with quote

Your compilation may fail if you haven't disabled the Post-Build Event. To do this:

Right-click on each project, select Properties, select Configuration Properties, select Build Events, select Post-Build Event, and toggle Excluded From Build to yes.

---
kung
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Tue Nov 28, 2006 22:40    Post subject: Reply with quote

kungfoowiz wrote:
Your compilation may fail if you haven't disabled the Post-Build Event. To do this:

Right-click on each project, select Properties, select Configuration Properties, select Build Events, select Post-Build Event, and toggle Excluded From Build to yes.

---
kung

No, I want the Post-Build Event, this copies the files to the 'dist' (distribution?) folder. This bit's working fine.

I've reinstalled C++Express, wxWidgets and vsSDK. Still the same issue.
Standard Windows calls (to libraries) are failing when called via wxWidgets libraries. I'm pretty sure this is a problem with my wxWidgets setup - was there anything special you tweaked when setting this up?

I've tried C++Express & Full VStudio2005 - both with the same results.

Cheers
Gryphyn
Back to top
View user's profile Send private message
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Tue Nov 28, 2006 22:45    Post subject: Reply with quote

If this is still happening in a few hours, I can take a look -- but this sounds really familiar from another project I've worked on. Is there an option to enable/disable 'use default libraries' at the project level?
_________________
Khalidine, a NWN2 persistent world

Looking for volunteers.
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Tue Nov 28, 2006 22:46    Post subject: Reply with quote

Hmm, since you mentioned wxWidgets: Did you compile the libs yourself ?

Because if you downloaded the libs\ directory from the repository, you already have what you need, and can skip the wxWidgets part.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Wed Nov 29, 2006 1:38    Post subject: Reply with quote

Papillon wrote:
Hmm, since you mentioned wxWidgets: Did you compile the libs yourself ?

Because if you downloaded the libs\ directory from the repository, you already have what you need, and can skip the wxWidgets part.

Tried Both...
I had assumed you had all that was needed in the 'source' already.
That didn't work...

OK. Got it... at least something I can live with...for the moment...
Drive dependancy. Mad

Normally I have my work on my 'development' drive "D:\..."
--Installed everything on my 'test' machine to the "C:\" drive (and no problems)
Nothing I can see uses absolute file paths, but there must be something buried in wxWidgets somewhere.

So... here's a tip.
Export the source to a folder on your "C:\" drive - to avoid problems.

Cheers
Gryphyn
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Wed Nov 29, 2006 16:27    Post subject: Reply with quote

I have everything on my D: drive...
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Wed Nov 29, 2006 22:32    Post subject: Reply with quote

Papillon wrote:
I have everything on my D: drive...

That's strange indeed then...
--I'll investigate further... but I've got something that does work Very Happy
so I'm happy with that for the moment.

Cheers
Gryphyn
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Sat Dec 09, 2006 22:45    Post subject: Reply with quote

Gryphyn wrote:
Got Tortoise SVN, downloaded the source set.
When compiling the Linking step fails... (see below)

My guess is my wxWidgets configuration/installation is messed up. Confused
I'll try again, any suggestions?

**NWNX4 GUI project seems to be missing(?)

Cheers
Gryphyn

Code:
Linking...
wxbase26d.lib(log.obj) : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function "void __cdecl wxSafeShowMessage(class wxString const &,class wxString const &)" (?wxSafeShowMessage@@YAXABVwxString@@0@Z)
wxbase26d.lib(appbase.obj) : error LNK2001: unresolved external symbol __imp__MessageBoxA@16

...<snip>...

wxbase26d.lib(crashrpt.obj) : error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function "public: __thiscall BusyCursor::BusyCursor(void)" (??0BusyCursor@@QAE@XZ)
D:\NWNX4\src\..\bin\Debug\NWNX4_Hookd.dll : fatal error LNK1120: 49 unresolved externals
 
I have the same problem.
kernel32.lib is in place.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sun Dec 10, 2006 11:50    Post subject: Reply with quote

What steps did you take in order to solve the compilation problem ? I don't even know what platform you are using... a little more info would be helpful.

Also, there is a guide on making wxWidgets work with Visual Studio: http://www.wxwidgets.org/wiki/index.php/MSVC_.NET_Setup_Guide
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Sun Dec 10, 2006 17:57    Post subject: Reply with quote

I just used the wrong installation of VC. Smile
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sun Jan 14, 2007 9:15    Post subject: Trying to return a value... and the data encoding changes Reply with quote

I'm writing a pluging based on sqlite3.


Code:

const char* PWData::DoRequest(char *gameObject, char* request, char* value)
{
   wxLogTrace(TRACE_VERBOSE, wxT("* Plugin DoRequest(0x%x, %s, %s)"), gameObject, request, value);

<snip>

            wxLogTrace(TRACE_VERBOSE, wxT("* Value found"));
            size_t bytes = (size_t) sqlite3_column_bytes(sqlStatement, 0);

            wxLogTrace(TRACE_VERBOSE, wxT("* "));
            wxLogTrace(TRACE_VERBOSE, wxT("* Value Length = %d"), strlen(value));
            wxLogTrace(TRACE_VERBOSE, wxT("* Value Size = %d"), sizeof(value));
            wxLogTrace(TRACE_VERBOSE, wxT("* Value Data = %s"), value);
            wxLogTrace(TRACE_VERBOSE, wxT("* Result Length = %d"), bytes);

            const char* pCol = (const char*)sqlite3_column_text(sqlStatement, 0);
            if (pCol)
            {
               nwnxcpy(value, pCol);
               //nwnxcpy(value, pCol, bytes);
            }
            else
            {
               nwnxcpy(value, wxT(""));
            }
            wxLogTrace(TRACE_VERBOSE, wxT("* Value Length = %d"), strlen(value));
            wxLogTrace(TRACE_VERBOSE, wxT("* Value Size = %d"), sizeof(value));
//            wxLogTrace(TRACE_VERBOSE, wxT("* Value Data = %s"), value);
            wxLogTrace(TRACE_VERBOSE, wxT("* "));



Trace: (TRACE_VERBOSE) * Value found
Trace: (TRACE_VERBOSE) *
Trace: (TRACE_VERBOSE) * Value Length = 1024
Trace: (TRACE_VERBOSE) * Value Size = 4
Trace: (TRACE_VERBOSE) * Value Data = ........................................(1024 of them)
Trace: (TRACE_VERBOSE) * Result Length = 32
Trace: (TRACE_VERBOSE) * Value Length = 4
Trace: (TRACE_VERBOSE) * Value Size = 4
Trace: (TRACE_VERBOSE) *

It's a pretty simple
my result is the correct size,
my value is a pointer(4bytes)
--when nwnxcpy executes it appears that it is copying the 4 bytes of the pointer into my value *not what I want.

Note: I've commented the 2nd Value Data.
This works the first time, but whenever I execute it after nwnxcpy() my entire application no longer recognises UTF8 encoding.

While I'm not proficient in C++, I'm a bit perplexed why a 'follow the example' bit of code is not working for me, let alone the weirdness of losing UTF8.

Any help getting sqlite3_column_text() and nwnxcpy() working together, they don't work together by default, would be much appreciated.

Cheers
Gryphyn
Back to top
View user's profile Send private message
kungfoowiz



Joined: 12 Oct 2006
Posts: 61

PostPosted: Sun Jan 14, 2007 12:49    Post subject: Reply with quote

What does wxLogMessage( value ) say? Scratch that.

This could be a problem:

Code:

void Plugin::nwnxcpy(char* buffer, const char* response, size_t len)
{
   size_t size = strlen(buffer);
...


Instead of strlen( .. ), sizeof( .. ) perhaps?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group