Hello, world! :)
I built both Coind3d and SoWin libraries with MingW after a few tweaks,
but I'm not sure if it was built correctly. I also need help to know if
I'm compiling an example in the wrong way.
What follows is the record of every step I took to build them and the
changes I applied.
01 - Installed Bloodshed Dev-C++ package (with MingW) in C:\Dev-Cpp
02 - Installed MingW Msys (in another path)
03 - Unpacked Coin-2.4.3.tar.gz into /c/Jobs/Coin3d/Coin-2.4.3
Unpacked SoWin-1.2.0.tar.gz into /c/Jobs/Coin3d/SoWin-1.2.0
04 - Following the "Cookbook Procedure" in Coin3d/INSTALL,
I opened a Msys console and:
- cd /c/Jobs/Coin3d/Coin-2.4.3
- ./configure --disable-msvc
> ************************* WARNING ****************************
> *
> * We have not tested Coin on the mingw32 i686
> * platform with the g++ C++ compiler. Please re****t
> * back to us at <coin-sup****t@[EMAIL PROTECTED]
> how it works out.
> *
> **************************************************************
>
> Coin configuration settings:
> Library version: 2.4.3
> New in-development features: No (default)
> Generate Java wrapper: No (default)
> 3ds im****t capabilities: No (enable with --enable-3ds-im****t)
> VRML97 sup****t: Yes
> System threads API: native Win32
> Thread safe traversals: No (enable with --enable-threadsafe)
> simage linkage: run-time binding
> OpenAL sup****t: Yes, run-time binding
> Sound sup****t: Yes
> Fontconfig sup****t: Yes, run-time binding
> Win32 TrueType fonts: Yes
> FreeType library: Yes, run-time binding
> zlib sup****t: Yes, run-time binding
> bzip2 sup****t: Yes, run-time binding
> GLU linkage: run-time binding
> Installation prefix: /usr/local
- (Of course, I already sent a message to coin-sup****t@[EMAIL PROTECTED]
and tried to subscribe to coin-discuss@[EMAIL PROTECTED]
but their
site is timing out, now...)
- make
- make install
> ----------------------------------------------------------------------
> Libraries have been installed in:
> /usr/local/lib
>
> If you ever happen to want to link against installed libraries
> in a given directory, LIBDIR, you must either use libtool, and
> specify the full pathname of the library, or use the `-LLIBDIR'
> flag during linking and do at least one of the following:
> - add LIBDIR to the `PATH' environment variable
> during execution
> - add LIBDIR to the `LD_RUN_PATH' environment variable
> during linking
> - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
>
> See any operating system do***entation about shared libraries for
> more information, such as the ld(1) and ld.so(8) manual pages.
> ----------------------------------------------------------------------
05 - cd /c/Jobs/Coin3d/SoWin-1.2.0
- ./configure --disable-msvc
> checking if we can compile and link with the Coin library... false
> configure: WARNING:
> Compilation and/or linking with the Coin main library SDK failed, for
> unknown reason. If you are familiar with configure-based configuration
> and building, investigate the 'config.log' file for clues.
>
> If you can not figure out what went wrong, please forward the
'config.log'
> file to the email address <coin-sup****t@[EMAIL PROTECTED]
> and ask for help by
> describing the situation where this failed.
>
> configure: error: couldn't compile and link against Coin
- problem found in config.log:
> C:/msys/1.0/local/include/Inventor/C/basic.h:305:6: #error Define either
> COIN_DLL or COIN_NOT_DLL as appropriate for your linkage! See
> Inventor/C/basic.h for further instructions.
- env CPPFLAGS=-DCOIN_NOT_DLL ./configure --disable-msvc
> SoWin configuration settings:
> Installation Prefix: /usr/local
>
> Now, run 'make install' to build and install.
- make check
> In file included from SoWinSpaceball.cpp:40:
> ../../../../src/Inventor/Win/devices/spwinput_win32.h:42: error:
> use of enum `SpwRetVal' without previous declaration
[...]
> ../../../../src/Inventor/Win/devices/spwinput_win32.h:419: error:
> ISO C++ forbids declaration of `PFNSPW_ERRORSTRING' with no type
- In src/Inventor/Win/devices/spwinput_win32.h, I moved "SpwRetVal"
declaration to the top of the file, before it was first used,
(from line 364 to 42), and changed line 419
from: typedef (WINAPI *PFNSPW_ERRORSTRING) (enum SpwRetVal val);
to: typedef char * (WINAPI *PFNSPW_ERRORSTRING) (enum SpwRetVal
val);
- make check
> ../../../../src/Inventor/Win/devices/spwinput_win32.c:118: error:
> conflicting types for 'SPW_TranslateEventWin32'
[...]
- In src/Inventor/Win/devices/spwinput_win32.h, I changed line 501
(or 500, if you didn't make a commented copy of line 419 before)
from: int SPW_TranslateEventWin32(void * msg, SPW_InputEvent *
sbEvent);
to: int SPW_TranslateEventWin32(MSG * msg, SPW_InputEvent *
sbEvent);
- make check
> c:\Dev-Cpp\bin\make.exe[8]: *** No rule to make target
> `engines/libSoGuiEngines.la', needed by `libSoWin.la'. Stop.
- There's a "libSoWinEngines.la" in "src/Inventor/Win/engines"...
Perhaps the names were changed? I tried to make a soft link:
- cd src/Inventor/Win/engines
- ln -s libSoWinEngines.la libSoGuiEngines.la
- cd ../../../..
- make check
> c:\Dev-Cpp\bin\make.exe[8]: *** No rule to make target
> `nodes/libSoGuiNodes.la', needed by `libSoWin.la'. Stop.
- cd src/Inventor/Win/nodes
- ln -s libSoWinNodes.la libSoGuiNodes.la
- cd ../../../..
- make check
- no more errors! ^_^
- make install
> ----------------------------------------------------------------------
> Libraries have been installed in:
> /usr/local/lib
>
> If you ever happen to want to link against installed libraries
> in a given directory, LIBDIR, you must either use libtool, and
> specify the full pathname of the library, or use the `-LLIBDIR'
> flag during linking and do at least one of the following:
> - add LIBDIR to the `PATH' environment variable
> during execution
> - add LIBDIR to the `LD_RUN_PATH' environment variable
> during linking
> - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
>
> See any operating system do***entation about shared libraries for
> more information, such as the ld(1) and ld.so(8) manual pages.
> ----------------------------------------------------------------------
06 - Building the example from
http://www.coin3d.org/windows/tutorial/hello_coin
- cd ../hello_coin3d/
- with "#define COIN_DLL" and "#define SOWIN_DLL":
g++ -o hello_coin.exe main.cpp -I/usr/local/include -L/usr/local/lib
-Wl,--rpath -Wl,/usr/local/include
> C:/DO***E~1/Ric/LOCALS~1/Temp/cckxbaaa.o(.text+0x6d):main.cpp: undefined
reference to `_imp___ZN5SoWin4initEPKcS1_'
> C:/DO***E~1/Ric/LOCALS~1/Temp/cckxbaaa.o(.text+0xd3):main.cpp: undefined
reference to
`_imp___ZN19SoWinExaminerViewerC1EP6HWND__PKciN15SoWinFullViewer9BuildFlagEN11SoWinViewer4TypeE'
> C:/DO***E~1/Ric/LOCALS~1/Temp/cckxbaaa.o(.text+0x12e):main.cpp:
undefined reference to `_imp___ZN11SoSeparatorC1Ev'
> C:/DO***E~1/Ric/LOCALS~1/Temp/cckxbaaa.o(.text+0x189):main.cpp:
undefined reference to `_imp___ZN6SoConeC1Ev'
> C:/DO***E~1/Ric/LOCALS~1/Temp/cckxbaaa.o(.text+0x1ed):main.cpp:
undefined reference to `_imp___ZNK6SoBase3refEv'
> C:/DO***E~1/Ric/LOCALS~1/Temp/cckxbaaa.o(.text+0x248):main.cpp:
undefined reference to `_imp___ZN5SoWin4showEP6HWND__'
> C:/DO***E~1/Ric/LOCALS~1/Temp/cckxbaaa.o(.text+0x24f):main.cpp:
undefined reference to `_imp___ZN5SoWin8mainLoopEv'
> C:/DO***E~1/Ric/LOCALS~1/Temp/cckxbaaa.o(.text+0x274):main.cpp:
undefined reference to `_imp___ZNK6SoBase5unrefEv'
> collect2: ld returned 1 exit status
- with "#define SOWIN_NOT_DLL"
g++ -o hello_coin.exe main.cpp -I/usr/local/include -L/usr/local/lib
-Wl,--rpath -Wl,/usr/local/include
> C:/DO***E~1/Ric/LOCALS~1/Temp/cc6Laaaa.o(.text+0x74):main.cpp: undefined
reference to `SoWin::init(char const*, char const*)'
> C:/DO***E~1/Ric/LOCALS~1/Temp/cc6Laaaa.o(.text+0xd8):main.cpp: undefined
reference to `SoWinExaminerViewer::SoWinExaminerViewer(HWND__*, char
const*, int, SoWinFullViewer::BuildFlag, SoWinViewer::Type)'
> C:/DO***E~1/Ric/LOCALS~1/Temp/cc6Laaaa.o(.text+0x12a):main.cpp:
undefined reference to `_imp___ZN11SoSeparatorC1Ev'
> C:/DO***E~1/Ric/LOCALS~1/Temp/cc6Laaaa.o(.text+0x185):main.cpp:
undefined reference to `_imp___ZN6SoConeC1Ev'
> C:/DO***E~1/Ric/LOCALS~1/Temp/cc6Laaaa.o(.text+0x1e9):main.cpp:
undefined reference to `_imp___ZNK6SoBase3refEv'
> C:/DO***E~1/Ric/LOCALS~1/Temp/cc6Laaaa.o(.text+0x244):main.cpp:
undefined reference to `SoWin::show(HWND__*)'
> C:/DO***E~1/Ric/LOCALS~1/Temp/cc6Laaaa.o(.text+0x249):main.cpp:
undefined reference to `SoWin::mainLoop()'
> C:/DO***E~1/Ric/LOCALS~1/Temp/cc6Laaaa.o(.text+0x26c):main.cpp:
undefined reference to `_imp___ZNK6SoBase5unrefEv'
> collect2: ld returned 1 exit status
- ls -l /usr/local/lib
> total 21292
> -rw-r--r-- 1 Ric Administ 12068448 Aug 10 11:03 libCoin.dll.a
> -rw-r--r-- 1 Ric Administ 793 Aug 10 11:04 libCoin.la
> -rw-r--r-- 1 Ric Administ 31533516 Aug 10 11:54 libSoWin.a
> -rw-r--r-- 1 Ric Administ 809 Aug 10 11:54 libSoWin.la
- Let's try another way...
- cd /c/Jobs/Coin3d/SoWin-1.2.0
- make clean
- env CPPFLAGS=-DCOIN_DLL ./configure --disable-msvc
- make check
- (same errors and fixes as before... fixed them the same way, too)
- make check
- ls -l /usr/local/lib
> total 21320
> -rw-r--r-- 1 Ric Administ 12068448 Aug 10 11:03 libCoin.dll.a
> -rw-r--r-- 1 Ric Administ 793 Aug 10 11:04 libCoin.la
> -rw-r--r-- 1 Ric Administ 31590544 Aug 10 12:46 libSoWin.a
> -rw-r--r-- 1 Ric Administ 809 Aug 10 12:46 libSoWin.la
- cd ../hello_coin3d/
g++ -o hello_coin.exe main.cpp -I/usr/local/include -L/usr/local/lib
-Wl,--rpath -Wl,/usr/local/include /usr/local/lib/libSoWin.a 2>&1 |
less
> C:/DO***E~1/Ric/LOCALS~1/Temp/ccQTaaaa.o(.text+0x74):main.cpp: undefined
reference to `SoWin::init(char const*, char const*)'
> C:/DO***E~1/Ric/LOCALS~1/Temp/ccQTaaaa.o(.text+0x12a):main.cpp:
undefined reference to `_imp___ZN11SoSeparatorC1Ev'
> C:/DO***E~1/Ric/LOCALS~1/Temp/ccQTaaaa.o(.text+0x185):main.cpp:
undefined reference to `_imp___ZN6SoConeC1Ev'
> C:/DO***E~1/Ric/LOCALS~1/Temp/ccQTaaaa.o(.text+0x1e9):main.cpp:
undefined reference to `_imp___ZNK6SoBase3refEv'
> C:/DO***E~1/Ric/LOCALS~1/Temp/ccQTaaaa.o(.text+0x244):main.cpp:
undefined reference to `SoWin::show(HWND__*)'
> C:/DO***E~1/Ric/LOCALS~1/Temp/ccQTaaaa.o(.text+0x249):main.cpp:
undefined reference to `SoWin::mainLoop()'
> C:/DO***E~1/Ric/LOCALS~1/Temp/ccQTaaaa.o(.text+0x26c):main.cpp:
undefined reference to `_imp___ZNK6SoBase5unrefEv'
> C:/msys/1.0/local/lib/libSoWin.a(ExaminerViewer.o)(.text+0xc5): In
function `ZN20SoWinExaminerViewerP11constructorEi':
>
c:/Jobs/Coin3d/SoWin-1.2.0/src/Inventor/Win/viewers/ExaminerViewer.cpp:66:
undefined reference to `SoWinComponent::setClassName(char const*)'
> [...]
The same thing happens when I try to build a project using Dev-C++.
Probably I'm doing a very simple mistake... could anyone out there
please give me a hint of what can it be?
I'm running Windows XP SP1. If you need any more information, just let
me know.
Thank you! :)


|