472,971 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,971 software developers and data experts.

boost.python error with DirectX

I am using boost.python to wrap C++ function which includes
directmusic libraries to simply play the midi, but lots of linkage
errors "error LNK2001: unresolved external symbol". I wonder if it is
possible to work with DirectX - directmusic libs. Are there any ways
to wrap it?

*********************compilation errors *************************
msvc.link.dll bin\msvc-7.1\debug\threading-multi\playmusic.pyd bin
Creating library bin\msvc-7.1\debug\threading-multi\playmusic.lib
and object
playmusic.obj : error LNK2001: unresolved external symbol
playmusic.obj : error LNK2019: unresolved external symbol
0 referenced in function "void __cdecl `anonymous
namespace'::StartPlay(void)" (
playmusic.obj : error LNK2001: unresolved external symbol
playmusic.obj : error LNK2001: unresolved external symbol
playmusic.obj : error LNK2001: unresolved external symbol
playmusic.obj : error LNK2001: unresolved external symbol
playmusic.obj : error LNK2001: unresolved external symbol
playmusic.obj : error LNK2019: unresolved external symbol
e@20 referenced in function "void __cdecl `anonymous
" (?StartPlay@?A0xc386fc44@@YAXXZ)
playmusic.obj : error LNK2001: unresolved external symbol
playmusic.obj : error LNK2001: unresolved external symbol
playmusic.obj : error LNK2019: unresolved external symbol
referenced in function "void __cdecl `anonymous
namespace'::StartPlay(void)" (?S
bin\msvc-7.1\debug\threading-multi\playmusic.pyd : fatal error
LNK1120: 11 unres
olved externals

call "C:\Program Files\Microsoft Visual Studio .NET
2.bat" >nul
link /NOLOGO /INCREMENTAL:NO /DLL /DEBUG /subsystem:console /out:"bin
ebug\threading-multi\playmusic.pyd" /IMPLIB:"bin\msvc-7.1\debug
playmusic.lib" /LIBPATH:"C:\Panda3D-1.4.0\python\libs" @"bin
if exist "bin\msvc-7.1\debug\threading-multi
\playmusic.pyd.manifest" (
mt -nologo -manifest "bin\msvc-7.1\debug\threading-multi
yd.manifest" "-outputresource:bin\msvc-7.1\debug\threading-multi

....failed msvc.link.dll bin\msvc-7.1\debug\threading-multi
\playmusic.pyd bin\msv
....removing bin\msvc-7.1\debug\threading-multi\playmusic.lib
....failed updating 2 targets...

******************************************compilia tion

In C++, Inside "playmusic.cpp", it needs to include following
DirectMusic libs. The link errors mainly related to directmusic

#include <dmusicc.h>
#include <dmusici.h>
#include <dmusicf.h>

************* playmusic.cpp*************************

#include <boost/python/class.hpp>
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
#include "boost/python/detail/wrap_python.hpp"

//using namespace std;
#include <windows.h>
#include <dmusicc.h>
#include <dmusici.h>
#include <dmusicf.h>

namespace {
// Defines, constants, and global variables
void StartPlay();

IDirectMusicLoader8* g_pLoader = NULL;
IDirectMusicPerformance8* g_pPerformance = NULL;
IDirectMusicSegment8* g_pSegment = NULL;
FLOAT fTempo;

void StartPlay() {
// Initialize COM

// Create loader object
CoCreateInstance( CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC,
IID_IDirectMusicLoader8, (void**)&g_pLoader );

namespace python = boost::python;

python::def("StartPlay", StartPlay);

*********** playmusic.cpp***************************

The code in void StartPlay() inside "playmusic.cpp" can be compiled
and executed successfully before in C++, so I extract that part.
Any ideas? Thanks so much for your help

Oct 1 '07 #1
0 1495

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Li Daobing | last post by:
I can't use .def(str(self)) I write a simple example, without `str', I can build it well, but with this one, I can't build //Rational.cpp #include <boost/python.hpp> #include <iostream> ...
by: matt.keyes | last post by:
Hey all, i'm trying to create an application that both embeds and extends python through boost. i've got a rough framework up and running, but now that i'm finally to the python part i'm having...
by: JDJMSon | last post by:
I was wondering if someone here could help me with a problem I'm having building Python extensions with the Boost.Python library. Basically, if I have a wrapper class with something like this: ...
by: TonyHa | last post by:
Hello I try to install boost_1_33_1 on RedHat Linux. I have downloaded boost into /user/dtgtools/tmp and I try to install it into /user/dtgtools/packages/boost. I use the following commands:...
by: Osiris | last post by:
I have these pieces of C-code (NOT C++ !!) I want to call from Python. I found Boost. I have MS Visual Studio 2005 with C++. is this the idea: I write the following C source file:...
by: Osiris | last post by:
My experiences with BOOST on Windows XP and Visual C++ 2005 I'm new to Python. I built software in more than ten other computer languages. I'm not sure if that is not a handicap, when reading...
by: Shawn McGrath | last post by:
Hi, I'm trying to expose a C++ class' internals to python via boost::python. I can do integer/boolean functions fine, but as soon as I do a string get/set it craps out. ...
by: Soren | last post by:
Hi! I'm trying to extend my python program with some C++ code. Right now I've spent hours just trying to get boost to work! I'm trying to get the example hello.cpp to work. Using Windows XP...
by: deepest1 | last post by:
Hi everybody. I'm trying to use boost, but just don't know how to set it up. My os is winXP (installed on disk D). Python is installed in D:\Python25 MigGW compiler is installed in D:\MinGW...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.