cygwin make错误:找不到指定的模块 [英] cygwin make error: Specified module could not be found

查看:110
本文介绍了cygwin make错误:找不到指定的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用第三方库时,我经常习惯使用 dll lib 扩展名,这些库我以前习惯在Windows环境中使用Visual Studio合并.

但是这次,我试图使用

BUILDING 文本文件提到它使用了我的cygwin环境可能缺少的一些套接字unix库,但是我无法弄清错误的确切来源,这是 BUILDING :

  C ++:此C ++子目录都是原始C ++代码.没有外部依赖关系(标准UNIX套接字代码除外)或库C ++领域的需求.Makefile.Linux提供了有关如何构建一些代码的示例:%make -f Makefile.Linux全部...将建立一堆范例程式以及'libptools.so',一个可以链接的PicklingTools的独立库.在您自己的代码中使用Ptools的简便方法可能是编译libptools.so(使用给定的Makefile)并反对它.%Make -f Makefile.Linux libptools.so在您自己的代码中,请确保您将以下标志添加到编译器(适用于Intel编译器和GNU编译器):-fno-strict-aliasing -DLINUX_ -DOC_NEW_STYLE_INCLUDES-不推荐使用-I/home/me/PicklingTools160/C ++/opencontainers_1_8_2/include -I/home/me/PicklingTools160/C ++ -pthread -D_REENTRANT 

我曾经尝试过环顾四周,但是找不到类似的东西可以帮助您.

解决方案

不幸的是,在较新版本的 make 中,load 是一个特殊词,当使用 load 时,make 会失败作为目标.实际上,这很糟糕,因为它违反了POSIX等.对此存在一个Savannah错误.您可以改用变量来解决此问题:

  load =加载$ {load):$ {COM_OBJS)load.o$(CC)$(CCFLAGS)$(COM_OBJS)load.o -o负载 

I was mostly used to dll and lib extensions when using third-party libraries which I used to comfortably incorporate using Visual Studio in my Windows Environment.

But this time, I'm trying to use PicklingTools which has a MakeFile.Linux file which I've been trying to build using make from cygwin.

The version of make is 4.3 while for g++ it is 9.2.0.

Here's the entire MakeFile.Linux source code:

CC = g++
# CC = icc     # Intel seems to work

## With g++ --version==4.4.x, you may need -fno-strict-aliasing to get rid 
## of some annoying warnings when you compile with -O2 or above

# *****CAREFUL! g++ 4.5.1 20100924 DOES NOT WORK with Ptools and -O.  You must
# compile without optimization for that compiler to work

OC = ./opencontainers_1_8_5
OCINC = $(OC)/include

CFLAGS = -Wall -Wextra -fpic -O -fno-strict-aliasing -DLINUX_ -DOC_NEW_STYLE_INCLUDES -Wno-deprecated -I$(OCINC) -pthread -D_REENTRANT

## How to build with OCString
##CFLAGS = -Wall -O4 -DLINUX_ -DOC_USE_OC_STRING -DOC_USE_OC_EXCEPTIONS -DOC_ONLY_NEEDED_STL -DOC_NEW_STYLE_INCLUDES -Wno-deprecated -I$(OCINC) 

###### CFLAGS = -Wall -O4 -DLINUX_-DOC_NEW_STYLE_INCLUDES -Wno-deprecated -I$(OCINC) 


CCFLAGS = -pthread $(CFLAGS)

COM_OBJS = m2pythontools.o valpython.o midassocket.o valprotocol2.o m2ser.o m2streamdataenc.o m2convertrep.o timeconv.o fdtools.o
OBJS = midastalker_ex.o midastalker_ex2.o httpclient_ex.o httpserver_ex.o $(COM_OBJS) load.o save.o sharedmemory.o 

all: midasyeller_ex midastalker_ex midastalker_ex2 httpclient_ex midasserver_ex permutation_server permutation_client load save opal2dict dict2opal opaltest midasyeller_ex midaslistener_ex p2_test valgetopt_ex sharedmem_test ready_test xmlload_test xmlload_ex xmldump_test xmldump_ex speed_test pickleloader_test chooseser_test xml2dict dict2xml serverside_ex clientside_ex middleside_ex

.cc.o:
    $(CC) $(CFLAGS) -c $<

libptools.so : $(COM_OBJS) 
    $(CC) $(CCFLAGS) $(COM_OBJS) -shared -o libptools.so

midasserver_ex : $(COM_OBJS) midasserver_ex.o
    $(CC) $(CCFLAGS) $(COM_OBJS) midasserver_ex.o -pthread -o midasserver_ex

httpclient_ex : $(COM_OBJS) httpclient_ex.o
    $(CC) $(CCFLAGS) $(COM_OBJS) httpclient_ex.o -pthread -o httpclient_ex

httpserver_ex : $(COM_OBJS) httpserver_ex.o
    $(CC) $(CCFLAGS) $(COM_OBJS) httpserver_ex.o -pthread -o httpserver_ex

midasyeller_ex : $(COM_OBJS) midasyeller_ex.o
    $(CC) $(CCFLAGS) $(COM_OBJS) midasyeller_ex.o -pthread -o midasyeller_ex

midaslistener_ex : $(COM_OBJS) midaslistener_ex.o
    $(CC) $(CCFLAGS) $(COM_OBJS) midaslistener_ex.o -pthread -o midaslistener_ex

permutation_server : $(COM_OBJS) permutation_server.o
    $(CC) $(CCFLAGS) $(COM_OBJS) permutation_server.o -pthread -o permutation_server

permutation_client : $(COM_OBJS) permutation_client.o
    $(CC) $(CCFLAGS) $(COM_OBJS) permutation_client.o -pthread -o permutation_client

midastalker_ex :$(COM_OBJS) midastalker_ex.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) midastalker_ex.o -o midastalker_ex

midastalker_ex2 :$(COM_OBJS) midastalker_ex2.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) midastalker_ex2.o -o midastalker_ex2

load : $(COM_OBJS) load.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) load.o -o load

serverside_ex : $(COM_OBJS) sharedmem.o shmboot.o serverside_ex.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) sharedmem.o shmboot.o -lrt serverside_ex.o -o serverside_ex 

middleside_ex : $(COM_OBJS) middleside_ex.o sharedmem.o shmboot.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) sharedmem.o shmboot.o -l rt middleside_ex.o -o middleside_ex 

clientside_ex : $(COM_OBJS) clientside_ex.o sharedmem.o shmboot.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) sharedmem.o shmboot.o -lrt clientside_ex.o -o clientside_ex 

samplehttpserver_ex : $(COM_OBJS) samplehttpserver_ex.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) samplehttpserver_ex.o -o samplehttpserver_ex

save : $(COM_OBJS) save.o
    $(CC) $(CCFLAGS) $(COM_OBJS) save.o -o save

opal2dict : $(COM_OBJS) opal2dict.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) opal2dict.o -o opal2dict

opaltest : $(COM_OBJS) opaltest.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) opaltest.o -o opaltest

ready_test : $(COM_OBJS) ready_test.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) ready_test.o -o ready_test

chooseser_test : $(COM_OBJS) chooseser_test.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) chooseser_test.o -o chooseser_test

dict2opal : $(COM_OBJS) dict2opal.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) dict2opal.o -o dict2opal

pickleloader_test :  $(COM_OBJS) pickleloader_test.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) pickleloader_test.o -o pickleloader_test -lrt

xmldump_test :  $(COM_OBJS) xmldump_test.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) xmldump_test.o -o xmldump_test -lrt

xmldump_ex :  $(COM_OBJS) xmldump_ex.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) xmldump_ex.o -o xmldump_ex -lrt

xmlload_test :  $(COM_OBJS) xmlload_test.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) xmlload_test.o -o xmlload_test -lrt

xmlload_ex :  $(COM_OBJS) xmlload_ex.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) xmlload_ex.o -o xmlload_ex -lrt

xml2dict :  $(COM_OBJS) xml2dict.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) xml2dict.o -o xml2dict -lrt

dict2xml :  $(COM_OBJS) dict2xml.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) dict2xml.o -o dict2xml -lrt
 
speed_test :  $(COM_OBJS) speed_test.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) speed_test.o -o speed_test -lrt

p2_test :  $(COM_OBJS) p2_test.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) p2_test.o -o p2_test -lrt

valgetopt_ex :  $(COM_OBJS) valgetopt_ex.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) valgetopt_ex.o -o valgetopt_ex

json_ex :  $(COM_OBJS) json_ex.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) json_ex.o -o json_ex

# Only the tests that REALLY uses UNIX shared memory need the -lrt
sharedmem_test :  $(COM_OBJS) sharedmem_test.o sharedmem.o
    $(CC) $(CCFLAGS) $(COM_OBJS) sharedmem.o -lrt sharedmem_test.o -o sharedmem_test


# Only the tests that REALLY uses UNIX shared memory need the -lrt
checkshm_test :  $(COM_OBJS) checkshm_test.o sharedmem.o
    $(CC) $(CCFLAGS) $(COM_OBJS) sharedmem.o -lrt checkshm_test.o -o checkshm_test


clean :
    /bin/rm -rf *.o *.so *~ midastalker_ex midastalker_ex2 httpserver_ex httpclient_ex midasserver_ex midasyeller_ex midaslistener_ex permutation_server permutation_client load save cxx_repository opal2dict opaltest dict2opal p2_test valgetopt_ex json_ex sharedmem_test ready_test speed_test pickleloader_test chooseser_test xmldump_test xmldump_ex xmlload_test xmlload_ex xml2dict dict2xml samplehttpserver_ex serverside_ex clientside_ex middleside_ex checkshm_test

Upon building it (after moving to that directory) using make -f MakeFile.Linux all I get the following error:

Makefile.Linux:61: The specified module could not be found.
Makefile.Linux:61: *** :: failed to load.  Stop.

Line number 60-63 is:


load : $(COM_OBJS) load.o 
    $(CC) $(CCFLAGS) $(COM_OBJS) load.o -o load

And here are the files that are available for C++ directory:

BUILDING textfile mentions that it uses some socket unix libraries which my cygwin environment maybe missing but I can't figure out the exact source of error, here are some relevant lines from BUILDING:

C++:    This C++ subdirectory is all raw C++ code.  There are no
        external dependencies (besides standard UNIX socket code) or libraries
        the C++ area needs.

        The Makefile.Linux gives examples how to build some code:
          
          % make -f Makefile.Linux all

        ... will build a bunch of sample programs as well 'libptools.so',
        a standalone library for PicklingTools you can link against.
         
        Probably the easist way to use Ptools in your own code is 
        to compile the libptools.so (using the given Makefile) 
        and link against it.

           % Make -f Makefile.Linux libptools.so
 
        In your own code, make sure you include the following flags to the
        compiler (should work for Intel compiler and GNU compiler):

            -fno-strict-aliasing -DLINUX_ -DOC_NEW_STYLE_INCLUDES -Wno-deprecated -I/home/me/PicklingTools160/C++/opencontainers_1_8_2/include -I/home/me/PicklingTools160/C++ -pthread -D_REENTRANT

I've tried looking around SO but couldn't find anything similar that could help.

解决方案

Unfortunately in newer versions of make, load is a special word and make fails when load is used as a target. This is quite bad, actually, as it violates POSIX etc. There's a Savannah bug open about this. You can work around the issue by using a variable instead:

load = load

$(load) : $(COM_OBJS) load.o 
        $(CC) $(CCFLAGS) $(COM_OBJS) load.o -o load

这篇关于cygwin make错误:找不到指定的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