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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-09-2014, 10:37 AM
|
#1
|
LQ Newbie
Registered: Dec 2014
Posts: 6
Rep:
|
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!
|
|
|
12-10-2014, 04:40 AM
|
#2
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,476
|
I would try -pthread instead of that -lpthreadGC2, probably helps (but I'm not really sure)
|
|
|
12-10-2014, 10:49 AM
|
#3
|
LQ Newbie
Registered: Dec 2014
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by pan64
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?
|
|
|
12-10-2014, 10:51 AM
|
#4
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,476
|
that is not a folder, but a switch to the compiler. You need to modify it in the makefile.
|
|
|
12-10-2014, 10:54 AM
|
#5
|
LQ Newbie
Registered: Dec 2014
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by pan64
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?
|
|
|
12-10-2014, 11:37 AM
|
#6
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,476
|
you can edit a makefile with any text editor (that is a simple text file)
|
|
|
12-10-2014, 11:41 AM
|
#7
|
LQ Newbie
Registered: Dec 2014
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by pan64
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.
|
|
|
12-10-2014, 11:43 AM
|
#8
|
LQ Newbie
Registered: Dec 2014
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by pan64
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
|
|
|
12-10-2014, 11:44 AM
|
#9
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,476
|
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
|
|
|
12-10-2014, 11:46 AM
|
#10
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,476
|
also check this, probably helps
|
|
|
12-10-2014, 11:51 AM
|
#11
|
LQ Newbie
Registered: Dec 2014
Posts: 6
Original Poster
Rep:
|
Quote:
Originally Posted by pan64
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) >>$@
|
|
|
All times are GMT -5. The time now is 06:01 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|