Windows compilation - cannot link, gl2ps

Hello all,

I’ve finally managed to get Avogadro to build on windows, almost. The
compilation is finished, but now I’m seeing the following linker error
when creating avogadro.exe:

Linking CXX executable …\bin\avogadro.exe
mainwindow.cpp.obj : error LNK2019: unresolved external symbol _gl2psEndPage ref
erenced in function “public: void __thiscall Avogadro::MainWindow::exportGL2PS(v
oid)” (?exportGL2PS@MainWindow@Avogadro@@QAEXXZ)
mainwindow.cpp.obj : error LNK2019: unresolved external symbol _gl2psBeginPage r
eferenced in function “public: void __thiscall Avogadro::MainWindow::exportGL2PS
(void)” (?exportGL2PS@MainWindow@Avogadro@@QAEXXZ)
…\bin\avogadro.exe : fatal error LNK1120: 2 unresolved externals
LINK Pass 1 failed. with 2
NMAKE : fatal error U1077: ‘“C:\Program Files\CMake 2.8\bin\cmake.exe”’ : return
code '0xffffffff’
Stop.
NMAKE : fatal error U1077: ‘“C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
\nmake.exe”’ : return code '0x2’
Stop.
NMAKE : fatal error U1077: ‘“C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
\nmake.exe”’ : return code '0x2’
Stop.

Any ideas?

Dave

On Fri, Sep 10, 2010 at 2:18 PM, David Lonie loniedavid@gmail.com wrote:

Hello all,

I’ve finally managed to get Avogadro to build on windows, almost. The
compilation is finished, but now I’m seeing the following linker error
when creating avogadro.exe:

With VERBOSE=1:

Linking CXX executable …\bin\avogadro.exe
cd C:\src\avogadro-cryos-master-20100910\cryos-avogadro-5331997\build\av
ogadro\src
"C:\Program Files\CMake 2.8\bin\cmake.exe" -E vs_link_exe C:\PROGRA~1\MI
CROS~2.0\VC\bin\cl.exe /nologo @CMakeFiles\avogadro-app.dir\objects1.rsp @C:\DO
CUME~1\Dave\LOCALS~1\Temp\nmAD.tmp
Visual Studio Incremental Link with embeded manifests
Create …\bin\avogadro.exe.resource.txt
RC Pass 1:
C:/Program Files/Microsoft SDKs/Windows/v6.0A/bin/RC.Exe /fo…\bin\avogadro.e
xe.embed.manifest.res …\bin\avogadro.exe.resource.txt
LINK Pass 1:
C:\PROGRA~1\MICROS~2.0\VC\bin\cl.exe /nologo @CMakeFiles\avogadro-app.dir\object
s1.rsp /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
/Fe…\bin\avogadro.exe /FdC:\src\avogadro-cryos-master-20100910\cryos-avogad
ro-5331997\build\bin\avogadro.pdb -link /implib:avogadro.lib /version:0.0 /STACK
:10000000 /machine:X86 /debug /INCREMENTAL:YES /subsystem:windows C:\src\qt-4.6.
3\lib\qtmaind.lib C:\src\qt-4.6.3\lib\QtOpenGLd4.lib C:\src\qt-4.6.3\lib\QtGuid4
.lib C:\src\qt-4.6.3\lib\QtNetworkd4.lib C:\src\qt-4.6.3\lib\QtCored4.lib C:\src
\openbabel-trunk\build\src\Debug\openbabel-2.lib …\libavogadro\src\avogadro.
lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut3
2.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:…\bin\avoga
dro.exe.intermediate.manifest …\bin\avogadro.exe.embed.manifest.res
mainwindow.cpp.obj : error LNK2019: unresolved external symbol _gl2psEndPage ref
erenced in function “public: void __thiscall Avogadro::MainWindow::exportGL2PS(v
oid)” (?exportGL2PS@MainWindow@Avogadro@@QAEXXZ)
mainwindow.cpp.obj : error LNK2019: unresolved external symbol _gl2psBeginPage r
eferenced in function “public: void __thiscall Avogadro::MainWindow::exportGL2PS
(void)” (?exportGL2PS@MainWindow@Avogadro@@QAEXXZ)
…\bin\avogadro.exe : fatal error LNK1120: 2 unresolved externals
LINK Pass 1 failed. with 2
NMAKE : fatal error U1077: ‘“C:\Program Files\CMake 2.8\bin\cmake.exe”’ : return
code '0xffffffff’
Stop.
NMAKE : fatal error U1077: ‘“C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
\nmake.exe”’ : return code '0x2’
Stop.
NMAKE : fatal error U1077: ‘“C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
\nmake.exe”’ : return code '0x2’
Stop.

On Fri, 10 Sep 2010 16:15:24 -0400
David Lonie loniedavid@gmail.com wrote:

On Fri, Sep 10, 2010 at 2:18 PM, David Lonie loniedavid@gmail.com
wrote:

Hello all,

I’ve finally managed to get Avogadro to build on windows, almost.
The compilation is finished, but now I’m seeing the following
linker error when creating avogadro.exe:

Please try to build with defined GL2PSDLL and GL2PSDLL_EXPORTS


Regards,
Konstantin

On Sat, Sep 11, 2010 at 9:36 AM, Konstantin Tokarev annulen@yandex.ru wrote:

On Fri, 10 Sep 2010 16:15:24 -0400
David Lonie loniedavid@gmail.com wrote:

On Fri, Sep 10, 2010 at 2:18 PM, David Lonie loniedavid@gmail.com
wrote:

Hello all,

I’ve finally managed to get Avogadro to build on windows, almost.
The compilation is finished, but now I’m seeing the following
linker error when creating avogadro.exe:

Please try to build with defined GL2PSDLL and GL2PSDLL_EXPORTS

I will try this on Monday. For now, I did get everything to compile by
commenting out the gl2ps function from mainwindow.

Dave

On Sat, Sep 11, 2010 at 9:38 AM, David Lonie loniedavid@gmail.com wrote:

On Sat, Sep 11, 2010 at 9:36 AM, Konstantin Tokarev annulen@yandex.ru wrote:

On Fri, 10 Sep 2010 16:15:24 -0400
David Lonie loniedavid@gmail.com wrote:

On Fri, Sep 10, 2010 at 2:18 PM, David Lonie loniedavid@gmail.com
wrote:

Hello all,

I’ve finally managed to get Avogadro to build on windows, almost.
The compilation is finished, but now I’m seeing the following
linker error when creating avogadro.exe:

Please try to build with defined GL2PSDLL and GL2PSDLL_EXPORTS

What should these be defined to? Can you add the CMake code necessary
for this to be set automatically?

Dave

21.09.2010, 02:39, “David Lonie” loniedavid@gmail.com:

On Sat, Sep 11, 2010 at 9:38 AM, David Lonie loniedavid@gmail.com wrote:

On Sat, Sep 11, 2010 at 9:36 AM, Konstantin Tokarev annulen@yandex.ru wrote:

On Fri, 10 Sep 2010 16:15:24 -0400
David Lonie loniedavid@gmail.com wrote:

On Fri, Sep 10, 2010 at 2:18 PM, David Lonie loniedavid@gmail.com
wrote:

Hello all,

I’ve finally managed to get Avogadro to build on windows, almost.
The compilation is finished, but now I’m seeing the following
linker error when creating avogadro.exe:
Please try to build with defined GL2PSDLL and GL2PSDLL_EXPORTS

What should these be defined to? Can you add the CMake code necessary
for this to be set automatically?

Sorry for delay - this patch should fix it:
http://review.avogadro.openmolecules.net:8080/#change,194


Regards,
Konstantin