IBM Support

"Undefined Reference" at building project 64bit Cygwin

Troubleshooting


Problem

Attempting to build a project with 64-bit Cygwin and IBM Rational Rhapsody results in "Undefined Reference" linker errors.

Symptom

You get the following output.




All Checks Terminated Successfully

Checker Done
0  Error(s), 0  Warning(s)

Code generated to directory: I:
/CaseTools/Simple_Model/DefaultComponent/DefaultConfig
Generating file LedCtrl.h (unmodified)
Generating file LedCtrl.cpp (unmodified)
Generating file Default.h (unmodified)
Generating file Default.cpp (unmodified)
Generating file InitWebResources.cpp
Generating main file MainDefaultComponent.h (unmodified)
Generating main file MainDefaultComponent.cpp (unmodified)
Generating make file DefaultComponent.mak

Code Generation Done

0  Error(s), 0  Warning(s), 0  Message(s)
Building ------------  DefaultComponent.exe   ------------
Executing: ""C:\ProgramData\IBM\Rational\Rhapsody\8.1.5\Share"
\etc\cygwinmake.bat DefaultComponent.mak build "CPU="  "
"Setting environment for Cygwin x64"
"make.exe all -f DefaultComponent.mak "CPU="      "
Compiling InitWebResources.cpp
Compiling MainDefaultComponent.cpp
Linking DefaultComponent.exe
InitWebResources.o: In function `InitWebResources':
/cygdrive/i/CaseTools/Simple_Model/DefaultComponent/DefaultConfig/InitWe
bResources.cpp:26: undefined reference to `AddWebLicenses'
/cygdrive/i/CaseTools/Simple_Model/DefaultComponent/DefaultConfig/InitWe
bResources.cpp:26:(.text+0x10): relocation truncated to fit:
R_X86_64_PC32 against undefined symbol `AddWebLicenses'
/cygdrive/i/CaseTools/Simple_Model/DefaultComponent/DefaultConfig/InitWe
bResources.cpp:28: undefined reference to `SetDeviceName'
/cygdrive/i/CaseTools/Simple_Model/DefaultComponent/DefaultConfig/InitWe
bResources.cpp:28:(.text+0x1c): relocation truncated to fit:
R_X86_64_PC32 against undefined symbol `SetDeviceName'
/cygdrive/i/CaseTools/Simple_Model/DefaultComponent/DefaultConfig/InitWe
bResources.cpp:30: undefined reference to `IsExternalWebconfig'
/cygdrive/i/CaseTools/Simple_Model/DefaultComponent/DefaultConfig/InitWe
bResources.cpp:30:(.text+0x21): relocation truncated to fit:
R_X86_64_PC32 against undefined symbol `IsExternalWebconfig'
/cygdrive/i/CaseTools/Simple_Model/DefaultComponent/DefaultConfig/InitWe
bResources.cpp:31: undefined reference to `SetHomePageUrl'
/cygdrive/i/CaseTools/Simple_Model/DefaultComponent/DefaultConfig/InitWe
bResources.cpp:31:(.text+0x36): relocation truncated to fit:
R_X86_64_PC32 against undefined symbol `SetHomePageUrl'
/cygdrive/i/CaseTools/Simple_Model/DefaultComponent/DefaultConfig/InitWe
bResources.cpp:32: undefined reference to `SetSignaturePageUrl'
/cygdrive/i/CaseTools/Simple_Model/DefaultComponent/DefaultConfig/InitWe
bResources.cpp:32:(.text+0x42): relocation truncated to fit:
R_X86_64_PC32 against undefined symbol `SetSignaturePageUrl'
/cygdrive/i/CaseTools/Simple_Model/DefaultComponent/DefaultConfig/InitWe
bResources.cpp:33: undefined reference to `SetRefreshTimeout'
/cygdrive/i/CaseTools/Simple_Model/DefaultComponent/DefaultConfig/InitWe
bResources.cpp:33:(.text+0x4c): relocation truncated to fit:
R_X86_64_PC32 against undefined symbol `SetRefreshTimeout'
/cygdrive/i/CaseTools/Simple_Model/DefaultComponent/DefaultConfig/InitWe
bResources.cpp:34: undefined reference to `SetPropPortNumber'
/cygdrive/i/CaseTools/Simple_Model/DefaultComponent/DefaultConfig/InitWe
bResources.cpp:34:(.text+0x56): relocation truncated to fit:
R_X86_64_PC32 against undefined symbol `SetPropPortNumber'
collect2: error: ld returned 1 exit status
DefaultComponent.mak:145: recipe for target 'DefaultComponent.exe'
failed
make: *** [DefaultComponent.exe] Error 1

Build Done

Cause

You must rebuild the Object Execution Framework for use with 64-bit Cygwin. If you are using the Webify feature, you also need to manually rebuild the WebServices library for 64-bit Cygwin.

Resolving The Problem

These instructions assume that you installed 64-bit Cygwin into the C:\cygwin directory and added
C:\cygwin\binto the PATH environment variable.

        

  1. Open a terminal window in the web services directory




  2. Rebuild your WebServices library:  



    Now, you created the library file:  \lib\cygwinWebServicesx64.a[

  3. Set the Rhapsody project property CPP_CG::Cygwin::CPU to "x64"




  4. Rebuild the Rhapsody OXF framework. You need to use the "Create Execution Environment" Code menu item in IBM Rational Rhapsody Designer or the "Build Framework" Code menu item in IBM Rational Rhapsody Developer.  

                                    
You can now build your project through code menu > rebuild.

[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF033","label":"Windows"}],"Version":"8.0;8.0.1;8.0.2;8.0.3;8.0.4;8.0.5;8.0.6;8.1;8.1.1;8.1.2;8.1.2.1;8.1.3;8.1.4;8.1.5;8.2","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21996379