NO

Author Topic: POLINK: error: Unresolved external symbol '__penter'. - Why so?  (Read 5823 times)

pointercrash()

  • Guest
POLINK: error: Unresolved external symbol '__penter'. - Why so?
« on: November 27, 2008, 12:32:08 PM »
Hi Folks,

i'm just testing Pelles C, but immediately got stuck with Link errors. Here's the Code:
Code: [Select]
#include <stdlib.h>
int main(void);
int random(int max);

int random (int max)
{
return rand() / (RAND_MAX / max + 1); // [0... max]
}

int main(void)
{
unsigned int z1, z2;
srand(12);
z1 = random(45);
z2 = random(45);
return z1+z2;
}
and that's the Linker told:
POLINK: error: Unresolved external symbol '__penter'.
POLINK: error: Unresolved external symbol '_rand'.
POLINK: error: Unresolved external symbol '_srand'.
POLINK: error: Unresolved external symbol '__mainCRTStartup'.
POLINK: fatal error: 4 unresolved external(s).

And yes, the symbol database was built and yes, the project options->Linker-Subsystem is set to console. Any idea what might have gone wrong with that ???

Thanx for Your efforts,
 :)

JohnF

  • Guest
Re: POLINK: error: Unresolved external symbol '__penter'. - Why so?
« Reply #1 on: November 27, 2008, 04:46:39 PM »
Not that this will help much but I just tried it, no problems.

John

Offline Vortex

  • Member
  • *
  • Posts: 802
    • http://www.vortex.masmcode.com
Re: POLINK: error: Unresolved external symbol '__penter'. - Why so?
« Reply #2 on: November 27, 2008, 05:01:33 PM »
Hi pointercrash(),

No any problem with your source code. Did you specify the correct project type at the beginning?

Selecting the Win32 Console program ( EXE ) option in the New Project wizard, I get the following .ppj file :

Code: [Select]
#
# PROJECT FILE generated by "Pelles C for Windows, version 5.00".
# WARNING! DO NOT EDIT THIS FILE.
#

POC_PROJECT_VERSION = 5.00.1#
POC_PROJECT_TYPE = 3#
POC_PROJECT_ARGUMENTS = #
POC_PROJECT_WORKPATH = #
POC_PROJECT_EXECUTOR = #
CC = pocc.exe#
AS = poasm.exe#
RC = porc.exe#
LINK = polink.exe#
SIGN = posign.exe#
CCFLAGS =  -Tx86-coff -Ot -W1 -Gd #
ASFLAGS =  -AIA32 -Gd #
RCFLAGS = -r#
LINKFLAGS =  -subsystem:console -machine:x86  kernel32.lib advapi32.lib delayimp.lib#
SIGNFLAGS = -location:CU -store:MY -timeurl:http://timestamp.verisign.com/scripts/timstamp.dll -errkill#
INCLUDE = $(PellesCDir)\Include\Win;$(PellesCDir)\Include#
LIB = $(PellesCDir)\Lib\Win;$(PellesCDir)\Lib#

.SILENT:

#
# Build test.exe.
#
test.exe: \
output\test.obj
$(LINK) $(LINKFLAGS) -out:"$@" $**

#
# Build test.obj.
#
output\test.obj: \
test.c
$(CC) $(CCFLAGS) "$!" -Fo"$@"

.EXCLUDEDFILES:
Code it... That's all...

pointercrash()

  • Guest
Re: POLINK: error: Unresolved external symbol '__penter'. - Why so?
« Reply #3 on: November 27, 2008, 10:43:22 PM »
After rebuilding the project the 3rd time it suddenly worked.
There are some slight differences between the working and the not- working ppj. Where can i find the meaning of all switches?
So i'm gonna playin' around with the IDE hopefully to find "my" Environment. Good Chances that it could be "mine"  :)

Thanx again!
 :)

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: POLINK: error: Unresolved external symbol '__penter'. - Why so?
« Reply #4 on: November 28, 2008, 07:50:46 AM »
Where can i find the meaning of all switches?
Already tried the help file ???

There is usually no need to change the switches in the project file, just use the project properties dialog to configure them.

The key is using the correct template for a project, after that it is easy.
---
Stefan

Proud member of the UltraDefrag Development Team