并尝试在python中进行扩展,以检查是否在 C++代码和Python中的使用将工作
你知道吗设置.py你知道吗
from distutils.core import setup, Extension
setup(name='init',
version='1.0',
ext_modules=[Extension('testemeu',['main.cpp'],include_dirs=[r"C:\Users\v\Documents\code\C\sml\SFML-2.4.2\include"],library_dirs = [r"C:\Users\v\Documents\code\C\sml\SFML-2.4.2\lib"])])
但出现以下错误:
running build
running build_ext
building 'testemeu' extension
C:\MinGW\bin\gcc.exe -mdll -O -Wall -IC:\Users\v\Documents\code\C\sml\SFML-2.4.2
\include -IC:\Python34\include -IC:\Python34\include -c main.cpp -o build\temp.w
in32-3.4\Release\main.o
writing build\temp.win32-3.4\Release\testemeu.def
C:\MinGW\bin\g++.exe -shared -s build\temp.win32-3.4\Release\main.o build\temp.w
in32-3.4\Release\testemeu.def -LC:\Users\v\Documents\code\C\sml\SFML-2.4.2\lib -
LC:\Python34\libs -LC:\Python34\PCbuild -lpython34 -lmsvcr100 -o build\lib.win32
-3.4\testemeu.pyd
build\temp.win32-3.4\Release\main.o:main.cpp:(.text+0x75): undefined reference t
o `_imp___ZN2sf6StringC1EPKcRKSt6locale'
build\temp.win32-3.4\Release\main.o:main.cpp:(.text+0x98): undefined reference t
o `_imp___ZN2sf9VideoModeC1Ejjj'
build\temp.win32-3.4\Release\main.o:main.cpp:(.text+0xd1): undefined reference t
o `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettin
gsE'
build\temp.win32-3.4\Release\main.o:main.cpp:(.text+0xf4): undefined reference t
o `_imp___ZNK2sf6Window6isOpenEv'
build\temp.win32-3.4\Release\main.o:main.cpp:(.text+0x119): undefined reference
to `_imp___ZN2sf6Window9pollEventERNS_5EventE'
build\temp.win32-3.4\Release\main.o:main.cpp:(.text+0x135): undefined reference
to `_imp___ZN2sf6Window5closeEv'
build\temp.win32-3.4\Release\main.o:main.cpp:(.text+0x13c): undefined reference
to `_imp___ZN2sf5Color5BlackE'
build\temp.win32-3.4\Release\main.o:main.cpp:(.text+0x14b): undefined reference
to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE'
build\temp.win32-3.4\Release\main.o:main.cpp:(.text+0x15a): undefined reference
to `_imp___ZN2sf6Window7displayEv'
build\temp.win32-3.4\Release\main.o:main.cpp:(.text+0x192): undefined reference
to `_imp___ZN2sf12RenderWindowD1Ev'
build\temp.win32-3.4\Release\main.o:main.cpp:(.text+0x1af): undefined reference
to `_imp___ZN2sf12RenderWindowD1Ev'
collect2.exe: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1
如何解决这个问题?你知道吗
似乎您忘记了在命令中链接到某些库。 我找到了一些你可以链接到的图书馆。将其添加到编译器命令中,并用自己的安装路径交换
<sfml-install-path>
相关问题 更多 >
编程相关推荐