LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-09-2014, 10:37 AM   #1
Caengineer
LQ Newbie
 
Registered: Dec 2014
Posts: 6

Rep: Reputation: Disabled
Cygwin problem lpthread missing!


I have a folder includes many c++, c, h, object files as well as a MakeFile. So, I used Cygwin as well as MinGW to create an executable file namely calibrator.exe.

So, I address the target folder and type in "make all". On both MinGW and CygWin got the following errors.

CygWin:

<pre lang="vb">g++ -O3 -gstabs -Wall -DHAVE_CONFIG_H=1 -DMEASURES_BITS_16WIDE `fltk-config --cxxflags` -I/usr/include/libxml2 -I../emeter-toolkit -I../emeter-metrology/include -I../emeter-app -ocalibrator.exe cal-gui.o cal-control.o generator.o generator-by2463m.o generator-kaipu.o generator-ptc8320m.o generator-manual.o generator-pts3_3.o generator-pts3_3c.o generator-tf9100.o generator-star.o gui.o meter-control.o meter-access-dlt645.o meter-consumption-window.o meter-readings-window.o meter-support-windows.o ref-meter-by2463m.o ref-meter-control.o ref-meter-hsiang-cheng-hc3100.o ref-meter-kaipu-p3001c.o ref-meter-pts3_3.o ref-meter-pts3_3c.o ref-meter-star-s6502.o ref-meter-mixed.o pts3_3.o pts3_3c.o kaipu_p3001c.o serial.o meter-interact-dlt645.o -L/MinGW/bin -lxml2 -lpthreadGC2 `fltk-config --ldflags`
/usr/lib/gcc/x86_64-pc-cygwin/4.8.3/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lpthreadGC2
collect2: error: ld returned 1 exit status
Makefile:100: recipe for target 'calibrator.exe' failed
make: *** [calibrator.exe] Error 1</pre>



MinGW:

<a href="http://tinypic.com/view.php?pic=vzvhir&s=8#.VIcFdTHF98E">Click here!</a>

So as you can see, seems in my cygwin and MinGW Bin's Folder there is something missing which is called "LpthreadGC2". I looked in this folder and found nothing under this name.

So, what do you think? How can I fix this problem and make .exe? what is the extension of this file? Is this a .dll file or so? Any idea please?

Thank you in advance!
 
Old 12-10-2014, 04:40 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,476

