小编Arc*_*Tux的帖子

继承类的 vtable 的未定义引用

我正在尝试用 C++ 开发神经网络。

我利用类继承重构了我的代码,以允许我拥有不同类型的层,其神经元可以按顺序迭代。

我的问题是,我的链接器(由 g++ 调用的 ld)抱怨对 vtables 和 typeinfo-objects 的未定义引用。

据我所知,错误“未定义的引用vtable for class”来自于基类中未实现的纯虚方法,但不幸的是我无法更准确地定位错误。

全部制作:

g++ -Wall -fmessage-length=0 --std=c++11 -w   -c -o Test2dSparselyNeuralNet.o Test2dSparselyNeuralNet.cpp
g++ -Wall -fmessage-length=0 --std=c++11 -w   -c -o NeuralNet.o NeuralNet.cpp
g++ -Wall -fmessage-length=0 --std=c++11 -w   -c -o Sparsely2dNeuralNetwork.o Sparsely2dNeuralNetwork.cpp
g++ -Wall -fmessage-length=0 --std=c++11 -w   -c -o Connection.o Connection.cpp
g++ -Wall -fmessage-length=0 --std=c++11 -w   -c -o Layer2d.o Layer2d.cpp
g++ -Wall -fmessage-length=0 --std=c++11 -w   -c -o Neuron2dIterator.o Neuron2dIterator.cpp
g++ -Wall -fmessage-length=0 --std=c++11 -w   -c -o input/2dinput/cross/cross.o …
Run Code Online (Sandbox Code Playgroud)

c++ linker g++ ld neural-network

3
推荐指数
1
解决办法
2141
查看次数

cimg库 - 链接错误

我尝试使用cimg库.我已经包含了CImg.h-header文件.但是当我尝试编译它时,我收到链接错误.

/tmp/cc2tvYsW.o: In function `cimg_library::cimg::Mutex_info::trylock(unsigned int)':
tafelbilder.cpp:(.text._ZN12cimg_library4cimg10Mutex_info7trylockEj[_ZN12cimg_library4cimg10Mutex_info7trylockEj]+0x2b): undefined reference to `pthread_mutex_trylock'
/tmp/cc2tvYsW.o: In function `cimg_library::CImgDisplay::screen_width()':
tafelbilder.cpp:(.text._ZN12cimg_library11CImgDisplay12screen_widthEv[_ZN12cimg_library11CImgDisplay12screen_widthEv]+0x2c): undefined reference to `XOpenDisplay'
tafelbilder.cpp:(.text._ZN12cimg_library11CImgDisplay12screen_widthEv[_ZN12cimg_library11CImgDisplay12screen_widthEv]+0x98): undefined reference to `XCloseDisplay'
/tmp/cc2tvYsW.o: In function `cimg_library::CImgDisplay::screen_height()':
tafelbilder.cpp:(.text._ZN12cimg_library11CImgDisplay13screen_heightEv[_ZN12cimg_library11CImgDisplay13screen_heightEv]+0x2c): undefined reference to `XOpenDisplay'
tafelbilder.cpp:(.text._ZN12cimg_library11CImgDisplay13screen_heightEv[_ZN12cimg_library11CImgDisplay13screen_heightEv]+0x98): undefined reference to `XCloseDisplay'
/tmp/cc2tvYsW.o: In function `cimg_library::CImgDisplay::_handle_events(_XEvent const*)':
tafelbilder.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0xc7): undefined reference to `XUnmapWindow'
tafelbilder.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x12a): undefined reference to `XCheckWindowEvent'
tafelbilder.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x218): undefined reference to `XResizeWindow'
tafelbilder.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x2f5): undefined reference to `XCheckWindowEvent'
tafelbilder.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x348): undefined reference to `XGetWindowAttributes'
tafelbilder.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x35e): undefined reference to `XSync'
tafelbilder.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x390): undefined reference to `XSetInputFocus'
tafelbilder.cpp:(.text._ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent[_ZN12cimg_library11CImgDisplay14_handle_eventsEPK7_XEvent]+0x4ce): …
Run Code Online (Sandbox Code Playgroud)

c++ linker cimg

3
推荐指数
1
解决办法
2553
查看次数

使用intellij将Spring项目部署到apache tomcat8

请不要介意我问一个简单的问题.

我是Spring的新手,尤其是IntelliJ.我正在尝试使用IntelliJ将HelloWorld项目部署到apache tomcat.

我在名为/ web的文件夹中生成了index.jsp,其中包含以下内容

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>$Title$</title>
  </head>
  <body>
  $END$
  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

我还创建了一个包含以下内容的简单控制器

package main;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
 * Handles requests for the application home page.
 */
@Controller
public class MainController {

    @RequestMapping(value = "/")
    public String home() {
        System.out.println("HomeController: Passing through...");
        return "index.jsp";
    }
}
Run Code Online (Sandbox Code Playgroud)

我可以使用make编译项目,但是当我尝试打开时

HTTP://本地主机:8080 /家

我收到404错误.

那么如何配置IntelliJ以将我的HelloWorld-App部署到apache tomcat服务器?

java apache spring tomcat intellij-idea

1
推荐指数
1
解决办法
9770
查看次数

P标签旁边的表格

我希望得到以下结论:我有一个文本包装在一个p-tag和一个提交按钮以及一个隐藏的输入字段,包含在一个表单标签中.我希望<p>标签中的文字和按钮出现在同一行,我该怎么做(用css)?

<p>This is a example message text.</p><form method="POST"></input><input type="hidden" name="delete_message_id" value=" 1 "></input><input type="submit" value="delete"></input></form>
Run Code Online (Sandbox Code Playgroud)

因为我希望隐藏的输入字段与提交事件一起发送,所以我不能忘记包装form-tag.

css

0
推荐指数
1
解决办法
61
查看次数

标签 统计

c++ ×2

linker ×2

apache ×1

cimg ×1

css ×1

g++ ×1

intellij-idea ×1

java ×1

ld ×1

neural-network ×1

spring ×1

tomcat ×1