Java Native Interface (JNI) - Standard library not found--cygwin and -mno-cygwin

Hi,

I have been working to get a program to compile on windows using cygwin. When I added the -mno-cygwin flag to the compile line things were moving smoothly until it hit a class that #included <list>. At this point it throws several errors about things not being declared. I have seen this same question posted on several forums (including this one) but none of them have an answer. I'm not sure if it's becuase this problem is so simple that I should know the answer, or if no one that knows has seen the question.

Below is a portion of the errors. I appreciate any help that may be offered.

In file included from /usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/bits/stl_algobase.h:67,

from /usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/list:67,

from ../../src/QTree.h:3,

from ../../src/QTreeRepository.h:6,

from PSODA.cpp:2:

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cstdlib:181: error: `::strtold' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cstdlib:200: error: `__gnu_cxx::strtold' has not been declared

In file included from /usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/bits/postypes.h:46,

from /usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/iosfwd:50,

from /usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/bits/stl_algobase.h:70,

from /usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/list:67,

from ../../src/QTree.h:3,

from ../../src/QTreeRepository.h:6,

from PSODA.cpp:2:

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:146: error: `::fgetwc' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:147: error: `::fgetws' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:148: error: `::fputwc' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:149: error: `::fputws' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:150: error: `::fwide' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:151: error: `::fwprintf' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:152: error: `::fwscanf' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:153: error: `::getwc' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:154: error: `::getwchar' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:159: error: `::putwc' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:160: error: `::putwchar' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:161: error: `::swprintf' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:162: error: `::swscanf' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:163: error: `::ungetwc' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:164: error: `::vfwprintf' has not been declared

/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:166: error: `::vfwscanf' has not been declared

Message was edited by:

mebbert

Message was edited by:

mebbert

[3318 byte] By [mebberta] at [2007-11-26 23:16:51]
# 1

I don't know if it will help your situation, but had a similiar problem with what was going on under the covers with gcc and was told to use the -E option which puts the preprocessing output into the object files. It is then possible to go through them and see step by step what the preprocessor is doing, where it's looking for includes, what it has found, and where.

Jim

jjones3566a at 2007-7-10 14:17:49 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

Thanks for the suggestion Jim. I finally found the answer last night. As I suspected it was fairly simple, but I had a difficult time finding the solution.

The answer is here: http://www.mingw.org/mingwfaq.shtml#faq-usingwithcygwin

Basically, if you're using the wrong g++ or gcc, it includes a bunch of stuff that doesn't work. I don't understand why it had the problems it had since all of the problems were from the stl's own include files but you need to change the path so that the MinGW stuff is before the Cygwin stuff. You might also find that afterwards you will have problems with "make." It looks like make 3.8.1 has some issues with ".deps" folders or something. If you do experience a problem that says "multiple targets" or something like that, you can either download make 3.8.0 or use the mingw-make in MinGW/bin.

Anyway, thanks again Jim for the help. I hope this posting will help others. There is no direct answer on the web for this. I searched long and hard.

mebberta at 2007-7-10 14:17:49 > top of Java-index,Java HotSpot Virtual Machine,Specifications...