如何使用cmake编译wxwidgets

时间:2017-06-21 14:17:23

标签: c++ cmake wxwidgets

我在尝试在我的项目中使用wxwidgets时遇到了一些麻烦(我在Linux上)。当我使用wxWidget 3.02时它运行良好,但是当我尝试使用3.1.0时,它停止工作。

我仍然拥有3.0.2(所以我可以有一些工作)但我想使用wxlistctrl :: EnableCheckBoxes(),所以我得到3.1.0。

在我的CMakeList中,我将FIND_PACKAGE(wxWidgets REQUIRED)更改为FIND_PACKAGE(wxWidgets 3.1.0 REQUIRED)

当我在构建目录中尝试cmake ..时,出现以下错误:

... could NOT find wxWidgets: Found unsuitable version "3.0.2", but required is 
at least `3.1.0`(found
-L/usr/local/lib//lib/x86_64-linux-gnu; ...

我知道该库位于/usr/local/lib我试图进入该目录,我在我的cmake中尝试了很多命令,但我不知道如何告诉cmake在好的库中搜索找到我想要的wxWidgets版本。

我很确定这是一个cmake错误,但它也可能是一个安装问题(即使我遵循教程 here)。更多,当我输入gtk-config --version时,我得到了“3.1.1”(这就是我期望的版本号,我得到了git版本)

如果有人有问题或想法解决我的问题,我会很难读到它=)

感谢的!

1 个答案:

答案 0 :(得分:-1)

CMake说您的cmake最低版本Traceback (most recent call last): File "C:\Users\USER\Documents\Projects\MastersEnv\GraphAutoEncoder\gae\layers.py", line 131, in _call x = tf.SparseTensor(x.indices,tf.map_fn(self._scan_wight_multiply , x.values ) , x.dense_shape) # x[Batch , Node , Feature ] X Wight[ Feature , 32 ] = output[Batch , Node , 32 ] File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\functional_ops.py", line 497, in map_fn maximum_iterations=n) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 3556, in while_loop return_same_structure) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 3087, in BuildLoop pred, body, original_loop_vars, loop_vars, shape_invariants) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 3022, in _BuildLoop body_result = body(*packed_vars_for_body) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 3525, in <lambda> body = lambda i, lv: (i + 1, orig_body(*lv)) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\functional_ops.py", line 486, in compute packed_fn_values = fn(packed_values) File "C:\Users\USER\Documents\Projects\MastersEnv\GraphAutoEncoder\gae\layers.py", line 113, in _wight_multiply result = tf.sparse_tensor_dense_matmul(current, self.vars['weights']) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\sparse_ops.py", line 2326, in sparse_tensor_dense_matmul sp_a = _convert_to_sparse_tensor(sp_a) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\sparse_ops.py", line 68, in _convert_to_sparse_tensor raise TypeError("Input must be a SparseTensor.") TypeError: Input must be a SparseTensor. I also tried replacing tf.sparse_tensor_dense_matmul with tf.matmul inside the map_function wight_multiply but I got the below error : File "C:\Users\USER\Documents\Projects\MastersEnv\GraphAutoEncoder\gae\layers.py", line 131, in _call x = tf.SparseTensor(x.indices,tf.map_fn(self._scan_wight_multiply , x.values ) , x.dense_shape) # x[Batch , Node , Feature ] X Wight[ Feature , 32 ] = output[Batch , Node , 32 ] File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\functional_ops.py", line 497, in map_fn maximum_iterations=n) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 3556, in while_loop return_same_structure) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 3087, in BuildLoop pred, body, original_loop_vars, loop_vars, shape_invariants) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 3022, in _BuildLoop body_result = body(*packed_vars_for_body) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 3525, in <lambda> body = lambda i, lv: (i + 1, orig_body(*lv)) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\functional_ops.py", line 486, in compute packed_fn_values = fn(packed_values) File "C:\Users\USER\Documents\Projects\MastersEnv\GraphAutoEncoder\gae\layers.py", line 113, in wight_multiply result = tf.matmul(current, self.vars['weights']) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\math_ops.py", line 2455, in matmul a, b, transpose_a=transpose_a, transpose_b=transpose_b, name=name) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\ops\gen_math_ops.py", line 5333, in mat_mul name=name) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper op_def=op_def) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func return func(*args, **kwargs) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\framework\ops.py", line 3300, in create_op op_def=op_def) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\framework\ops.py", line 1823, in __init__ control_input_ops) File "C:\ProgramData\Anaconda3\envs\weaklySupervisedGraph\lib\site-packages\tensorflow\python\framework\ops.py", line 1662, in _create_c_op raise ValueError(str(e)) ValueError: Shape must be rank 2 but is rank 0 for 'gcnmodelae/graphconvolutionsparse_1/map/while/MatMul' (op: 'MatMul') with input shapes: [], [300,32]. 低于wxWidgets的最低cmake版本3.0.2

尝试输入以下命令:3.1.0

这样,您所需的最低cmake版本将为cmake_minimum_required(VERSION 3.1.0),这样就可以了。