LINUX.ORG.RU

Как связать функции cygGL-1.dll при компиляции C-кода в cygwin

 ,


0

1

Здравствуйте уважаемые форумчане!

Прошу помощи по данному вопросу. Хочу откомпилировать Genius-TCAD (CogenDa, open source code). Для работы необходимы пакеты PETSc, VTK. Использую Windows 7, но поскольку я не нашел, как установить PETSc под Windows, то решил использовать Cygwin. Под Cygwin, PETSc(версия 3.1-p8), VTK(5.8.0) установились относительно легко. Genius-TCAD можно компилировать с помощью waf, но также нашёл версию с cmake. Но компиляция основного файла Genius-TCAD обрывается, поскольку не работают ссылки на внешние функции. Например, при использовании cmake возникает ошибка:

/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x760): undefined reference to `_imp__GetStockObject@4'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0xaf7): undefined reference to `_imp__SetBitmapDimensionEx@16'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0xf5c): undefined reference to `_imp__ExtFloodFill@20'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x1239): undefined reference to `_imp__CreatePen@12'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x1258): undefined reference to `_imp__SelectObject@8'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x1278): undefined reference to `_imp__MoveToEx@16'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x1290): undefined reference to `_imp__LineTo@12'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x1496): undefined reference to `_imp__CreateFontIndirectA@4'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x14df): undefined reference to `_imp__SelectObject@8'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x14f2): undefined reference to `_imp__SetTextColor@8'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x153c): undefined reference to `_imp__DeleteObject@4'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x1733): undefined reference to `_imp__CreateFontIndirectA@4'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x177c): undefined reference to `_imp__SelectObject@8'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x178f): undefined reference to `_imp__SetTextColor@8'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x17d9): undefined reference to `_imp__DeleteObject@4'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x1bc8): undefined reference to `_imp__CreateSolidBrush@4'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x1c14): undefined reference to `_imp__CreateEllipticRgn@16'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x1c2c): undefined reference to `_imp__FillRgn@12'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x1cf9): undefined reference to `_imp__SetPixelV@16'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x1d67): undefined reference to `_imp__BitBlt@36'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x1f51): undefined reference to `_imp__CreateCompatibleDC@4'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x1f71): undefined reference to `_imp__CreateCompatibleBitmap@12'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x1f8d): undefined reference to `_imp__SelectObject@8'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x1fc2): undefined reference to `_imp__ExtFloodFill@20'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x2011): undefined reference to `_imp__BitBlt@36'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x22da): undefined reference to `_imp__CreateSolidBrush@4'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x251d): undefined reference to `_imp__CreateSolidBrush@4'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x2540): undefined reference to `_imp__CreatePen@12'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x2659): undefined reference to `_imp__BeginPath@4'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x2679): undefined reference to `_imp__MoveToEx@16'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x268d): undefined reference to `_imp__LineTo@12'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x26cb): undefined reference to `_imp__EndPath@4'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x26d4): undefined reference to `_imp__SelectObject@8'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x26fd): undefined reference to `_imp__StrokeAndFillPath@4'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x2c21): undefined reference to `_imp__GetDeviceCaps@8'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x2c8e): undefined reference to `_imp__BitBlt@36'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x3348): undefined reference to `_imp__CreateCompatibleDC@4'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x336f): undefined reference to `_imp__CreateCompatibleBitmap@12'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x338c): undefined reference to `_imp__SelectObject@8'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x33c2): undefined reference to `_imp__ExtFloodFill@20'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x3a46): undefined reference to `_imp__CreateCompatibleDC@4'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x3a6d): undefined reference to `_imp__CreateCompatibleBitmap@12'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x3a8a): undefined reference to `_imp__SelectObject@8'
/packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a(win32draw.o):win32draw.c:(.text+0x3ac0): undefined reference to `_imp__ExtFloodFill@20'

Нашёл, что функция, к примеру, SetBitmapDimension есть в cygGL-1.dll. Такая же проблема с VTK (libvtkIO.a, libvtkCommon.a):

/usr/local/lib/vtk-5.8/libvtkIO.a(vtkZLibDataCompressor.cxx.o):vtkZLibDataCompressor.cxx:(.text+0x259): undefined reference to `vtk_zlib_compress2'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkZLibDataCompressor.cxx.o):vtkZLibDataCompressor.cxx:(.text+0x3cf): undefined reference to `vtk_zlib_uncompress'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0xc7): undefined reference to `vtk_expat_XML_Parse'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x4bd): undefined reference to `vtk_expat_XML_Parse'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x632): undefined reference to `vtk_expat_XML_SetElementHandler'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x650): undefined reference to `vtk_expat_XML_SetCharacterDataHandler'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x65f): undefined reference to `vtk_expat_XML_SetUserData'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x699): undefined reference to `vtk_expat_XML_Parse'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x6ac): undefined reference to `vtk_expat_XML_ParserFree'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x76f): undefined reference to `vtk_expat_XML_SetCharacterDataHandler'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0xcd7): undefined reference to `vtk_expat_XML_ParserCreate'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0xd57): undefined reference to `vtk_expat_XML_SetElementHandler'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0xd71): undefined reference to `vtk_expat_XML_SetCharacterDataHandler'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0xd85): undefined reference to `vtk_expat_XML_SetUserData'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0xdaf): undefined reference to `vtk_expat_XML_SetCharacterDataHandler'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0xf0d): undefined reference to `vtk_expat_XML_Parse'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x109e): undefined reference to `vtk_expat_XML_ParserFree'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x10ce): undefined reference to `vtk_expat_XML_Parse'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x1277): undefined reference to `vtk_expat_XML_Parse'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x12bb): undefined reference to `vtk_expat_XML_Parse'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x1af3): undefined reference to `vtk_expat_XML_GetErrorCode'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x1afb): undefined reference to `vtk_expat_XML_ErrorString'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x1b0a): undefined reference to `vtk_expat_XML_GetCurrentByteIndex'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x1b19): undefined reference to `vtk_expat_XML_GetCurrentColumnNumber'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x1b28): undefined reference to `vtk_expat_XML_GetCurrentLineNumber'
/usr/local/lib/vtk-5.8/libvtkIO.a(vtkXMLParser.cxx.o):vtkXMLParser.cxx:(.text+0x47c): undefined reference to `vtk_expat_XML_GetCurrentByteIndex'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkObjectFactory.cxx.o):vtkObjectFactory.cxx:(.text+0xa6f): undefined reference to `vtksys::Directory::Directory()'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkObjectFactory.cxx.o):vtkObjectFactory.cxx:(.text+0xa83): undefined reference to `vtksys::Directory::Load(char const*)'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkObjectFactory.cxx.o):vtkObjectFactory.cxx:(.text+0xaa8): undefined reference to `vtksys::Directory::GetNumberOfFiles() const'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkObjectFactory.cxx.o):vtkObjectFactory.cxx:(.text+0xac6): undefined reference to `vtksys::Directory::GetFile(unsigned long) const'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkObjectFactory.cxx.o):vtkObjectFactory.cxx:(.text+0xed1): undefined reference to `vtksys::Directory::~Directory()'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkObjectFactory.cxx.o):vtkObjectFactory.cxx:(.text+0xef3): undefined reference to `vtksys::Directory::~Directory()'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkVariant.cxx.o):vtkVariant.cxx:(.text+0xa9b): undefined reference to `vtksys::SystemTools::Strucmp(char const*, char const*)'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkVariant.cxx.o):vtkVariant.cxx:(.text+0xac2): undefined reference to `vtksys::SystemTools::Strucmp(char const*, char const*)'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkVariant.cxx.o):vtkVariant.cxx:(.text+0xaee): undefined reference to `vtksys::SystemTools::Strucmp(char const*, char const*)'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkVariant.cxx.o):vtkVariant.cxx:(.text+0xb04): undefined reference to `vtksys::SystemTools::Strucmp(char const*, char const*)'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkVariant.cxx.o):vtkVariant.cxx:(.text+0xb2e): undefined reference to `vtksys::SystemTools::Strucmp(char const*, char const*)'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkVariant.cxx.o):vtkVariant.cxx:(.text+0xb7c): more undefined references to `vtksys::SystemTools::Strucmp(char const*, char const*)' follow
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkVariant.cxx.o):vtkVariant.cxx:(.text.startup+0x33): undefined reference to `vtksys::SystemToolsManager::SystemToolsManager()'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkVariant.cxx.o):vtkVariant.cxx:(.text.startup+0x4a): undefined reference to `vtksys::SystemToolsManager::~SystemToolsManager()'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkXMLDataElement.cxx.o):vtkXMLDataElement.cxx:(.text.startup+0x33): undefined reference to `vtksys::SystemToolsManager::SystemToolsManager()'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkXMLDataElement.cxx.o):vtkXMLDataElement.cxx:(.text.startup+0x4a): undefined reference to `vtksys::SystemToolsManager::~SystemToolsManager()'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkDynamicLoader.cxx.o):vtkDynamicLoader.cxx:(.text+0x81): undefined reference to `vtksys::DynamicLoader::OpenLibrary(char const*)'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkDynamicLoader.cxx.o):vtkDynamicLoader.cxx:(.text+0x91): undefined reference to `vtksys::DynamicLoader::CloseLibrary(void*)'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkDynamicLoader.cxx.o):vtkDynamicLoader.cxx:(.text+0xa1): undefined reference to `vtksys::DynamicLoader::GetSymbolAddress(void*, char const*)'
/usr/local/lib/vtk-5.8/libvtkCommon.a(vtkDynamicLoader.cxx.o):vtkDynamicLoader.cxx:(.text+0xd1): undefined reference to `vtksys::DynamicLoader::LastError()'

