Jump to content
The Dark Mod Forums

link build error, can't find -lstdc++ (fedora 32)


Sneaker

Recommended Posts

I'm trying to build a debug trunk build (which I've been able to do in the past).  I'm doing a "cmake -DCMAKE_BUILD_TYPE="Debug" ..", then "make" in a subdirectory called build, but make bails at the linking of the binary:

[100%] Linking CXX executable thedarkmod.x64
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/TheDarkMod.dir/build.make:8080: thedarkmod.x64] Error 1
make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/TheDarkMod.dir/all] Error 2
make: *** [Makefile:104: all] Error 2

The libstdc++.so is installed and exists /lib/gcc/x86_64-redhat-linux/10/libstdc++.so.  I'm not really familiar with cmake, so I'm not sure the proper way to get things linked up...  any ideas?

(Now that I think about it, I think the last time I built darkmod (last year) was applying a scons patch, which I rather just get the correct way to build darkmod working...)

Link to comment
Share on other sites

Try removing and re-installing "libstdc" then try updating build-essential. ( I presume you have CMAKE 3.12 or newer ?)

 

Does it work if you specify your game directory ? :

-DGAME_DIR=../../darkmod

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

No go.  I reinstalled "gcc-c++/libstdc++/libstdc++-devel", they also all verified ok.  On fedora, we don't have a "build-essential" package, but I've generally built some things successfully with this install (still possible a package might be missing though, I have no idea what).

cmake version is: cmake-3.17.4-2.fc32.x86_64, so newer.  did use the "GAME_DIR" variable, but didn't outwardly seem to change anything.

Thanks for the help. Gotta take a break, my junky pc takes a long time to compile. :)

Link to comment
Share on other sites

"libstdc++" is the default C++ runtime library of GCC compiler.
There is also another C++ runtime library called "libc++", which is default library of Clang. I think GCC can also use it if explicitly said so, or maybe depending of distribution settings.

The CMakeLists for TDM does not mention "libstdc++" explicitly. Instead, GCC adds it automatically to the list of libraries, because... well, that's runtime library 😃
You might want to build empty file with "int main() {}" using simple "gcc a.c -o a" command and verify that it works.

I'm not good in Linux world. But I might speculate that it is possible that your GCC uses "libc++" by default, but TDM for some reason forces it to use "libstdc++" which does not work. Although it sounds like a stupid idea.

Another important fact is that TDM links runtime libraries statically.
The .so files which you found are dynamic libraries: when you link C++ program against .so file, the resulting executable cannot run without that .so file.
The static libraries normally have ".a" extension. I cannot say if GCC can magically link .so file statically as some smart special case: Visual C++ definitely cannot. So you might want to look up how static runtime libraries are named and search for them. You might want to look here for explanations or particular compiler arguments to link statically.

If static linking becomes a problem for you, then you can find and remove/command out the following string in CMakeLists.txt:

ucm_set_runtime(STATIC)

I think then compiler will link runtimes dynamically, since that is default mode.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 6 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...