I use Artix linux on OpenRC, I have installed wxwidgets with wxgtk3-dev package (version 3.1.5) from AUR and I wanted to work with that library in CLion. CLion sees it and I'm able to include anything from wx/ dir.
I have copied a hello world example from wxwidgets website and pasted it into my cpp source file and then CLion showed me a bunch of undeclired identifier errors (though some 'identifiers' like wxFrame are not 'undeclared'). But I'm able to build and run project and it works fine.
What's wrong with CLion and what can I do to fix this?
I've seen some guides but most of them tell about Windows and also they tell how to compile project that is not the problem in my case - it's compiling but CLion tells me that it won't compile (and still builds and runs it).
Here's also my CMakeLists.txt if needed: https://pastebin.com/58NwS4AP
OK I solved my problem. As you can see in my CMakeLists.txt it uses C++14. It seems that CLion can not properly handle some code from example with C++14 although it's not a problem for cmake and make to build it. I just switched to C++11:
set(CMAKE_CXX_STANDARD 11)
and now everything works!
Related
Im trying to use the CLion IDE for Cpp development where actual compilation is happening on a remote sever, Although all the headers files are available, the compiling on local environment would fail since the required libraries are only available in the remote server . Is there a way to use CLion just as an IDE with code completion option only. I've used NetBeans like this where it only provides code completion and i just cant find a way to do this with CLion
If I understand the question correctly, yes, it is possible.
I'm using Clion to write code for microcontroller applications where the actual compilation is done on the command line, not from within the IDE.
I feel like I'm stating the obvious, but you can just not click the "Build" button. You can point your include path to where your header files reside and Clion will give you code completion, as it only needs the headers for that.
Since Clion reads the CMakeLists.txt to figure out your project configuration, you'd need that and set your include path there.
cmake_minimum_required(VERSION 2.8.4)
project(my_cool_project)
set(INCLUDE_DIRECTORIES "/path/to/your/headers")
set(SOURCE_FILES src/main.cpp
src/foo.cpp
src/foo.h
src/bar.cpp
src/bar.h)
add_executable(my_cool_project ${SOURCE_FILES})
As I said, Clion uses the CMakeLists.txt as the project configuration, so look into setting up this file if you're not familiar with it already and you'll be set.
Can someone tell me if it's possible to compile a project that works with Qt but without installing the entire sdk ? I mean, something like recompile Qt source code and link the libraries or something like this.
I know my problem is weird but I work in special conditions : I am on a linux machine and I have to work on a windows project therefore I use a distant server on windows to compile but I can't install anything on this serveur. I need an idea to have a fully portable folder with Qt who can compile without installing anything.
I hope I was clear in my explications.
Thank you for your help.
I has combined comments in answer.
You need to install compiler (e.g minGW) and Qt Library (as needed version).
You should add into environment variable 'PATH' your path to qmake and compiler.
Start terminal and move to directory with your source code of Qt project.
Run qmake and then exec make (e.g. It, for minGW, is mingw32-make).
For your case, you may choosen 2 way:
Build static Qt Library from source code and use static linking with your project.
Install Qt Library and copy libraries near your project with dynamic linking (recomended).
I installed vtk in debian6.0.6 successfully, I build a static lib. I run the examples and everything is ok.
But I want to develop in codeblocks. So I created a project in codeblocks, copy the code "cone.cxx" into my project, I set the include path and linkers. But there are compile errors like "undefined reference to...", I guess that is because it can not find the interfaces in the static lib.
I guess I need some #defines before compile my project. I can see the pre_defines in visual studio2008, but I can not get it in codeblocks because the codeblocks project use its makefile defaultly. Can I get a solution if I don't want to write a makefile?
Okay, so I have a C++ project that uses SFML, and I want to be able to compile it from the CMD using MinGW. I have it so I can compile.cpp's, however, I just need to know what more I have to do in order for it to work with SFML. I tried compiling it with CodeBlocks and MinGW, and it works fine, until I try to run it, at which point it tells me that sfml-system.dll is missing from my computer. Does this mean I installed it incorrectly? I followed the CodeBlocks installation down to the letter, from what I could tell... I put the include\SFML in the include\ of MinGW, and I put all the *.a's from lib\ into the \lib of MinGW as well.
Thank you for the help you can give!
Ok, so if it builds well and links with the sfml-system.dll at link time then there is no real problem. All you need to do is copy the sfml-system.dll (or make a link to it) in the directory, where the built .exe file is. That would make the .exe find the required library.
libgcc_s_dw2-1.dll is just inside bin folder, on latest MinGW releases.
Copy to .exe folder, it should run.
I am tring to port this code to Linux
I believe OpenCV uses cmake to compile a VC++ code base in Linux, you create a dir, in that dir do cmake..., and a Makefile is generated. But I guess I would need a VC++ makefile first. My request is, at the very least, a VC++ makefile for the project above, and show it compiles the project with g++. If you can think of a general way, a tool that compile VC++, I'd like to hear about it.
CMake generates Makefile or VC++ project depending on your platform, so you'll end with a Makefile after running CMake.
However the code you mention isn't using neither OpenCV nor CMake, so I may be missing something...
There is some old tool called dsp2make for converting VC++6 to Makefile, but I doubt it'll be no-brainer. Better start with a CMakeLists.txt and list the cpp files you want to compile.