Hi
there’s a new IDE called Clions by JetBrains in an ‘Early Access’-program and I want to work with it. It already has great refactoring support and after coding in Java/Scala for a long time that is something I miss a lot in VisualStudio Express.
At the moment Clions uses cmake to create a project, there is no other way yet. You have to create a CMakeLists.txt with all necessary info in it.
I set up a very simple test and it does compile, but when linking starts I get loads of ‘undefined references’ to Urho3D.
I tried this first with a Urho3D-build from Visual Studio and thought this might have to do with Clion using mingW64-g++ (btw: is that idea correct?). So I build Urho3D with mingW64, but nothing changed. (and also I got a libUrho3D.a which won’t work on Windows, right?)
It’s totally possible that I make a stupid mistake somewhere or it could be a problem with the IDE. Do you have an idea? Does this look like it should work?
Do I have to build Urho3D.lib with mingW64?
This is the CMakeLists.txt I use:
cmake_minimum_required(VERSION 2.8.4)
project(test)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
include_directories(D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/Core
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/Audio
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/Container
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/Engine
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/Graphics
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/Input
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/IO
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/LuaScript
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/Math
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/Navigation
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/Network
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/Physics
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/Resource
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/Scene
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/Script
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/UI
D:/dev/hvfn/cpp/Urho3D-1.31/Source/Engine/Urho2D
d:/dev/hvfn/cpp/Urho3D-1.31/Source/ThirdParty/Bullet/src
d:/dev/hvfn/cpp/Urho3D-1.31/Source/ThirdParty/kNet/include
d:/dev/hvfn/cpp/Urho3D-1.31/Source/ThirdParty/SDL/include
d:/dev/hvfn/cpp/Urho3D-1.31/Source/ThirdParty/AngelScript/include
d:/dev/hvfn/cpp/Urho3D-1.31/Build/Engine
"d:/dev/bin/Microsoft DirectX SDK (June 2010)/Include" )
link_directories( "d:/dev/bin/Microsoft DirectX SDK (June 2010)/Lib/x64"
"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib"
)
set(SOURCE_FILES Test.cpp Test.h)
add_executable(test ${SOURCE_FILES})
target_link_libraries (test
D:/dev/hvfn/cpp/Urho3D-1.31/Lib/Urho3D_d.lib
d3d9.lib
d3dcompiler.lib
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
comdlg32.lib
advapi32.lib
winmm.lib
imm32.lib
version.lib
ws2_32.lib
dbghelp.lib )
and the output when building:
D:\dev\bin\clion-138.2344.15\bin\cmake\bin\cmake.exe --build C:\Users\shu\.clion10\system\cmake\generated\6e94f7d7\6e94f7d7\Debug --target test -- -j 4
e[35me[1mScanning dependencies of target test
e[0m[100%] e[32mBuilding CXX object CMakeFiles/test.dir/Test.cpp.obj
e[0me[31me[1mLinking CXX executable test.exe
e[0mCMakeFiles\test.dir/objects.a(Test.cpp.obj): In function `Z14RunApplicationv':
D:/dev/hvfn/cpp/untitled/Test.h:22: undefined reference to `_imp___ZN6Urho3D7ContextC1Ev'
D:/dev/hvfn/cpp/untitled/Test.h:22: undefined reference to `_imp___ZN6Urho3D11Application3RunEv'
CMakeFiles\test.dir/objects.a(Test.cpp.obj): In function `main':
D:/dev/hvfn/cpp/untitled/Test.h:22: undefined reference to `_imp___ZN6Urho3D14ParseArgumentsEiPPc'
CMakeFiles\test.dir/objects.a(Test.cpp.obj): In function `ZN4TestC2EPN6Urho3D7ContextE':
D:/dev/hvfn/cpp/untitled/Test.cpp:4: undefined reference to `_imp___ZN6Urho3D11ApplicationC2EPNS_7ContextE'
CMakeFiles\test.dir/objects.a(Test.cpp.obj): In function `ZN4Test5StartEv':
D:/dev/hvfn/cpp/untitled/Test.cpp:17: undefined reference to `_imp___ZN6Urho3D6Object16SubscribeToEventENS_10StringHashEPNS_12EventHandlerE'
CMakeFiles\test.dir/objects.a(Test.cpp.obj): In function `ZN4Test13HandleKeyDownEN6Urho3D10StringHashERNS0_7HashMapINS0_15ShortStringHashENS0_7VariantEEE':
D:/dev/hvfn/cpp/untitled/Test.cpp:31: undefined reference to `_imp___ZN6Urho3D6Engine4ExitEv'
CMakeFiles\test.dir/objects.a(Test.cpp.obj): In function `_static_initialization_and_destruction_0':
D:/dev/hvfn/cpp/Urho3D-1.31-gcc/Source/Engine/Input/InputEvents.h:35: undefined reference to `_imp___ZN6Urho3D10StringHashC1EPKc'
D:/dev/hvfn/cpp/Urho3D-1.31-gcc/Source/Engine/Input/InputEvents.h:37: undefined reference to `_imp___ZN6Urho3D15ShortStringHashC1EPKc'
D:/dev/hvfn/cpp/Urho3D-1.31-gcc/Source/Engine/Input/InputEvents.h:38: undefined reference to `_imp___ZN6Urho3D15ShortStringHashC1EPKc'
[and so on...]