| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Message-ID: | <015101c1e340$a85724e0$967ba8c0@leopard> |
| From: | "William S Fulton" <wsf AT fultondesigns DOT co DOT uk> |
| To: | <mingw32 AT bilbao DOT com>, <cygwin AT cygwin DOT com> |
| Subject: | Re: Does anybody use G++ on Windows to make DLLs? |
| Date: | Sun, 14 Apr 2002 00:12:18 +0100 |
| MIME-Version: | 1.0 |
| X-Priority: | 3 |
| X-MSMail-Priority: | Normal |
| X-MimeOLE: | Produced By Microsoft MimeOLE V5.50.4522.1200 |
You should be using gcc not g++ as JNI requires C linkage. Take a look at
this site for help and tuturials on using Java JNI with cygwin:
http://www.inonit.com/cygwin/
Cheers
William
> I'm trying to create a DLL:
>
> --------------/HelloWorld.cpp/------
> #include <jni.h>
> #include "HelloWorld.h"
> #include <stdio.h>
>
> JNIEXPORT void JNICALL
> Java_HelloWorld_displayMessage(JNIEnv *env, jobject obj)
> {
> printf("Hello world!\n");
> return;
> }
>
> And if I try:
> g++.exe HelloWorldImp.dll "HelloWorld.o" -L"d:\Dev-C++\lib"
> -I"d:\Dev-C++\include" -I"D:\j2sdk\include"
> -I"D:\j2sdk\include\win32" -I"d:\Dev-C++\include\g++-3"
> -I"d:\Dev-C++\include"
>
> I get this error message:
>
> d:\Dev-C++\lib/libmingw32.a(main.o)(.text+0x8d):main.c:
> undefined reference to `WinMain AT 16'
>
> Any experience?
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |