X-Spam-Check-By: sourceware.org Message-ID: <5f0807670707280535u71d26ef6s4b0af545f30cd04f@mail.gmail.com> Date: Sat, 28 Jul 2007 05:35:15 -0700 From: "Pradip Jadav" To: cygwin AT cygwin DOT com Subject: Creating dll in cygwin gives "Undefined reference" errors In-Reply-To: <5f0807670707280532t44a7d607vf92a06231313d5d9@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5f0807670707280532t44a7d607vf92a06231313d5d9 AT mail DOT gmail DOT com> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Hi to all, I am trying to create dll in cygwin. I read, http://www.cygwin.com/cygwin-ug-net/dll.html . But didn't got much help from that document. I am porting Linux code to windows using cygwin. I am done with main program. But want to create add-on module for that program as I have done in Linux. The Makefile to create add-on module in linux is, --------------------------------------------- sample.so: sample.c g++ sample.c -I. -I../../include -pthread -D_REENTRANT -Wl,-soname,sample.so -shared -fPIC -o sample.so clean: rm -f sample.so sample.so --------------------------------------------- It creates a .so file and works fine with my main program in Linux. So now I want to create .DLL file in cygwin using above Makefile. So made some changes in Makefile like, --------------------------------------------- sample.dll: sample.c g++ sample.c -I. -I../../include -D_REENTRANT -Wl,-soname,sample.dll -shared -o sample.dll clean: rm -f sample.dll sample.dll --------------------------------------------- But when I compiles in cygwin it gives me some "Undefined reference" errors. Take an example, /cygdrive/e/DOCUME~1/LOCALS~1/Temp/ccLMFYUe.o:sample.c:(.text+0x4c): undefined reference to `createlog(int, char*, ...)' Now this "createlog" function is defined in one of .cpp file of my main program.(Just for your information) Can you help me to solve problem of "undefined reference" ?? -- Regards, Pradip -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/