473,416 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 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
\msvc-7.1\debu
g\threading-multi\playmusic.lib
Creating library bin\msvc-7.1\debug\threading-multi\playmusic.lib
and object
bin\msvc-7.1\debug\threading-multi\playmusic.exp
playmusic.obj : error LNK2001: unresolved external symbol
_GUID_PerfMasterTempo
playmusic.obj : error LNK2019: unresolved external symbol
__imp__CoUninitialize@
0 referenced in function "void __cdecl `anonymous
namespace'::StartPlay(void)" (
?StartPlay@?A0xc386fc44@@YAXXZ)
playmusic.obj : error LNK2001: unresolved external symbol
_CLSID_DirectMusicSegm
ent
playmusic.obj : error LNK2001: unresolved external symbol
_IID_IDirectMusicSegme
nt8
playmusic.obj : error LNK2001: unresolved external symbol
_GUID_DirectMusicAllTy
pes
playmusic.obj : error LNK2001: unresolved external symbol
_CLSID_DirectMusicPerf
ormance
playmusic.obj : error LNK2001: unresolved external symbol
_IID_IDirectMusicPerfo
rmance8
playmusic.obj : error LNK2019: unresolved external symbol
__imp__CoCreateInstanc
e@20 referenced in function "void __cdecl `anonymous
namespace'::StartPlay(void)
" (?StartPlay@?A0xc386fc44@@YAXXZ)
playmusic.obj : error LNK2001: unresolved external symbol
_CLSID_DirectMusicLoad
er
playmusic.obj : error LNK2001: unresolved external symbol
_IID_IDirectMusicLoade
r8
playmusic.obj : error LNK2019: unresolved external symbol
__imp__CoInitialize@4
referenced in function "void __cdecl `anonymous
namespace'::StartPlay(void)" (?S
tartPlay@?A0xc386fc44@@YAXXZ)
bin\msvc-7.1\debug\threading-multi\playmusic.pyd : fatal error
LNK1120: 11 unres
olved externals

call "C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\bin\vcvars3
2.bat" >nul
link /NOLOGO /INCREMENTAL:NO /DLL /DEBUG /subsystem:console /out:"bin
\msvc-7.1\d
ebug\threading-multi\playmusic.pyd" /IMPLIB:"bin\msvc-7.1\debug
\threading-multi\
playmusic.lib" /LIBPATH:"C:\Panda3D-1.4.0\python\libs" @"bin
\msvc-7.1\debug\th
reading-multi\playmusic.pyd.rsp"
if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
if exist "bin\msvc-7.1\debug\threading-multi
\playmusic.pyd.manifest" (
mt -nologo -manifest "bin\msvc-7.1\debug\threading-multi
\playmusic.p
yd.manifest" "-outputresource:bin\msvc-7.1\debug\threading-multi
\playmusic.pyd;2
"
)

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

******************************************compilia tion
errors**************

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

#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
CoInitialize(NULL);

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

..............
..............
namespace python = boost::python;

BOOST_PYTHON_MODULE(playmusic)
{
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 1524

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

Similar topics

0
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> ...
0
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...
4
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: ...
3
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:...
11
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:...
0
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...
4
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. ...
6
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...
2
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.