Skip to content
This repository was archived by the owner on Dec 29, 2025. It is now read-only.
This repository was archived by the owner on Dec 29, 2025. It is now read-only.

pm5example1 failure #13

@arnholm

Description

@arnholm

I have written a Code::Blocks plugin to generate a premake5 script from a Code::Blocks workspace. There is an example with generated premake5 lua script at https://github.com/arnholm/pm5example1 . This example contains a static library, a shared library and a console application, all extremely small and simple.

It is possible to successfully build this example on linux or windows using premake5 generating makefiles or Visual Studion files:

premake5 --file=pm5example1_premake5.lua gmake2
premake5 --file=pm5example1_premake5.lua vs2019

Now I installed your premake-cmake under Kubuntu 20.04 to see if it would be possible to build the same via CMake, so I did

premake5 --file=pm5example1_premake5.lua cmake
Building configurations...
Running action 'cmake'...
Generated build/cmake/CMakeLists.txt...
Generated build/cmake/long/path/staticlib1/staticlib1.cmake...
Generated build/cmake/dynlib1/dynlib1.cmake...
Generated build/cmake/testconsole/testconsole.cmake...

and then

cd build/cmake
cmake .
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /ssd1/codeblocks/gtk2-unicode-3.0/plugin_dev/pm5example1/build/cmake

So far so good, but build fails

make
Scanning dependencies of target staticlib1
[ 16%] Building CXX object CMakeFiles/staticlib1.dir/ssd1/codeblocks/gtk2-unicode-3.0/plugin_dev/pm5example1/long/path/staticlib1/staticlib1_class.cpp.o
[ 33%] Linking CXX executable long/path/staticlib1/bin/debug/staticlib1
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/staticlib1.dir/build.make:84: long/path/staticlib1/bin/debug/staticlib1] Error 1
make[1]: *** [CMakeFiles/Makefile2:108: CMakeFiles/staticlib1.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions