可以链接到libboost但不能执行可执行文件

时间:2017-05-11 12:27:13

标签: c++ linux c++11 boost centos

我遇到的问题是我可以构建一个链接到libboost的可执行文件,但是当我执行可执行文件时,我会收到找不到库的错误。

boost库是计算机上的构建手册,并链接到可执行文件。

执行可执行文件时,我会收到错误:

g++ -o executable -O2 -I /root/filters/boost/boost/ -I /usr/include/mysql/ -lmysqlcppconn -lboost_regex -lmysqlclient -lpthread  -L/root/filters/boost/boost/stage/lib/  -std=c++11  *.cpp

即使我将编译器boost库放在可执行文件旁边,它也不起作用。

应用程序使用以下g ++命令构建:

!ENTRY org.eclipse.osgi 4 0 2017-05-11 14:24:11.013 !MESSAGE An error occurred while automatically activating bundle CR-IT_client (2). !STACK 0 org.osgi.framework.BundleException: Exception in com.client.eclipse.Activator.start() of bundle CR-IT_client.
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:795)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:724)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:932)
    at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:309)
    at org.eclipse.osgi.container.Module.doStart(Module.java:581)
    at org.eclipse.osgi.container.Module.start(Module.java:449)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:470)
    at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:529)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:325)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:345)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:423)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:564)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:103)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:74)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:56)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application.lambda$0(E4Application.java:235)
    at java.util.Optional.ifPresent(Unknown Source)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:234)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:148)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1492)

0 个答案:

没有答案