Но здесь я не нашел, где находятся внешние функции.

Фактически основной файл компилируется командой:

/usr/bin/c++.exe  -O3 -DNDEBUG  -Wl,--enable-auto-import CMakeFiles/genius.dir/main.o  -o genius.exe -Wl,--out-implib,libgenius.dll.a -Wl,--major-image-version,0,--minor-image-version,0  -L/usr/Genius-TCAD-Open-master2/src/solution  -L/usr/Genius-TCAD-Open-master2/src/source  -L/usr/Genius-TCAD-Open-master2/src/solver  -L/usr/Genius-TCAD-Open-master2/src/bc  -L/usr/Genius-TCAD-Open-master2/src/hook  -L/usr/Genius-TCAD-Open-master2/src/meshgen  -L/usr/Genius-TCAD-Open-master2/src/contrib/dfise  -L/usr/Genius-TCAD-Open-master2/src/contrib/tif3d  -L/usr/Genius-TCAD-Open-master2/src/contrib/stanford  -L/usr/Genius-TCAD-Open-master2/src/contrib/spline  -L/usr/Genius-TCAD-Open-master2/src/fe  -L/usr/Genius-TCAD-Open-master2/src/quadrature  -L/usr/Genius-TCAD-Open-master2/src/interpolation  -L/usr/Genius-TCAD-Open-master2/src/geom  -L/usr/Genius-TCAD-Open-master2/src/mesh  -L/usr/Genius-TCAD-Open-master2/src/material  -L/usr/Genius-TCAD-Open-master2/src/parser  -L/usr/Genius-TCAD-Open-master2/src/base  -L/usr/Genius-TCAD-Open-master2/src/partition  -L/usr/Genius-TCAD-Open-master2/src/math  -L/usr/Genius-TCAD-Open-master2/src/utils  -L/usr/Genius-TCAD-Open-master2/src/contrib/mxml  -L/usr/Genius-TCAD-Open-master2/src/contrib/expreval  -L/usr/Genius-TCAD-Open-master2/src/contrib/csabathy  -L/usr/Genius-TCAD-Open-master2/src/contrib/spice  -L/usr/Genius-TCAD-Open-master2/src/contrib/klu  -L/usr/Genius-TCAD-Open-master2/src/contrib/nn  -L/usr/Genius-TCAD-Open-master2/src/contrib/ann  -L/usr/Genius-TCAD-Open-master2/src/contrib/triangle  -L/usr/Genius-TCAD-Open-master2/src/contrib/trex  -L/usr/local/lib/vtk-5.8  -L/packages/petsc-3.1-p8/win32-gnu/lib  solution/libsolution.a source/libsource.a solver/libsolver.a bc/libbc.a solution/libsolution.a hook/libhook.a meshgen/libmeshgen.a contrib/dfise/libdfise.a contrib/tif3d/libtif3d.a contrib/stanford/libstanford.a solver/libsolver.a contrib/spline/libspline.a fe/libfe.a quadrature/libquadrature.a interpolation/libinterpolation.a geom/libgeom.a mesh/libmesh.a material/libmaterial.a parser/libparser.a base/libbase.a partition/libpartition.a math/libmath.a utils/libutils.a contrib/mxml/libmxml.a contrib/expreval/libexpreval.a contrib/csabathy/libcsabathy.a contrib/spice/libspice.a contrib/klu/libklu.a contrib/nn/libnn.a contrib/ann/libann.a contrib/triangle/libtriangle.a contrib/trex/libtrex.a /usr/local/lib/vtk-5.8/libvtkIO.a /usr/local/lib/vtk-5.8/libvtkFiltering.a /usr/local/lib/vtk-5.8/libvtkCommon.a /packages/petsc-3.1-p8/win32-gnu/lib/libpetsc.a /packages/petsc-3.1-p8/win32-gnu/lib/libsuperlu_4.0.a /packages/petsc-3.1-p8/win32-gnu/lib/libflapack.a /packages/petsc-3.1-p8/win32-gnu/lib/libfblas.a -lgfortran -ldl 

Пожалуйста подскажите, как мне выйти из этой проблемы? Как заставить компилятор найти, например, SetBitmapDimension в cygGL-1.dll. Заранее благодарен.

Нашёл решение, надо добавить в конце что-то типа этого "-L/usr/lib/gcc/i686-pc-cygwin/4.9.3 -L/usr/i686-pc-cygwin/lib -ladvapi32 -lshell32 -luser32 -lgdi32".

Удалил бы эту тему, но не нашёл как.

Darkhyp ()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.