cygwin 1.5.12-1: collect2: ld Error while compiling
hi, I have cygwin installed in machine.The configuration is in attachment. Previously i was using the cygwin1.dll vs 1.5.11-1 , at that time i made my project compiled successfully in cygwin. But before two days i upgrade my cygwin version and made it to 1.5.12-1. After installing(i mean upgrading) that cygwin ,i have compiled the same source with newer cygwin1.dll i found one error given below /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/bin/ld: BFD 2.15.91 20040725 assertion fail /netrel/src/binutils-20040725-2/bfd/coffgen.c:411 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/bin/ld: BFD 2.1 5.91 20040725 assertion fail /netrel/src/binutils-20040725-2/bfd/cofflink.c:2269 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/bin/ld: /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../libdl.a(d001169.o): illegal symbol index 1852403562 in relocs collect2: ld returned 1 exit status make: *** [mypro] Error 1 And now my compilation is incompete due to that error. So plz help me to solve that problem.. Pradip K. Jadav _ Glamour, lifestyle, health. Get all the fundas you need. http://www.msn.co.in/cinema/ At MSN Entertainment! -- 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/
ld error while making a dll for module
hi all , here i m having a prob regarding creating a shared dll. what exactly is that i m having a code which is abt a proxy server. It is linux based source code and i m porting it to windows with the help of CYGWIN .. Its exe is working fine ..Now i m going to create add-on module for that project.. Its abt CLAMAV antivirus. I have all header files, llibclamav, etc. Now when i m going to create shared dll using following Makefile ::-- CXX = g++ CXXFLAGS = -g -O2 -I../../include -I. -Wall -Wno-sign-compare -Wno-unknown-pragmas -Wno-format -D_GNU_SOURCE clamavlib.DLL : clamavlib.c ${CXX} $< ${CXXFLAGS} -Wl, -shared -L. -lclamav -Wl,-soname,$@ -o $@ clean: rm -f libclamavlib.DLL clamavlib.DLL It is giving me ld error which is i m attaching as a file . So now my question is "Is my code for makefile is correct ??" If any solution for the error then plz help me.. --- Begin Message --- --- End Message --- -- 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/
Make a Shared Library using Makefile
Ok Guys , I had posted one mail few days ago ,but didn't got the reply.. ok no problem .. The problem may with the way, I was compiling. But here i m presenting a problem which is regarding " To create a shared Library". As we know shared library created in Linux are in " .SO" extension. Here i m giving a Makefile which creates a .so file in Linux--- CXX = g++ CXXFLAGS = -g -O2 -I../../include -I. -Wall -Wno-sign-compare -Wno-unknown-pragmas -Wno-format -D_GNU_SOURCE example.so : example.c ${CXX} $< ${CXXFLAGS} -shared -fPIC -L. -lexample -Wl,-soname,$@ -o $@ clean: rm -f libexample.so example.so ...And as told in previous query , i m going to create shared library in windows(i.e. DLL ) using our cygwin. I m using Makefile in cygwin as--- CXX = g++ CXXFLAGS = -g -O2 -I../../include -I. -Wall -Wno-sign-compare -Wno-unknown-pragmas -Wno-format -D_GNU_SOURCE example.dll : example.c ${CXX} $< ${CXXFLAGS} -shared -fPIC -L. -lexample -Wl,-soname,$@ -o $@ clean: rm -f libexample.dll example.dll Also i m having all libraries for my .c file.. So my query is that " Is it the right way to create a DLL using such makefile?? ", Or is there any other way to create a DLL ??? I know i asked this query earliar but i have given the way at which i m going to create a DLL file.. Any help will be appreciated.. Waiting for reply -- With Best Regards Pradip K. Jadav -- 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/
Re: Make a Shared Library using Makefile
Ok first ,thanx for ur reply.. > > You haven't said whether what you have tried is working or not. You > haven't explained exactly how it is failing and what errors you are > getting if it is not working. If you want help you need to be more > specific. > Here i m going to explain u what actually i want to do... what exactly is that i m having a code which is abt a proxy server. It is linux based source code and i m porting it to windows with the help of CYGWIN .. Its exe is working fine ..Now i m going to create add-on module for that project.. That add- on module requires .so files(in linux) to be created by makefile. And now i m using that procedure in cygwin for windows port. Now when i m going to create shared dll( in windows using cygwin) by Makefile , It is giving me ld error which is i m attaching as a file . I think now i m more specific then earliar. > You shouldn't use "-fPIC" or "-Wl,soname" as far as I know. Then what options or flags must be taken to create dll ??? (just like .so files created in linux) And ya wait.as i m getting error on delivering mail to u by attaching file i m going to display list of errors here itself(so sorry for that ).. --- --- $ make g++ examplelib.c -g -O2 -I../../include -I. -Wall -Wno-sign-compare -Wno-unknown-pragmas -Wno-format -D_GNU_SOURCE -shared -fPIC -L. -lexample -Wl,-soname,examplelib.DLL -o examplelib.DLL /cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUwhV6V.o(.text+0x4a): In function `_ZNSt4listI9examplelibSaIS0_EE6insertESt14_List_iteratorIS0_RS0_PS0_ERKS0_': /usr/include/c++/3.3.3/bits/basic_string.h: undefined reference to `putlog(int, char*, ...)' /cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUwhV6V.o(.text+0x86):/usr/include/ c++/3.3.3/bits/basic_string.h: undefined reference to `_hooks' /cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUwhV6V.o(.text+0x92):/usr/include/ c++/3.3.3/bits/basic_string.h: undefined reference to `Hooks::Add(void (*)(), in t)' /cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUwhV6V.o(.text+0x161): In function `_ZN16examplelibSectionC2Ev': /usr/include/c++/3.3.3/bits/stl_alloc.h:652: undefined reference to `Section::Se ction[not-in-charge](std::basic_string, std::alloca tor >, int)' /cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUwhV6V.o(.text+0x1e9): In function `_ZN16examplelibSectionC2Ev': /home/pradip/proxy17-01-2005/modules/examplelib/examplelib.c:55: undefined ref erence to `_processors' /cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUwhV6V.o(.text+0x1f5):/home/pradip /proxy17-01-2005/modules/examplelib/examplelib.c:55: undefined reference to `P rocessors::Add(int (*)(CONNECTION_T*, Filebuf*), int)' .SOME MORE ERRORS (not listing coz its to lengthy..). /cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccUwhV6V.o(.text$_ZN16examplelibSecti onD0Ev[examplelibSection::~examplelibSection [in-charge deleting]()]+0xb7):/usr/in clude/c++/3.3.3/bits/basic_string.h: undefined reference to `Section::~Section [ not-in-charge]()' collect2: ld returned 1 exit status make: *** [examplelib.DLL] Error 1 -- --- waiting for reply... -- 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/
Re: Make a Shared Library using Makefile
hello, I am back here... In the journey of making SHARED dll's, i have been lost somewhere in my path... but during these days i found a post searched in google like this... "You are using some classes which are kept in some library. It is not enough to add h-file with these classes, We need to add also library file for linker. The way we do it depends on the compiler. So need to add library name." Now question is how do I come to know that which libraries required to make shared dll's for my project project??..The error I have listed already in link below... http://cygwin.com/ml/cygwin/2005-01/msg01282.html There we can see that with all functions [for example ..putlog(int,char*, ...)' which works like a printf statement] and all class declarations made by me are showing "undefined reference to" errors while compiling(I mean while ld goes to bind all linking datas ). This dll creation is really headache for me but also its MUST do task. -- With Best Regards Pradip K. Jadav -- 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/
Re: Make a Shared Library using Makefile
And ya "Dllexport and Dllimport" are required in source code I mean should include in my own header files? I read that ""The main problems are caused by the fact that Windows DynamicLinked Libraries (DLL s) assume some specific information to be introduced in the source code directly, while the UNIX DynamicLinked share Libraries don t need any "special information" in the source"" so i have to change source code ???I mean have to add "special information" like Dllexport and Dllimport ??? waiting for reply... On Thu, 27 Jan 2005 09:57:46 -0500 (EST), Igor Pechtchanski <[EMAIL PROTECTED]> wrote: > On Thu, 27 Jan 2005, Igor Pechtchanski wrote: > > > On Thu, 27 Jan 2005, Brian Dessent wrote: > > > > > Pradip Jadav wrote: > > > > > > > example.dll : example.c > > > > ${CXX} $< ${CXXFLAGS} -shared -fPIC -L. -lexample > -Wl,-soname,$@ -o $@ > > > > > > You shouldn't use "-fPIC" or "-Wl,soname" as far as I know. > > > > -fPIC is ignored (and there's a warning about it), and -Wl,soname is > > redundant but harmless, AFAIK. Another option that might help is > > -Wl,-out-implib,[EMAIL PROTECTED], so that the DLL can be linked with via > > an import > > Make that -Wl,--out-implib,[EMAIL PROTECTED] (I thought I'd checked it before > sending > off the e-mail, but apparently not). > > > library later. > > Igor > > -- > http://cs.nyu.edu/~pechtcha/ > |\ _,,,---,,_ [EMAIL PROTECTED] > ZZZzz /,`.-'`'-. ;-;;,_ [EMAIL PROTECTED] > |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. > '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! > > "The Sun will pass between the Earth and the Moon tonight for a total > Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT > > -- > 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/ > > -- With Best Regards Pradip K. Jadav -- 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/
Reuse of old downloded cygwin packages
hello everybody.. I have a query regarding reuse of earlier downloaded packages...The actual situation is like this.. Earlier I was having 6 GB hard Drive ,so i thought to replace my Hard drive with 40 GB. I took backup of downloded and installed packages of cygwin.. I was downloading in "D:\cygwin" and installed in "c:\cygwin".In d:\cygwin there was a subfolder named "http%3a%2f%2fsources-redhat.mirror.redwire.net%2fcygwin", where all packages are present. Now I want to reuse it. So how to do that?? And another question is that whether I keep installed packages to c:\cygwin or not in new hard drive?? thanx in advance... -- With Best Regards Pradip K. Jadav -- 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/
Re: Reuse of old downloded cygwin packages
ya I have done like that only...but unfortunatly it does not work.. While doing setup, at the time of selecting packages only devel portion shows two selections named gcc core and gcc - testsuite, all other packages are showing nothing to install ... now??? On Thu, 17 Mar 2005 07:41:43 -0600, Paulo Sequeira <[EMAIL PROTECTED]> wrote: > Pradip Jadav wrote: > > hello everybody.. > > I have a query regarding reuse of earlier downloaded packages...The > > actual situation is like this.. > > Earlier I was having 6 GB hard Drive ,so i thought to replace my Hard > > drive with 40 GB. I took backup of downloded and installed packages of > > cygwin.. I was downloading in "D:\cygwin" and installed in > > "c:\cygwin".In d:\cygwin there was a subfolder named > > "http%3a%2f%2fsources-redhat.mirror.redwire.net%2fcygwin", where all > > packages are present. Now I want to reuse it. So how to do that?? > > And another question is that whether I keep installed packages to > > c:\cygwin or not in new hard drive?? > > thanx in advance... > > > > So, you copied all of D:\cygwin to the new hard drive, right? Simply > running D:\cygwin\setup.exe, and choosing to install from from local > directory is all you need. > > I'm not completely sure about this, but I think that what is recommended > to have cygwin installed in the new drive is to do a complete install > with setup, instead of merely copying the contents of c:\cygwin. After > that, to restore your c:\cygwin\home files, well, just take the backup > you made of that directory and replace the contents of the new home with > them. Note that, if you have manually unpacked and installed any files > outside home, you may have to reinstall them again. > > This is what I would do, but beware, I haven't tried this for a while, > and I may be wrong or missing details. > > -- > Paulo > > -- > 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/ > > -- With Best Regards Pradip K. Jadav -- 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/
Re: Reuse of old downloded cygwin packages
ok The problem is resolved.. Actually I was copying folder from one hard-drive to another in DOS mode.so what happened .all filenames and foldernames more than 6 characters were renamed.. e.g. libgpg-error folder was renamed to LIBGPG~1 and libgpg-error-1.0-2.tar.bz2 file renamed to LIBGPG~1.BZ2. hence the setup was not detecting all packages... Now if u dont mind I just want ask whether this problem can be fixed??? I mean if files and folders are renamed by DOS system itself , then our setup.exe should detect them also ??? Sorry if its silly question On Mon, 21 Mar 2005 12:36:37 +0530, Pradip Jadav <[EMAIL PROTECTED]> wrote: > ya I have done like that only...but unfortunatly it does not work.. > While doing setup, at the time of selecting packages only devel > portion shows two selections named gcc core and gcc - testsuite, all > other packages are showing nothing to install ... > now??? > > > On Thu, 17 Mar 2005 07:41:43 -0600, Paulo Sequeira > <[EMAIL PROTECTED]> wrote: > > Pradip Jadav wrote: > > > hello everybody.. > > > I have a query regarding reuse of earlier downloaded packages...The > > > actual situation is like this.. > > > Earlier I was having 6 GB hard Drive ,so i thought to replace my Hard > > > drive with 40 GB. I took backup of downloded and installed packages of > > > cygwin.. I was downloading in "D:\cygwin" and installed in > > > "c:\cygwin".In d:\cygwin there was a subfolder named > > > "http%3a%2f%2fsources-redhat.mirror.redwire.net%2fcygwin", where all > > > packages are present. Now I want to reuse it. So how to do that?? > > > And another question is that whether I keep installed packages to > > > c:\cygwin or not in new hard drive?? > > > thanx in advance... > > > > > > > So, you copied all of D:\cygwin to the new hard drive, right? Simply > > running D:\cygwin\setup.exe, and choosing to install from from local > > directory is all you need. > > > > I'm not completely sure about this, but I think that what is recommended > > to have cygwin installed in the new drive is to do a complete install > > with setup, instead of merely copying the contents of c:\cygwin. After > > that, to restore your c:\cygwin\home files, well, just take the backup > > you made of that directory and replace the contents of the new home with > > them. Note that, if you have manually unpacked and installed any files > > outside home, you may have to reinstall them again. > > > > This is what I would do, but beware, I haven't tried this for a while, > > and I may be wrong or missing details. > > > > -- > > Paulo > > > > -- > > 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/ > > > > > > -- > With Best Regards > Pradip K. Jadav > -- With Best Regards Pradip K. Jadav -- 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/
Rebase All command.....
Hi guys.. When I gave command "rebase all", my monitor's screen got damaged. I mean 25% of screen is got Black and resizing screen is only upto 80% of total screen.. It appers as full screen sometimes and 80% screen sometimes. Now I have changed my monitor , and this new monitor is working fine. That damaged monitor is not working properly at any other machine.. My question is -- Was that just coincidence or rebase all command had done something??? -- 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/
Re: Rebase All command.....
ohh that means no chance for recovery... Is there any? shhhi. my fault . I think i did not read document of rebaseall command properly... Anyway thanx for reply... On 4/21/05, Dave Korn <[EMAIL PROTECTED]> wrote: > Original Message > >From: Pradip Jadav > >Sent: 21 April 2005 17:47 > > > Hi guys.. > > When I gave command "rebase all", my monitor's screen got damaged. I > > mean 25% of screen is got Black and resizing screen is only upto 80% > > of total screen.. It appers as full screen sometimes and 80% screen > > sometimes. Now I have changed my monitor , and this new monitor is > > working fine. That damaged monitor is not working properly at any > > other machine.. > > > > My question is -- Was that just coincidence or rebase all command > > had done something??? > > You must have specified the "--disable-monitor" option! > > cheers, > DaveK > -- > Can't think of a witty .sigline today > > -- > 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/ > > -- With Best Regards Pradip K. Jadav -- 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/
cygrunsrv.exe -- start the service automatically on failure??
Hello all, As with cygrunsrv.exe we can install-start-stop a service, is it possible to restart the service automatically on failure?? We can see from properties of a service, a Recovery tab is available where there are options like First failure, second failures, subsequent failures to take an action on service fail. I have set for my service(manually) as, First failure -- Restart the Service second failures -- Restart the Service subsequent failures -- Restart the Service So now my question is, "is it possible to set these options automatically when we installs the service with cygrunsrv.exe so that we need not to set it manually as I have done??"" thanx -- Pradip K. Jadav -- 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/
Re: Installation problem
Hi to all, -- Pinaki Mukherjee wrote: I'm trying to install cygwin and it's not happening properly. From cygwin website, I downloaded the setup.exe file and then ran it. I chose the first option "Install from Internet". The files are getting downloaded, and then it tries to install the program. When the installation is 99% complete, it's getting stuck there with no progress. I waited for a long time, but nothing happened. So I had to cancel the process, and on doing so I got a message "Installation complete". There was no shortcut created on desktop or start menu, although I found directories created under C:\cygwin and also the registry entries for cygwin. On trying to reinstall it (after uninstalling by deleting reg entries and C:\cygwin), I encountered the same problem (again at 99%). This time I noted down the message in the progress window. "no package... /etc/postinstall/post-texmf.sh" I could locate this particular file (4 KB) in my computer. Can anybody please help. I'm using Windows XP Pro Version 2000 SP2, and an Intel Xeon processor. --- I am getting same problem with my new installation with current(latest) setup.exe. But my setup hangs with message Running... No Package /etc/postinstall/sysvinit.sh And I kept that stage upto almost 3 hours and at last I canceled it.. I m trying this since last 3 days... But yet my setup is not completed.. Help me as soon as possible... One more question... Where can I get old setup.exe??? thanx -- Pradip K. Jadav -- 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/
Re: Installation problem
On 9/23/05, Larry Hall <[EMAIL PROTECTED]> wrote: > At 05:58 AM 9/23/2005, you wrote: > >Hi to all, > > > >-- > > > > >--- > > > >I am getting same problem with my new installation with > >current(latest) setup.exe. > >But my setup hangs with message > >Running... > >No Package > >/etc/postinstall/sysvinit.sh > > > >And I kept that stage upto almost 3 hours and at last I canceled it.. > >I m trying this since last 3 days... But yet my setup is not completed.. > >Help me as soon as possible... > > > If you're just looking for the quickest way to get going, rerun 'setup.exe' > and install the default set of packages. Then rerun it and install whatever > else you want. oh sorry It did not helped me.. Actually I have tried fresh Installation as u told(means first time default installation and then selected items installation). But this time also it hangs at "sysvinit.sh". > > If you want to help determine why this is happening so that it can be fixed, > you could try grabbing 'strace' from another Cygwin installation and > attaching to the 'bash' process that's running 'sysvinit.sh'. If you can > get an idea of where it's going wrong from this output, it may give some > insight into the solution. > And ya I did not understand this point. can u plz tell me in detail. > > >One more question... Where can I get old setup.exe??? > > > Google for "Cygwin Time Machine". And going in this direction, you are > completely on your own. > > > > > -- > Larry Hall http://www.rfk.com > RFK Partners, Inc. (508) 893-9779 - RFK Office > 838 Washington Street (508) 893-9889 - FAX > Holliston, MA 01746 > > -- Pradip K. Jadav -- 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/
Creating dll in cygwin gives "Undefined reference" errors
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/
Re: Creating dll in cygwin gives "Undefined reference" errors
On 7/28/07, Brian Dessent <[EMAIL PROTECTED]> wrote: > Pradip Jadav wrote: > > > 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" ?? > > The undefined reference is because fundamentally ELF (Linux) and PE/COFF > (Windows) are very different in terms of how linking works under the > hood. The short explanation is that PE/COFF requires all references to > be resolved at link-time, thus you have to explicitly tell the linker > where createlog() is to be found. > > But I've typed this explanation so many times, I think I'll just start > linking to past copies of it: > > http://www.cygwin.com/ml/cygwin/2005-07/msg00675.html > http://www.cygwin.com/ml/cygwin/2006-12/msg00592.html > http://www.cygwin.com/ml/cygwin/2007-06/msg00450.html > > Brian > > -- > 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/ > > Hi Brian, First of all thanx for your reply. Secondly, sorry for not going through all previous helps. BTW, following link helped me a lot. http://www.cygwin.com/ml/cygwin/2006-12/msg00592.html YEAH, Now I am able to create .dll file and also succeeded in attaching it to the main executable. Steps are ... ###create main.c and do dllexport for a function. For example, In main.c ==> __declspec(dllexport) int func1() ###create object file. g++ -c main.c ###create main.exe file. g++ -o main.exe main.o -ldl ###create .def file dlltool.exe --export-all-symbols --output-def main.def main.o ###create main library file. dlltool.exe --dllname main.exe --def main.def --output-lib libmain.dll.a ###create DLL. g++ -shared -o theDLL.dll theDLL.c -L. -lmain Thats it ...!! :) But scene is not this much only.. This was the scene with a single function. What if we want to export more than one function from main program? What if we want to use a class which is declared in main program(Using this class I Want to create a derived class in dll code)? Do I need to specify "__declspec(dllexport)" for all? Is there any other way? Its because my program is quite big. So managing code will be very tough na? Waiting for reply. -- Regards, Pradip K. Jadav (Mob.)+91-9323315353 -- 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/
Re: Creating dll in cygwin gives "Undefined reference" errors
On 8/11/07, Brian Dessent <[EMAIL PROTECTED]> wrote: > g++ -o main.exe main.o -ldl -Wl,-out-implib,libmain.dll.a I tried this, but it gives same "Unresolved reference" errors. I will do R&D on this and excluding "__declspec" part later. But currently I am going with "__declspec " part . Using it, gives something weired problem. In my dll code there is a call of a class which is defined in main program. "extern Workers oworkers;" But at time of compilation, It gives me error like, -- $ g++ -shared -o sample.dll sample.c -L. -lmain fu01.o:(.idata$2+0xc): undefined reference to `_libmain_dll_a_iname' fu02.o:(.idata$2+0xc): undefined reference to `_libmain_dll_a_iname' fu03.o:(.idata$2+0xc): undefined reference to `_libmain_dll_a_iname' fu04.o:(.idata$2+0xc): undefined reference to `_libmain_dll_a_iname' fu05.o:(.idata$2+0xc): undefined reference to `_libmain_dll_a_iname' fu06.o:(.idata$2+0xc): more undefined references to `_libmain_dll_a_iname' follow nmth00.o:(.idata$4+0x0): undefined reference to `__nm__workers' Info: resolving _workers by linking to __imp__workers (auto-import) collect2: ld returned 1 exit status -- With the help of your reply, I changed my use of class to, __declspec(dllimport) extern Workers oworkers; And it compiles successfully. But at time of execution, it gives me dlopen error like, dlopen : No such process Whats wrong here now? -- Regards, Pradip K. Jadav (Mob.)+91-9323315353 -- 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/