Menu

Compiling static

Help
2002-04-07
2002-04-07
  • Matthias Ivers

    Matthias Ivers - 2002-04-07

    Hi,

    short question: has anyone ever succeeded in compiling a program which links to CommonC++ (ccext and ccgnu) as a static executable?

    I use:

    g++ -g -O2 -L/usr/local/lib -D_REENTRANT -D_THREAD_SAFW -ldl -lxml -lpthread -lccgnu -lccext timm.o html.o url.o browser.o gprofthread.o -o timm -static

    and get _exactly_ the same result as if not specifying -lccext and -lccgnu while not using -static.

    To make it clear.. the abovementioned command behaves just like:

    g++ -g -O2 -L/usr/local/lib -D_REENTRANT -D_THREAD_SAFW -ldl -lxml -lpthread timm.o html.o url.o browser.o gprofthread.o -o timm

    However... using other libs i've not encountered problems like these until now... Suggetions?

     
    • Matthias Ivers

      Matthias Ivers - 2002-04-07

      strange... it does not have something to do with CommonC++... i tried to link it against CC++'s .o-files and got a similar result (now with pthread)... so i guess there's an error in the commandline... or a bug in ld?!

      although this is not commonc++ specifiy... input is still highly appreciated :-)...

       
    • Matthias Ivers

      Matthias Ivers - 2002-04-07

      It turned out, that:

      g++ -static -D_THREAD_SAFE -D_REENTRANT timm.o -lccgnu -lpthread -ldl -lccext url.o html.o browser.o gprofthread.o  -o timm

      works... but:

      g++ -static -D_THREAD_SAFE -D_REENTRANT -lccgnu -lpthread -ldl -lccext timm.o url.o html.o browser.o gprofthread.o  -o timm

      does not work....

      very strange...

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.