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 
 
DLL Compiling Problems

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Technical support
View previous topic :: View next topic  
Author Message
Surley



Joined: 11 Jun 2007
Posts: 2

PostPosted: Mon Jun 11, 2007 14:35    Post subject: DLL Compiling Problems Reply with quote

Hi !

I'm a french student actually working on a project using the NWN2 system as a visualizer for a Natural Language System with one of my classmate. This is about understanding some short instructions and make them happen in the game by controlling a NPC. At the end of the project we are supposed to enter a kind of "cooking list of instructions" in XML format using a home-developped editor in our plugin and make a NPC do everything he's asked to do, like attack, move to a specific location, get a specific object...etcetra...in the game using an "action engine" which is nearly finished now.

We are actually encountering some nasty problems with the compilation of a DLL which works using NWNX 4. We have already tried to use the NWNX Demo and the xp_timer and everything seems to be Ok, but when we try to use our own DLL which contains some simple classes used by the "cooking instructions editor", nothing works. My mate tried to fix the problem by recompiling the xp_timer's DLL, to see if the bug was coming from his program, but it failed too. We are currently unable to compile this f...cking DLL nor the xp_time one !!! And that's ashame because it's the last step of our project, which will be completly finished when we'll be able to communicate between the "cooking system" and NWN2.

Our problem comes from the Visual Studio configuration when used to create a DLL file.

So...there is my question. Could it be possible to have some explanations about how to configure Visual Studio 2005 in the DLL compilations properties ??

There's lot and lot of options and we still don't know which ones are used by NWN2. Everything we've looked at on the net wasn't sufficient to get "how to" do it correctly.

Thanks in advance if you can fix this stupid problem.

Surley
Back to top
View user's profile Send private message
xaltos



Joined: 03 Jun 2006
Posts: 31
Location: Germany

PostPosted: Mon Jun 11, 2007 19:30    Post subject: Reply with quote

Normal you can download the NWNx4 software, open the NWNX4.sln file with visual studio and can compile the whole project at once without any change.

I had big problems by my own with compiling the single dlls when I opened just a single dll with the IDE.

In this case are a lot search pathes for the different files wrong and it is a huge work to fix them all.

So use the NWNX4.sln solution file and all should without a change ( for the original NWNx4 files )


You should maybe post some of your main error messages from your own project, so we get an better idea where your problem is.
_________________
xaltos

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



Joined: 20 Jan 2005
Posts: 431

PostPosted: Tue Jun 12, 2007 0:47    Post subject: Reply with quote

Quick Steps to a new plugin...

1. Export the SVN source to your local disk (c:\nwnx4)
2. Copy the folder "C:\nwnx4\src\plugins\time\"
3. Paste the folder back into "C:\nwnx4\src\plugins\"
4. Rename the "Copy of - time" to your PLUGIN name (eg myplugin)
5. In this new folder rename
5a. - time.h -> myplugin.h
5b. - time.cpp -> myplugin.cpp
5c - time.vcproj -> myplugin.vcproj
5d (optional) remove any files and folders not listed in (a,b,c)

6. Start Visual Studio
7. Open Solution "c:\nwnx4\src\nwnx4.sln"
8. RClick Solution 'NWNX4' in tree
9. Add->Existing Project
10. Select your new project "C:\nwnx4\src\plugins\myproject\myplugin.vcproj" **Keep your eyes open**
**What happened? You now have two XP_Time projects.
11. Rename the NEW (you were watching?) XP_Time project to XP_MyPlugin

12. Properties Tab: change the "Root namespace" (myplugin)
13. Property Pages: *RClick project -> Properties (NOT the same as above)
14. Config Properties -> C/C++ -> Linker -> General ->Output
change xp_timed.dll to xp_myplugind.dll (for debug mode)
change xp_time.dll to xp_myplugin.dll (for release mode)

15. Back to 'Solution Explorer' - Expand project.
16. Remove time.h & time.cpp from project (DO NOT DELETE THEM)
17. Header Files -> Add -> Existing Items (myplugin.h)
18. Source Files -> Add -> Existing Items (myplugin.cpp)

19. Select the project (again)
20. VS Menu -> Edit -> Find and Replace -> Quick Replace
Find: Timer Replace with: MyPlugin (*match whole word)

You now have your own copy/version of the Timer plugin, with everything left in place. You can start coding with this as a base.

One advantage of doing this is that steps 6..10 are all that is required should you need to export from SVN again.

Cheers
Gryphyn

*well there quick steps if you do them often enough Wink
Back to top
View user's profile Send private message
Surley



Joined: 11 Jun 2007
Posts: 2

PostPosted: Wed Jun 13, 2007 16:18    Post subject: Reply with quote

Thanks for all. The reason why I haven't post some of my errors is that the errors are not the same on a different computer. We've tried the plugin on two computers which had the same NWNX4 version installed, and as the results were random, so we couldn't use it to find the bug.
Back to top
View user's profile Send private message
Bingo



Joined: 13 Jun 2007
Posts: 1

PostPosted: Wed Jun 13, 2007 21:06    Post subject: Reply with quote

Hello,

I am working with Surley on this plugin.
In fact, in a first time I would like to re-compile the time plugin. So, I've opened the NWNX4.sln and cliked on "Build Solution"... No error.
But the xp_time.dll doesn't work with the prototype (v1.07) and I don't know why.
Look at my logfile :

Code:

NWN Extender 4 V.0.0.7
(c) 2007 by Ingmar Stieger (Papillon)
visit us at http://www.nwnx.org

* Loading plugins...
* Loading plugin xp_time.dll: Error. Could not retrieve class object pointer.
* NWNX4 activated.
* Function not specified.
* Function class 'TIME' not provided by any plugin. Check your installation.
* NWNX4 shutting down...
* NWNX4 shutdown successfull.


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


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Fri Jun 22, 2007 12:18    Post subject: Reply with quote

Did you mix up the sources of 1.08 from SVN with the executeable of 1.07 ? This won't work.

Either it's all 1.07 (NWNX + plugins) or it's 1.08.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Technical support All times are GMT + 2 Hours
Page 1 of 1

 
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