473,608 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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?

*************** ******compilati on errors *************** **********
msvc.link.dll bin\msvc-7.1\debug\threa ding-multi\playmusic .pyd bin
\msvc-7.1\debu
g\threading-multi\playmusic .lib
Creating library bin\msvc-7.1\debug\threa ding-multi\playmusic .lib
and object
bin\msvc-7.1\debug\threa ding-multi\playmusic .exp
playmusic.obj : error LNK2001: unresolved external symbol
_GUID_PerfMaste rTempo
playmusic.obj : error LNK2019: unresolved external symbol
__imp__CoUninit ialize@
0 referenced in function "void __cdecl `anonymous
namespace'::Sta rtPlay(void)" (
?StartPlay@?A0x c386fc44@@YAXXZ )
playmusic.obj : error LNK2001: unresolved external symbol
_CLSID_DirectMu sicSegm
ent
playmusic.obj : error LNK2001: unresolved external symbol
_IID_IDirectMus icSegme
nt8
playmusic.obj : error LNK2001: unresolved external symbol
_GUID_DirectMus icAllTy
pes
playmusic.obj : error LNK2001: unresolved external symbol
_CLSID_DirectMu sicPerf
ormance
playmusic.obj : error LNK2001: unresolved external symbol
_IID_IDirectMus icPerfo
rmance8
playmusic.obj : error LNK2019: unresolved external symbol
__imp__CoCreate Instanc
e@20 referenced in function "void __cdecl `anonymous
namespace'::Sta rtPlay(void)
" (?StartPlay@?A0 xc386fc44@@YAXX Z)
playmusic.obj : error LNK2001: unresolved external symbol
_CLSID_DirectMu sicLoad
er
playmusic.obj : error LNK2001: unresolved external symbol
_IID_IDirectMus icLoade
r8
playmusic.obj : error LNK2019: unresolved external symbol
__imp__CoInitia lize@4
referenced in function "void __cdecl `anonymous
namespace'::Sta rtPlay(void)" (?S
tartPlay@?A0xc3 86fc44@@YAXXZ)
bin\msvc-7.1\debug\threa ding-multi\playmusic .pyd : fatal error
LNK1120: 11 unres
olved externals

call "C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\bin\vc vars3
2.bat" >nul
link /NOLOGO /INCREMENTAL:NO /DLL /DEBUG /subsystem:conso le /out:"bin
\msvc-7.1\d
ebug\threading-multi\playmusic .pyd" /IMPLIB:"bin\msv c-7.1\debug
\threading-multi\
playmusic.lib" /LIBPATH:"C:\Pan da3D-1.4.0\python\li bs" @"bin
\msvc-7.1\debug\th
reading-multi\playmusic .pyd.rsp"
if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
if exist "bin\msvc-7.1\debug\threa ding-multi
\playmusic.pyd. manifest" (
mt -nologo -manifest "bin\msvc-7.1\debug\threa ding-multi
\playmusic.p
yd.manifest" "-outputresource: bin\msvc-7.1\debug\threa ding-multi
\playmusic.pyd; 2
"
)

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

*************** *************** ************com piliation
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();

IDirectMusicLoa der8* g_pLoader = NULL;
IDirectMusicPer formance8* g_pPerformance = NULL;
IDirectMusicSeg ment8* g_pSegment = NULL;
FLOAT fTempo;

void StartPlay() {
// Initialize COM
CoInitialize(NU LL);

// Create loader object
CoCreateInstanc e( CLSID_DirectMus icLoader, NULL, CLSCTX_INPROC,
IID_IDirectMusi cLoader8, (void**)&g_pLoa der );

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

BOOST_PYTHON_MO DULE(playmusic)
{
python::def("St artPlay", 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 1545

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

Similar topics

0
2124
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> using namespace std; using namespace boost::python;
0
1334
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 troubles. Here's a rough run-down of my code: Base class (pure):
4
2266
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: string TestFunc() { return "Hello World"; } BOOST_PYTHON_MODULE(TestClass)
3
5626
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: export PYTHON_ROOT="/user/dtgtools/packages/python/2.5"
11
4901
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: ============================ #include <iostream> #include <stdafx.h>
0
1760
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 documentation of a system like BOOST. However: It took me more than four full working days to get a Python/C/C++ 'hello world!' program to work. There is a lot of documentation, but somehow it did not 'click' with my previous experience. I think...
4
4231
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. boost::python::class_<Entity, std::auto_ptr<pyEntity("Entity") //publics .def("isActive", &Entity::isActive) //bool .def("activate", &Entity::activate) //bool .def("deactivate", &Entity::deactivate) //bool //...
6
7666
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 and Visual Studio 8 (.NET 2005) I've set BOOST_BUILD_PATH = C:\boost\boost_1_33_1 (where i installed
2
1788
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 (i downloaded it because djgpp is making much more errors with bjam) I have downloaded boost_1_35_0.zip and boost-jam-3.1.16-1-ntx86.zip,
0
8063
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8003
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8498
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8478
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8152
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8341
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4025
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1331
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.