Rep: Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771
I would try -pthread instead of that -lpthreadGC2, probably helps (but I'm not really sure)
 
Old 12-10-2014, 10:49 AM   #3
Caengineer
LQ Newbie
 
Registered: Dec 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
I would try -pthread instead of that -lpthreadGC2, probably helps (but I'm not really sure)
Sorry but I do not understand your point! How can I replace it with pthread? What folder please?
 
Old 12-10-2014, 10:51 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,476

Rep: Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771
that is not a folder, but a switch to the compiler. You need to modify it in the makefile.
 
Old 12-10-2014, 10:54 AM   #5
Caengineer
LQ Newbie
 
Registered: Dec 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
that is not a folder, but a switch to the compiler. You need to modify it in the makefile.
Oh! I see! With what software or IDE or whatever I can edit my makefile please?
 
Old 12-10-2014, 11:37 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,476

Rep: Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771
you can edit a makefile with any text editor (that is a simple text file)
 
Old 12-10-2014, 11:41 AM   #7
Caengineer
LQ Newbie
 
Registered: Dec 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
you can edit a makefile with any text editor (that is a simple text file)
Yes, I did it with notepad++ but still I got error.
 
Old 12-10-2014, 11:43 AM   #8
Caengineer
LQ Newbie
 
Registered: Dec 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
you can edit a makefile with any text editor (that is a simple text file)
Here is part of the MakeFile:


ifdef WINDIR
EXTRA_LIBS = -L/MinGW/bin -lxml2 -lpthreadGC2
else
EXTRA_LIBS = -lxml2 -lpthread
endif



I changed it to

ifdef WINDIR
EXTRA_LIBS = -L/MinGW/bin -lxml2 -lpthreadGC2
else
EXTRA_LIBS = -lxml2 -pthread
endif
 
Old 12-10-2014, 11:44 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,476

Rep: Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771
please post the error message and other relevant info (probably the makefile itself, what do you want to make), otherwise we will not able to give you any help
 
Old 12-10-2014, 11:46 AM   #10
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,476

Rep: Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771Reputation: 7771
also check this, probably helps
 
Old 12-10-2014, 11:51 AM   #11
Caengineer
LQ Newbie
 
Registered: Dec 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
please post the error message and other relevant info (probably the makefile itself, what do you want to make), otherwise we will not able to give you any help
Ok this is the error message:

g++ -O3 -gstabs -Wall -DHAVE_CONFIG_H=1 -DMEASURES_BITS_16WIDE `fltk-config --cxxflags` -I/usr/include/libxml2 -I../emeter-toolkit -I../emeter-metrology/include -I../emeter-app -ocalibrator.exe cal-gui.o cal-control.o generator.o generator-by2463m.o generator-kaipu.o generator-ptc8320m.o generator-manual.o generator-pts3_3.o generator-pts3_3c.o generator-tf9100.o generator-star.o gui.o meter-control.o meter-access-dlt645.o meter-consumption-window.o meter-readings-window.o meter-support-windows.o ref-meter-by2463m.o ref-meter-control.o ref-meter-hsiang-cheng-hc3100.o ref-meter-kaipu-p3001c.o ref-meter-pts3_3.o ref-meter-pts3_3c.o ref-meter-star-s6502.o ref-meter-mixed.o pts3_3.o pts3_3c.o kaipu_p3001c.o serial.o meter-interact-dlt645.o -L/MinGW/bin -lxml2 -lpthreadGC2 `fltk-config --ldflags`
/usr/lib/gcc/x86_64-pc-cygwin/4.8.3/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lpthreadGC2
collect2: error: ld returned 1 exit status
Makefile:100: recipe for target 'calibrator.exe' failed
make: *** [calibrator.exe] Error 1



And here is the Make file. I would like to make an executable file namely calibrator.exe


Code:
#*******************************************************************************
#  Makefile -
#
#  Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ 
# 
#  Redistribution and use in source and binary forms, with or without 
#  modification, are permitted provided that the following conditions 
#  are met:
#
#    Redistributions of source code must retain the above copyright 
#    notice, this list of conditions and the following disclaimer.
#
#    Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the 
#    documentation and/or other materials provided with the   
#    distribution.
#
#    Neither the name of Texas Instruments Incorporated nor the names of
#    its contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#******************************************************************************

CPPFILES = cal-gui.cxx \
           cal-control.cxx \
           generator.cxx \
           generator-by2463m.cxx \
           generator-kaipu.cxx \
           generator-ptc8320m.cxx \
           generator-manual.cxx \
           generator-pts3_3.cxx \
           generator-pts3_3c.cxx \
           generator-tf9100.cxx \
           generator-star.cxx \
           gui.cxx \
           meter-control.cxx \
           meter-access-dlt645.cxx \
           meter-consumption-window.cxx \
           meter-readings-window.cxx \
           meter-support-windows.cxx \
           ref-meter-by2463m.cxx \
           ref-meter-control.cxx \
           ref-meter-hsiang-cheng-hc3100.cxx \
           ref-meter-kaipu-p3001c.cxx \
           ref-meter-pts3_3.cxx \
           ref-meter-pts3_3c.cxx \
           ref-meter-star-s6502.cxx \
           ref-meter-mixed.cxx
CFILES = pts3_3.c pts3_3c.c kaipu_p3001c.c serial.c meter-interact-dlt645.c
CPPOBJECTS = $(CPPFILES:.cxx=.o)
COBJECTS = $(CFILES:.c=.o)
OBJECTS = $(CPPOBJECTS) $(COBJECTS)
EXEEXT = .exe

.SUFFIXES: .c .cxx .h .fl .fld .o $(EXEEXT)

CC = gcc
CXX = g++
CFLAGS = -O3 -gstabs -Wall -DWIN32 -DHAVE_CONFIG_H=1 -DMEASURES_BITS_16WIDE `fltk-config --cflags` -I../emeter-toolkit -I../emeter-metrology/include -I../emeter-app
CXXFLAGS = -O3 -gstabs -Wall -DHAVE_CONFIG_H=1 -DMEASURES_BITS_16WIDE `fltk-config --cxxflags` -I/usr/include/libxml2 -I../emeter-toolkit -I../emeter-metrology/include -I../emeter-app

ifdef WINDIR
        EXTRA_LIBS = -L/MinGW/bin -lxml2 -lpthreadGC2
else
        EXTRA_LIBS =  -lxml2 -pthread
endif

.c.o:
	$(CXX) $(CFLAGS) -c $<

.cxx.o:
	$(CXX) $(CXXFLAGS) -c $<

.PHONY: all FORCE clean depend rmdepend implib

all: calibrator$(EXEEXT)

clean:
	rm -f *$(EXEEXT) *.o

gui.cxx gui.h: gui.fl
	fluid -c gui.fl
	sed -e "s/Fl_Box \*ch_cal_status_indicator\[4\];/Fl_Box \*ch_cal_status_indicator\[4\]\[24\];/" <gui.h >gui.xx1
	sed -e "s/Fl_Round_Button \*uut_phase_status\[16\];/Fl_Round_Button \*uut_phase_status\[16\]\[4\];/" <gui.xx1 >gui.xx2
	cp gui.xx2 gui.h

calibrator$(EXEEXT): $(OBJECTS)
	$(CXX) $(CXXFLAGS) -ocalibrator$(EXEEXT) $(OBJECTS) $(EXTRA_LIBS) `fltk-config --ldflags`

#automatic collection of dependencies in the source files.
#it's only updated the first time, after that it must be done maually
#with "make depend"
#the dependecies are included from a separate file:
-include dependencies.in
#target to update the file, it's removed first
depend: rmdepend dependencies.in
#remove the file
rmdepend:
	rm -f dependencies.in
#build the file that contains the dependencies. no deps in this rule.
#if there were deps it would be rebuilt every change, which is not needed:
dependencies.in: gui.cxx gui.h
	$(CXX) -MM ${CXXFLAGS} $(CPPOBJECTS:.o=.cxx) >$@
	$(CC) -MM ${CFLAGS} $(COBJECTS:.o=.c) >>$@
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
glut.h missing in cygwin piobair Programming 14 04-05-2014 07:39 PM
G++/Cygwin problems - missing files ChopperCharles Programming 2 11-27-2013 03:59 AM
Have you ever used cygwin, i've met a problem with the command stat from cygwin andy820303 Linux - Newbie 0 03-11-2009 04:37 AM
what is lpthread? cnivas Linux - Enterprise 1 09-18-2008 09:53 AM
Missing headers (mqueue.h) / libraries in Cygwin Sambatyon Programming 0 07-29-2005 02:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration